From 8ef33bb701d18f1d4fca4f3365df664aebcbcdd5 Mon Sep 17 00:00:00 2001 From: Zambom Date: Thu, 12 Jan 2017 18:09:43 -0200 Subject: [PATCH] implementing css style selected --- amadeus/templates/base.html | 6 +++--- amadeus/templates/css_theme.html | 5 +++++ amadeus/templatetags/css_theme.py | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 amadeus/templates/css_theme.html create mode 100644 amadeus/templatetags/css_theme.py diff --git a/amadeus/templates/base.html b/amadeus/templates/base.html index 07f5610..d402ece 100644 --- a/amadeus/templates/base.html +++ b/amadeus/templates/base.html @@ -1,7 +1,6 @@ -{% load static i18n %} -{% load static i18n permission_tags django_bootstrap_breadcrumbs %} +{% load static i18n django_bootstrap_breadcrumbs css_theme %} {% get_current_language as LANGUAGE_CODE %} @@ -47,7 +46,7 @@ - + @@ -60,6 +59,7 @@ + {% css_theme %} diff --git a/amadeus/templates/css_theme.html b/amadeus/templates/css_theme.html new file mode 100644 index 0000000..ae0a0a7 --- /dev/null +++ b/amadeus/templates/css_theme.html @@ -0,0 +1,5 @@ +{% load static %} + +{% with 'css/themes/'|add:theme|add:'.css' as theme_selected %} + +{% endwith %} \ No newline at end of file diff --git a/amadeus/templatetags/css_theme.py b/amadeus/templatetags/css_theme.py new file mode 100644 index 0000000..55ac00c --- /dev/null +++ b/amadeus/templatetags/css_theme.py @@ -0,0 +1,15 @@ +from django import template + +from themes.models import Themes + +register = template.Library() + +@register.inclusion_tag('css_theme.html') +def css_theme(): + theme = Themes.objects.get(id = 1) + + context = { + 'theme': theme.css_style + } + + return context \ No newline at end of file -- libgit2 0.21.2