Commit 10310d4c04c64c1d6b7bbbac1744a14dec92a39c
1 parent
e91971ca
Exists in
master
and in
2 other branches
Responsive language and constrast link
Showing
3 changed files
with
81 additions
and
6 deletions
Show diff stats
amadeus/static/css/base/amadeus_responsive.css
themes/views.py
@@ -83,4 +83,4 @@ class CSSStyleSettings(braces_mixins.LoginRequiredMixin, braces_mixins.Staffuser | @@ -83,4 +83,4 @@ class CSSStyleSettings(braces_mixins.LoginRequiredMixin, braces_mixins.Staffuser | ||
83 | @log_decorator("contrast", "click", "contrast") | 83 | @log_decorator("contrast", "click", "contrast") |
84 | def Contrast(request): | 84 | def Contrast(request): |
85 | caminho = request.META.get('HTTP_REFERER') | 85 | caminho = request.META.get('HTTP_REFERER') |
86 | - return HttpResponseRedirect(caminho) | 86 | - return HttpResponseRedirect(caminho) |
87 | + return HttpResponseRedirect(caminho) | ||
87 | \ No newline at end of file | 88 | \ No newline at end of file |
users/templates/users/login.html
@@ -80,10 +80,10 @@ | @@ -80,10 +80,10 @@ | ||
80 | <li class="dropdown language-selector pull-right " style="margin-top:1px;margin-right:10px;"> | 80 | <li class="dropdown language-selector pull-right " style="margin-top:1px;margin-right:10px;"> |
81 | {% get_current_language as LANGUAGE_CODE %} | 81 | {% get_current_language as LANGUAGE_CODE %} |
82 | 82 | ||
83 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true"> | 83 | + <a href="#" class="dropdown-toggle hidden-sm hidden-xs" data-toggle="dropdown" data-close-others="true"> |
84 | <span >[{{LANGUAGE_CODE}}] </span> | 84 | <span >[{{LANGUAGE_CODE}}] </span> |
85 | </a> | 85 | </a> |
86 | - <a href="{% url 'themes:contrast' %}" id = "contrast_button" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust"></i></a> | 86 | + <a href="{% url 'themes:contrast' %}" id = "contrast_button" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust hidden-sm hidden-xs"></i></a> |
87 | <ul class="dropdown-menu"> | 87 | <ul class="dropdown-menu"> |
88 | {% get_available_languages as LANGUAGES %} | 88 | {% get_available_languages as LANGUAGES %} |
89 | {% get_language_info_list for LANGUAGES as languages %} | 89 | {% get_language_info_list for LANGUAGES as languages %} |
@@ -108,12 +108,12 @@ | @@ -108,12 +108,12 @@ | ||
108 | 108 | ||
109 | <li class="dropdown language-selector pull-right " style="margin-top:1px;margin-right:10px;"> | 109 | <li class="dropdown language-selector pull-right " style="margin-top:1px;margin-right:10px;"> |
110 | {% get_current_language as LANGUAGE_CODE %} | 110 | {% get_current_language as LANGUAGE_CODE %} |
111 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true"> | 111 | + <a href="#" class="dropdown-toggle hidden-sm hidden-xs" data-toggle="dropdown" data-close-others="true"> |
112 | 112 | ||
113 | <span>[{{LANGUAGE_CODE}}] </span> | 113 | <span>[{{LANGUAGE_CODE}}] </span> |
114 | 114 | ||
115 | </a> | 115 | </a> |
116 | - <a href="{% url 'themes:contrast'%}" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust"></i></a> | 116 | + <a href="{% url 'themes:contrast'%}" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust hidden-sm hidden-xs"></i></a> |
117 | <ul class="dropdown-menu"> | 117 | <ul class="dropdown-menu"> |
118 | {% get_available_languages as LANGUAGES %} | 118 | {% get_available_languages as LANGUAGES %} |
119 | {% get_language_info_list for LANGUAGES as languages %} | 119 | {% get_language_info_list for LANGUAGES as languages %} |
@@ -134,8 +134,63 @@ | @@ -134,8 +134,63 @@ | ||
134 | </div> | 134 | </div> |
135 | {% endif %} | 135 | {% endif %} |
136 | </div> | 136 | </div> |
137 | - </div> | 137 | + </div> |
138 | </div> | 138 | </div> |
139 | + <div class="row login_subcommands hidden-lg hidden-md"> | ||
140 | + {% if not deny_register %} | ||
141 | + <div class="col-sm-12 col-xs-12"> | ||
142 | + <li class="dropdown language-selector "> | ||
143 | + {% get_current_language as LANGUAGE_CODE %} | ||
144 | + | ||
145 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true"> | ||
146 | + <span >[{{LANGUAGE_CODE}}] </span> | ||
147 | + </a> | ||
148 | + <a href="{% url 'themes:contrast' %}" id = "contrast_button_mobile" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust"></i></a> | ||
149 | + <ul class="dropdown-menu"> | ||
150 | + {% get_available_languages as LANGUAGES %} | ||
151 | + {% get_language_info_list for LANGUAGES as languages %} | ||
152 | + | ||
153 | + {% for language in languages %} | ||
154 | + <li {% if language.code == LANGUAGE_CODE %} | ||
155 | + class="active" | ||
156 | + {% endif %}> | ||
157 | + <a class="language-item" value-lang="{{language.code}}"> | ||
158 | + <span>{{language.code}}</span> | ||
159 | + </a> | ||
160 | + </li> | ||
161 | + {% endfor %} | ||
162 | + </ul> | ||
163 | + </li> | ||
164 | + </div> | ||
165 | + {% else %} | ||
166 | + <div class="col-sm-12 col-xs-12"> | ||
167 | + <li class="dropdown language-selector"> | ||
168 | + {% get_current_language as LANGUAGE_CODE %} | ||
169 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true"> | ||
170 | + | ||
171 | + <span>[{{LANGUAGE_CODE}}] </span> | ||
172 | + | ||
173 | + </a> | ||
174 | + <a href="{% url 'themes:contrast' %}" id = "contrast_button_mobile" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust"></i></a> | ||
175 | + <ul class="dropdown-menu"> | ||
176 | + {% get_available_languages as LANGUAGES %} | ||
177 | + {% get_language_info_list for LANGUAGES as languages %} | ||
178 | + {% for language in languages %} | ||
179 | + | ||
180 | + <li {% if language.code == LANGUAGE_CODE %} | ||
181 | + class="active" | ||
182 | + {% endif %}> | ||
183 | + <a class="language-item" value-lang="{{language.code}}"> | ||
184 | + <span>{{language.code}}</span> | ||
185 | + </a> | ||
186 | + </li> | ||
187 | + | ||
188 | + {% endfor %} | ||
189 | + </ul> | ||
190 | + </li> | ||
191 | + </div> | ||
192 | + {% endif %} | ||
193 | + </div> | ||
139 | </div> | 194 | </div> |
140 | </div> | 195 | </div> |
141 | 196 | ||
@@ -152,6 +207,21 @@ | @@ -152,6 +207,21 @@ | ||
152 | 207 | ||
153 | }); | 208 | }); |
154 | </script> | 209 | </script> |
210 | + | ||
211 | +<script type="text/javascript"> | ||
212 | + $("#contrast_button_mobile" ).click(function() { | ||
213 | + if (Cookies.get('contrast_check')) { | ||
214 | + Cookies.remove('contrast_check') | ||
215 | + //location.reload() | ||
216 | + } | ||
217 | + else { | ||
218 | + Cookies.set('contrast_check','contrast') | ||
219 | + //location.reload() | ||
220 | + } | ||
221 | + | ||
222 | + }); | ||
223 | +</script> | ||
224 | + | ||
155 | {% endblock%} | 225 | {% endblock%} |
156 | 226 | ||
157 | {% block footer %} | 227 | {% block footer %} |