Commit a4e8fad81e1e372022e25c6d846a3ec39769c356

Authored by Gustavo
1 parent 8e27d414

Modified base template to include contrast button

Showing 1 changed file with 28 additions and 10 deletions   Show diff stats
amadeus/templates/base.html
... ... @@ -108,8 +108,18 @@
108 108 </div>
109 109  
110 110 <ul class="nav navbar-nav navbar-right notifications">
  111 + <a href="" id="contrast_button" style="color:inherit;padding-right:5px;">
  112 + {% if user.is_staff %}
  113 + <i style="top:18px;left:5px;"class="glyphicon glyphicon-adjust"></i>
  114 + {% else %}
  115 + <i style="top:18px;right:5px;" class="glyphicon glyphicon-adjust"></i>
  116 + {% endif %} </a>
111 117  
112   - <li class="dropdown language-selector-on-header {{ settings_menu_active }}" title data-original-title="{% trans 'Language Selector' %}">
  118 + {% if user.is_staff %}
  119 + <li class="dropdown language-selector-on-header {{ settings_menu_active }}" title data-original-title="{% trans 'Language Selector' %}" style="width:40px;">
  120 + {% else %}
  121 + <li class="dropdown language-selector-on-header {{ settings_menu_active }}" title data-original-title="{% trans 'Language Selector' %}" style="width:40px;right:10px">
  122 + {% endif %}
113 123  
114 124  
115 125 <a href="#" class="dropdown-toggle title" data-toggle="dropdown" data-close-others="true">
... ... @@ -119,11 +129,9 @@
119 129 <img src="{% static image_static %}" />
120 130 {% endwith %}
121 131 </a>
122   - <a href="#" class="dropdown-toggle no-title" data-toggle="dropdown" data-close-others="true">
  132 + <a href="#" class="dropdown-toggle no-title" data-toggle="dropdown" style="padding-left:0px;padding-right:0px;font-size:14px;text-align:center" data-close-others="true">
123 133  
124   - {% with 'img/'|add:LANGUAGE_CODE|add:'.png' as image_static %}
125   - <img src="{% static image_static %}" />
126   - {% endwith %}
  134 + <span>[{{LANGUAGE_CODE}}]</span>
127 135  
128 136 </a>
129 137 <ul class="dropdown-menu">
... ... @@ -137,9 +145,6 @@
137 145 class="active"
138 146 {% endif %}>
139 147 <a class="language-item" value-lang="{{language.code}}">
140   - {% with 'img/'|add:language.code|add:'.png' as image_static %}
141   - <img src="{% static image_static %}" />
142   - {% endwith %}
143 148 <span>{{language.code}}</span>
144 149 </a>
145 150 </li>
... ... @@ -202,6 +207,19 @@
202 207 </ul>
203 208 </div>
204 209 </div>
  210 + <script type="text/javascript">
  211 + $("#contrast_button" ).click(function() {
  212 + if (Cookies.get('contrast_check')) {
  213 + Cookies.remove('contrast_check')
  214 + location.reload()
  215 + }
  216 + else {
  217 + Cookies.set('contrast_check','contrast')
  218 + location.reload()
  219 + }
  220 +
  221 + });
  222 + </script>
205 223 {% endblock %}
206 224  
207 225 <div class="container-fluid">
... ... @@ -235,7 +253,7 @@
235 253 </a>
236 254 </li>
237 255 <li class="item" data-toggle="tooltip" data-placement="right" title="{% trans "Analytics" %}">
238   - <a href="{% url 'analytics:view_general' %}"><i class="fa fa-bar-chart" aria-hid{% get_current_language as LANGUAGE_CODE %}den="true"></i></a>
  256 + <a href="{% url 'analytics:view_general' %}"><i class="fa fa-bar-chart" aria-hid{% get_current_language as LANGUAGE_CODE %}den="true"></i></a>
239 257 </li>
240 258 </ul>
241 259 {% endblock %}
... ... @@ -290,7 +308,7 @@
290 308 </a>
291 309 </li>
292 310 <li class="item" data-toggle="tooltip" data-placement="top" title="{% trans "Analytics" %}">
293   - <a href="{% url 'analytics:view_general' %}"><i class="fa fa-bar-chart" aria-hid{% get_current_language as LANGUAGE_CODE %}den="true"></i></a>
  311 + <a href="{% url 'analytics:view_general' %}"><i class="fa fa-bar-chart" aria-hid{% get_current_language as LANGUAGE_CODE %}den="true"></i></a>
294 312 </li>
295 313 </ul>
296 314 </div>
... ...