Commit 6ac8d81389e834d681879a200e3e2ae67fb4fdfa
1 parent
b4af4330
Exists in
master
and in
3 other branches
Change css templatetag by context_processor
Showing
5 changed files
with
16 additions
and
23 deletions
Show diff stats
amadeus/settings.py
amadeus/templates/base.html
1 | 1 | <!DOCTYPE html> |
2 | 2 | |
3 | -{% load static i18n django_bootstrap_breadcrumbs css_theme %} | |
3 | +{% load static i18n django_bootstrap_breadcrumbs %} | |
4 | 4 | {% get_current_language as LANGUAGE_CODE %} |
5 | 5 | |
6 | 6 | <html> |
... | ... | @@ -59,7 +59,9 @@ |
59 | 59 | <!-- Summernote --> |
60 | 60 | <script src="{% static 'summernote/summernote.js' %}" type="text/javascript"></script> |
61 | 61 | <link href="{% static 'summernote/summernote.css' %}" type="text/css" rel="stylesheet" /> |
62 | - {% css_theme %} | |
62 | + {% with 'css/themes/'|add:theme.css_style|add:'.css' as theme_selected %} | |
63 | + <link rel="stylesheet" type="text/css" href="{% static theme_selected %}"> | |
64 | + {% endwith %} | |
63 | 65 | |
64 | 66 | </head> |
65 | 67 | <body> |
... | ... | @@ -73,7 +75,7 @@ |
73 | 75 | </button> |
74 | 76 | <a class="navbar-brand" href="{% url 'subjects:home' %}"> |
75 | 77 | <img class="logo pull-left" src="{% static 'img/topo-amadeus-white.png' %}" alt="Logo" /> |
76 | - <span class="pull-right project_name">Projeto Amadeus</span> | |
78 | + <span class="pull-right project_name">{{ theme.title }}</span> | |
77 | 79 | </a> |
78 | 80 | </div> |
79 | 81 | <div class="navbar-collapse collapse navbar-responsive-collapse"> | ... | ... |
amadeus/templates/css_theme.html
amadeus/templatetags/css_theme.py
... | ... | @@ -1,15 +0,0 @@ |
1 | -from django import template | |
2 | - | |
3 | -from themes.models import Themes | |
4 | - | |
5 | -register = template.Library() | |
6 | - | |
7 | -@register.inclusion_tag('css_theme.html') | |
8 | -def css_theme(): | |
9 | - theme = Themes.objects.get(id = 1) | |
10 | - | |
11 | - context = { | |
12 | - 'theme': theme.css_style | |
13 | - } | |
14 | - | |
15 | - return context | |
16 | 0 | \ No newline at end of file |