Skip to content

Commit 4c07a3e

Browse files
authored
Merge pull request #255 from N5GEH/248-remove-n5geh-logo-from-header-make-it-configurable
chore(entirety): made logo and title image configurable
2 parents ee53881 + 1a30186 commit 4c07a3e

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.conf import settings
2+
3+
4+
def logo_filename(request):
5+
return {"logo_filename": settings.LOGO_FILENAME}

app/Entirety/entirety/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class Settings(BaseSettings):
157157
"django.template.context_processors.request",
158158
"django.contrib.auth.context_processors.auth",
159159
"django.contrib.messages.context_processors.messages",
160+
"entirety.context_processors.logo_filename",
160161
],
161162
},
162163
},
@@ -390,6 +391,8 @@ def secret_key_not_empty(cls, v) -> str:
390391
default=os.path.join(BASE_DIR, "media/"), alias="MEDIA_ROOT"
391392
)
392393

394+
LOGO_FILENAME: str = Field(default="Entirety-logo.png", alias="LOGO_FILENAME")
395+
393396
TIME_ZONE: str = Field(default="Europe/Berlin", alias="TIME_ZONE")
394397

395398
COMPRESS_ENABLED: bool = Field(default=not DEBUG, alias="COMPRESS_ENABLED")

app/Entirety/templates/_base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta charset="UTF-8">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99

10-
<link rel="shortcut icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}">
10+
<link rel="shortcut icon" type="image/x-icon" href="{% static 'img/' %}{{ logo_filename }}">
1111
<title>Entirety - {% block title %}(Title){% endblock %}</title>
1212

1313

@@ -26,7 +26,7 @@
2626
<span class="navbar-toggler-icon"></span>
2727
</button>
2828
<a class="navbar-brand" href="{% url "home" %}">
29-
<img src="{% static 'img/n5geh.png' %}" alt="project logo" height="30"
29+
<img src="{% static 'img/' %}{{ logo_filename }}" alt="project logo" height="30"
3030
class="d-inline-block align-text-top">
3131
<img src="{% static 'img/fiware.gif' %}" alt="fiware" height="30"
3232
class="d-inline-block align-text-top">

docs/SETTINGS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,9 @@ Server admins can create/update projects for any project admin.
242242
> *description:* Hostname under which the application will be accessible
243243
>
244244
> *default:* localhost
245+
246+
### LOGO_FILENAME
247+
248+
> *description:* The filename of the image to be used as the logo, it should be uploaded to /app/Entirety/static/img folder.
249+
>
250+
> *default:* Entirety-logo.png

0 commit comments

Comments
 (0)