added ability to set custom logo in navbar
This commit is contained in:
parent
31f93285d8
commit
977d2822bc
@ -82,7 +82,7 @@
|
|||||||
{% if not request.user.is_authenticated or request.user.userpreference.theme == request.user.userpreference.TANDOOR %}
|
{% if not request.user.is_authenticated or request.user.userpreference.theme == request.user.userpreference.TANDOOR %}
|
||||||
<a class="navbar-brand p-0 me-2 justify-content-center" href="{% base_path request 'base' %}"
|
<a class="navbar-brand p-0 me-2 justify-content-center" href="{% base_path request 'base' %}"
|
||||||
aria-label="Tandoor">
|
aria-label="Tandoor">
|
||||||
<img class="brand-icon" src="{% static 'assets/brand_logo.png' %}" alt="Logo">
|
<img class="brand-icon" src="{% logo_url request %}" alt="Logo">
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -96,7 +96,7 @@
|
|||||||
{% if not request.user.is_authenticated or request.user.userpreference.theme == request.user.userpreference.TANDOOR %}
|
{% if not request.user.is_authenticated or request.user.userpreference.theme == request.user.userpreference.TANDOOR %}
|
||||||
<a class="navbar-brand p-0 me-2 justify-content-center" href="{% base_path request 'base' %}"
|
<a class="navbar-brand p-0 me-2 justify-content-center" href="{% base_path request 'base' %}"
|
||||||
aria-label="Tandoor">
|
aria-label="Tandoor">
|
||||||
<img class="brand-icon" src="{% static 'assets/brand_logo.png' %}" alt="Logo">
|
<img class="brand-icon" src="{% logo_url request %}" alt="Logo">
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -25,6 +25,14 @@ def theme_url(request):
|
|||||||
raise AttributeError
|
raise AttributeError
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def logo_url(request):
|
||||||
|
if request.user.is_authenticated and request.space.image:
|
||||||
|
return request.space.image.file.url
|
||||||
|
else:
|
||||||
|
return static('assets/brand_logo.png')
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def nav_color(request):
|
def nav_color(request):
|
||||||
if not request.user.is_authenticated:
|
if not request.user.is_authenticated:
|
||||||
|
Loading…
Reference in New Issue
Block a user