2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

add custom logo option

This commit is contained in:
Matthias
2022-04-24 16:13:44 +02:00
parent 002f5ec288
commit 1bce7b745e
5 changed files with 25 additions and 4 deletions

View File

@ -18,7 +18,8 @@ from django.conf import settings as djangosettings
from django import template
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.templatetags.static import StaticNode
from django.templatetags.static import StaticNode, static
from django.core.files.storage import default_storage
from InvenTree import version, settings
@ -529,6 +530,15 @@ def inventree_customize(reference, *args, **kwargs):
return djangosettings.CUSTOMIZE.get(reference, '')
@register.simple_tag()
def inventree_logo(*args, **kwargs):
""" Return the path to the logo-file """
if settings.CUSTOM_LOGO:
return default_storage.url(settings.CUSTOM_LOGO)
return static('img/inventree.png')
class I18nStaticNode(StaticNode):
"""
custom StaticNode