2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 22:06:28 +00:00

Renamed Theme to ColorTheme, ColorTheme is now a per-user selection

This commit is contained in:
eeintech
2020-09-07 16:27:23 -05:00
parent 2e5ec5d249
commit 10dd8fad80
8 changed files with 56 additions and 39 deletions

View File

@ -6,7 +6,7 @@ from django import template
from InvenTree import version, settings
from InvenTree.helpers import decimal2string
from common.models import InvenTreeSetting, Theme
from common.models import InvenTreeSetting, ColorTheme
register = template.Library()
@ -91,6 +91,9 @@ def inventree_setting(key, *args, **kwargs):
@register.simple_tag()
def get_theme_css():
user_theme = Theme.objects.all().get().theme
def get_theme_css(username):
try:
user_theme = ColorTheme.objects.filter(user=username).get().name
except ColorTheme.DoesNotExist:
user_theme = ''
return f'{settings.STATIC_URL}css/inventree' + user_theme + '.css'