Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
Feature/SK-410 | App logos should not be stored on objects but read f…
Browse files Browse the repository at this point in the history
…rom statics folder (#113)
  • Loading branch information
niklastheman committed Apr 5, 2023
1 parent cb507aa commit 3b5ffcd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
26 changes: 13 additions & 13 deletions fixtures/apps_fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
},
"chart": "apps/mongo-express/chart",
"logo": "apps/mongo-express/logo.png",
"logo": "mongo-express-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -60,7 +60,7 @@
}
},
"chart": "apps/mongodb/chart",
"logo": "apps/mongodb/logo.png",
"logo": "mongodb-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -97,7 +97,7 @@
}
},
"chart": "apps/fedn-combiner/chart",
"logo": "apps/fedn-combiner/logo.png",
"logo": "fedn-combiner-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -136,7 +136,7 @@
}
},
"chart": "apps/fedn-reducer/chart",
"logo": "apps/fedn-reducer/logo.png",
"logo": "fedn-reducer-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -188,7 +188,7 @@
}
},
"chart": "apps/docker-registry/chart",
"logo": "apps/docker-registry/logo.png",
"logo": "docker-registry-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -237,7 +237,7 @@
"export-cli": "True"
},
"chart": "apps/jupyter-lab/chart",
"logo": "apps/jupyter-lab/logo.png",
"logo": "jupyter-lab-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -290,7 +290,7 @@
}
},
"chart": "apps/minio/chart",
"logo": "apps/minio/logo.png",
"logo": "minio-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -343,7 +343,7 @@
}
},
"chart": "apps/mlflow/chart",
"logo": "apps/mlflow/logo.png",
"logo": "mlflow-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -399,7 +399,7 @@
"publishable": "true"
},
"chart": "apps/mlflow-serve/chart",
"logo": "apps/mlflow-serve/logo.png",
"logo": "mlflow-serve-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -448,7 +448,7 @@
"publishable": "true"
},
"chart": "apps/tensorflow-serve/chart",
"logo": "apps/tensorflow-serve/logo.png",
"logo": "tensorflow-serve-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -515,7 +515,7 @@
"publishable": "true"
},
"chart": "apps/pytorch-serve/chart",
"logo": "apps/pytorch-serve/logo.png",
"logo": "pytorch-serve-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -568,7 +568,7 @@
}
},
"chart": "apps/volumeK8s/chart",
"logo": "apps/volumeK8s/logo.png",
"logo": "volumeK8s-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down Expand Up @@ -609,7 +609,7 @@
}
},
"chart": "apps/vscode/chart",
"logo": "charts/apps/vscode/logo.png",
"logo": "vscode-logo.png",
"updated_on": "2021-03-10T19:45:03.927Z",
"created_on": "2021-02-19T21:34:37.815Z"
}
Expand Down
5 changes: 1 addition & 4 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ class Apps(models.Model):
chart_archive = models.FileField(upload_to="apps/", null=True, blank=True)
created_on = models.DateTimeField(auto_now_add=True)
description = models.TextField(blank=True, null=True, default="")
logo = models.CharField(max_length=512, default="")
logo_file = models.ImageField(
upload_to="apps/logos", null=True, blank=True
)
logo = models.CharField(max_length=512, null=True, blank=True)
name = models.CharField(max_length=512)
priority = models.IntegerField(default=100)
projects = models.ManyToManyField("projects.Project")
Expand Down
3 changes: 2 additions & 1 deletion templates/app_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<tbody>
{% for appinstance in appinstances %}
<tr>
<td><img src="{{ media_url }}{{ appinstance.app.logo_file }}" class="img-fluid " style="max-height:25px;"></td>
{% static 'images/logos/apps/' as static_url %}
<td><img src="{{static_url}}{{appinstance.app.logo|default:'default-logo.png'}}" class="img-fluid " style="max-height:25px;"></td>
<td>{{ appinstance.app.name }}</td>
<td>{{ appinstance.name }}</td>
{% if appinstance.table_field.url %}
Expand Down
4 changes: 3 additions & 1 deletion templates/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ <h3>{{ app.name }}</h3>
</div>
</div>
<div class="col-4">
<img src="{{ media_url }}{{ app.logo_file }}" class="img-fluid float-end" style="height:100px;"

{% static 'images/logos/apps/' as static_url %}
<img src="{{static_url}}{{app.logo|default:'default-logo.png'}}" class="img-fluid float-end" style="height:100px;"
alt="App Logo">
</div>
</div>
Expand Down

0 comments on commit 3b5ffcd

Please sign in to comment.