Commit 8d3c5ca1b96188a5046bc3770f726a9cff451f99
1 parent
74cfcd50
Exists in
master
and in
2 other branches
Contrast view created
Showing
1 changed file
with
15 additions
and
0 deletions
Show diff stats
themes/views.py
@@ -3,6 +3,8 @@ from django.shortcuts import render | @@ -3,6 +3,8 @@ from django.shortcuts import render | ||
3 | from django.contrib import messages | 3 | from django.contrib import messages |
4 | from django.core.urlresolvers import reverse, reverse_lazy | 4 | from django.core.urlresolvers import reverse, reverse_lazy |
5 | from django.utils.translation import ugettext_lazy as _ | 5 | from django.utils.translation import ugettext_lazy as _ |
6 | +from django.http import HttpResponse, JsonResponse, HttpResponseRedirect | ||
7 | +from django.shortcuts import redirect | ||
6 | 8 | ||
7 | from braces import views as braces_mixins | 9 | from braces import views as braces_mixins |
8 | 10 | ||
@@ -77,3 +79,16 @@ class CSSStyleSettings(braces_mixins.LoginRequiredMixin, braces_mixins.Staffuser | @@ -77,3 +79,16 @@ class CSSStyleSettings(braces_mixins.LoginRequiredMixin, braces_mixins.Staffuser | ||
77 | context['settings_menu_active'] = "settings_menu_active" | 79 | context['settings_menu_active'] = "settings_menu_active" |
78 | 80 | ||
79 | return context | 81 | return context |
82 | + | ||
83 | +def Contrast(request): | ||
84 | + theme = Themes.objects.get(id = 1) | ||
85 | + | ||
86 | + if theme.css_style == 'contrast': | ||
87 | + theme.css_style = 'green' | ||
88 | + else: | ||
89 | + theme.css_style = 'contrast' | ||
90 | + theme.save() | ||
91 | + | ||
92 | + caminho = request.META.get('HTTP_REFERER') | ||
93 | + | ||
94 | + return HttpResponseRedirect(caminho) |