base.jinja 14.2 KB
Newer Older
Skia's avatar
Skia committed
1
2
<!DOCTYPE html>
<html lang="fr">
Skia's avatar
Skia committed
3
4
    <head>
        {% block head %}
Krophil's avatar
Krophil committed
5
        <title>{% block title %}{% trans %}Welcome!{% endtrans %}{% endblock %} - Association des Étudiants UTBM</title>
Krophil's avatar
Krophil committed
6
        <link rel="shortcut icon" href="{{ static('core/img/favicon.ico') }}">
Skia's avatar
Skia committed
7
        <link rel="stylesheet" href="{{ static('core/base.css') }}">
Skia's avatar
Skia committed
8
        <link rel="stylesheet" href="{{ static('core/multiple-select.css') }}">
Skia's avatar
Skia committed
9
        <link rel="stylesheet" href="{{ static('core/jquery.datetimepicker.min.css') }}">
10
        <link rel="stylesheet" href="{{ static('ajax_select/css/ajax_select.css') }}">
Krophil's avatar
Krophil committed
11
        <link rel="stylesheet" href="{{ scss('core/style.scss') }}">
Krophil's avatar
Krophil committed
12
        <link rel="stylesheet" href="{{ static('core/js/ui/jquery-ui.min.css') }}">
13
14
        <link rel="stylesheet" href="{{ static('core/font-awesome/css/font-awesome.min.css') }}">
        <script href="{{ static('core/font-awesome/js/fontawesone.min.js') }}"></script>
Sli's avatar
Sli committed
15
16
17

        <!-- Jquery declared here to be accessible in every django widgets -->
        <script src="{{ static('core/js/jquery-3.1.0.min.js') }}"></script>
18
19
        <!-- Put here to always have acces to those functions on django widgets -->
        <script src="{{ static('core/js/script.js') }}"></script>
Skia's avatar
Skia committed
20
21
        {% endblock %}
    </head>
Skia's avatar
Skia committed
22

Skia's avatar
Skia committed
23
    <body>
Skia's avatar
Skia committed
24

25
26
27
        <!-- The token is always passed here to be accessible from the dom -->
        <!-- See this workaround https://docs.djangoproject.com/en/2.0/ref/csrf/#acquiring-the-token-if-csrf-use-sessions-is-true -->
        {% csrf_token %}
Skia's avatar
Skia committed
28
        <!-- BEGIN HEADER -->
Skia's avatar
Skia committed
29
        {% block header %}
Skia's avatar
Skia committed
30
        {% if not popup %}
Skia's avatar
Skia committed
31
32
33
34
35
36
37
38
        <div id="header_language_chooser">
            {% for language in LANGUAGES %}
            <form action="{{ url('set_language') }}" method="post">{% csrf_token %}
                <input name="next" value="{{ request.path }}" type="hidden" />
                <input name="language" value="{{ language[0] }}" type="hidden" />
                <input type="submit" value="{{ language[0]|upper }}" />
            </form>
            {% endfor %}
Skia's avatar
Skia committed
39
        </div>
Skia's avatar
Skia committed
40

Skia's avatar
Skia committed
41
42
        <header>
            {% if not user.is_authenticated() %}
Sli's avatar
Sli committed
43
            <div id="header_logo" style="background-image: url('{{ static('core/img/logo.png') }}'); width: 185px; height: 100px;">
Skia's avatar
Skia committed
44
45
46
47
48
49
50
51
52
53
54
55
56
                <a href="{{ url('core:index') }}"></a>
            </div>
            <div id="header_connect_links">
                <form method="post" action="{{ url('core:login') }}">
                {% csrf_token %}
                <label for="id_username">{% trans %}Username{% endtrans %}</label>
                    <input id="id_username" maxlength="254" name="username" type="text">
                <label for="id_password">{% trans %}Password{% endtrans %}</label>
                    <input type="password" name="password" id="id_password">
                <input type="submit" value="{% trans %}Login{% endtrans %}">
                </form>
                <a href="{{ url('core:register') }}"><button type="button">{% trans %}Register{% endtrans %}</button></a>
            </div>
Skia's avatar
Skia committed
57
            {% else %}
Sli's avatar
Sli committed
58
            <div id="header_logo" style="background-image: url('{{ static('core/img/logo.png') }}'); width: 92px; height: 52px;">
Skia's avatar
Skia committed
59
60
61
62
63
64
65
66
                <a href="{{ url('core:index') }}"></a>
            </div>
            <div id="header_bar">
                <ul id="header_bars_infos">
                {% for bar in Counter.objects.filter(type="BAR").all() %}
                    <li>
                    <a href="{{ url('counter:activity', counter_id=bar.id) }}" style="padding: 0px">
                    {% if bar.is_inactive(): %}
Soldat's avatar
Soldat committed
67
                        <i class="fa fa-question" style="color: #f39c12"></i>
Skia's avatar
Skia committed
68
                    {% elif bar.is_open(): %}
Soldat's avatar
Soldat committed
69
                        <i class="fa fa-check" style="color: #2ecc71"></i>
Skia's avatar
Skia committed
70
                    {% else %}
Soldat's avatar
Soldat committed
71
                        <i class="fa fa-times" style="color: #eb2f06"></i>
Skia's avatar
Skia committed
72
73
74
75
                    {% endif %}
                        {{ bar }}
                    </a>
                    </li>
Skia's avatar
Skia committed
76
                {% endfor %}
Skia's avatar
Skia committed
77
78
79
80
81
82
                </ul>
                <form action="{{ url('core:search') }}" method="GET" id="header_search">
                    <input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" id="search" />
                    <input type="submit" value="{% trans %}Search{% endtrans %}" style="display: none;" />
                </form>
                <div id="header_user_links">
Skia's avatar
Skia committed
83
84
85
86
                    <div>
                      <a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a>
                    </div>
                    <div>
Krophil's avatar
Krophil committed
87
                      <a href="#" onclick="display_notif()"><i class="fa fa-bell-o"></i> ({{ user.notifications.filter(viewed=False).count() }})</a>
Skia's avatar
Skia committed
88
                      <ul id="header_notif">
Skia's avatar
Skia committed
89
                          {% for n in user.notifications.filter(viewed=False).order_by('-date') %}
Skia's avatar
Skia committed
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
                          <li>
                              <a href="{{ url("core:notification", notif_id=n.id) }}">
                                  <span class="header_notif_date">
                                      {{ n.date|localtime|date(DATE_FORMAT) }}
                                  </span>
                                  <span class="header_notif_time">
                                      {{ n.date|localtime|time(DATETIME_FORMAT) }}
                                  </span>
                                  <br>
                                  {{ n }}
                              </a>
                          </li>
                          {% endfor %}
                          <li>
                              <strong>
                              <a href="{{ url('core:notification_list') }}">
                                  {% trans %}View more{% endtrans %}
                              </a>
                              <br />
                              <a href="{{ url('core:notification_list') }}?see_all">
                                  {% trans %}Mark all as read{% endtrans %}
                              </a>
                              </strong>
                          </li>
                      </ul>
                    </div>
                    <div>
                      <a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a>
                    </div>
                    <div>
                      <a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
                    </div>
Skia's avatar
Skia committed
122
123
                </div>
            </div>
Skia's avatar
Skia committed
124
125
            {% endif %}
        </header>
Skia's avatar
Skia committed
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

        <div id="info_boxes">
            {% set sith = get_sith() %}
            {% if sith.alert_msg %}
            <div id="alert_box">
                {{ sith.alert_msg|markdown }}
            </div>
            {% endif %}
            {% if sith.info_msg %}
            <div id="info_box">
                {{ sith.info_msg|markdown }}
            </div>
            {% endif %}
        </div>

        {% else %}{# if not popup #}
Skia's avatar
Skia committed
142
143
        <div id="popupheader">{{ user.get_display_name() }}</div>
        {% endif %}
Skia's avatar
Skia committed
144

Skia's avatar
Skia committed
145
146
147

        {% endblock %}
        <!-- END HEADER -->
Skia's avatar
Skia committed
148

Skia's avatar
Skia committed
149
150
151
152
        <div id="page">
          {% block nav %}
          {% if not popup %}
          <nav>
153
              <a href="{{ url('core:index') }}">{% trans %}Main{% endtrans %}</a>
Soldat's avatar
Soldat committed
154
              <div class="dropdown">
Soldat's avatar
Soldat committed
155
                <button class="dropbtn">{% trans %}Associations & Clubs{% endtrans %} 
Soldat's avatar
Soldat committed
156
157
158
                <i class="fa fa-caret-down"></i>
                </button>
                <div class="dropdown-content">
159
                    <a href="{{ url('core:page', page_name='ae') }}">{% trans %}AE{% endtrans %}</a>
Sli's avatar
Sli committed
160
                    <a href="{{ url('core:page', page_name='clubs') }}">{% trans %}AE's clubs{% endtrans %}</a>
161
162
163
164
165
                    <a href="{{ url('core:page', page_name='bdf') }}">{% trans %}BdF{% endtrans %}</a>
                    <a href="{{ url('core:page', page_name='bds') }}">{% trans %}BDS{% endtrans %}</a>
                    <a href="{{ url('core:page', page_name='cetu') }}">{% trans %}CETU{% endtrans %}</a>
                    <a href="{{ url('core:page', page_name='clubs/doceo') }}">{% trans %}Doceo{% endtrans %}</a>
                    <a href="{{ url('core:page', page_name='positions') }}">{% trans %}Positions{% endtrans %}</a>
Soldat's avatar
Soldat committed
166
167
168
169
170
171
172
                </div>
              </div> 
              <div class="dropdown">
                <button class="dropbtn">{% trans %}Events{% endtrans %} 
                <i class="fa fa-caret-down"></i>
                </button>
                <div class="dropdown-content">
173
174
                    <a href="{{ url('core:page', page_name='Index/calendrier_evenements') }}">{% trans %}Calendar{% endtrans %}</a>
                    <a href="{{ url('core:page', page_name='ga') }}">{% trans %}Big event{% endtrans %}</a>
Soldat's avatar
Soldat committed
175
176
                </div>
              </div> 
Skia's avatar
Skia committed
177
              <a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
Soldat's avatar
Soldat committed
178
              <a href="{{ url('sas:main') }}">{% trans %}Gallery{% endtrans %}</a>
Soldat's avatar
Soldat committed
179
              <a href="{{ url('eboutic:main') }}">{% trans %}Eboutic{% endtrans %}</a>
Soldat's avatar
Soldat committed
180
181
182
183
184
              <div class="dropdown">
                <button class="dropbtn">{% trans %}Services{% endtrans %} 
                <i class="fa fa-caret-down"></i>
                </button>
                <div class="dropdown-content">
Soldat's avatar
Soldat committed
185
                    <a href="{{ url('matmat:search_clear') }}">{% trans %}Matmatronch{% endtrans %}</a>
Soldat's avatar
Soldat committed
186
187
                    <a href="/launderette">{% trans %}Launderette{% endtrans %}</a>
                    <a href="{{ url('core:file_list') }}">{% trans %}Files{% endtrans %}</a>
Sli's avatar
Sli committed
188
                    <a href="{{ url('pedagogy:guide') }}">{% trans %}Pedagogy{% endtrans %}</a>
Soldat's avatar
Soldat committed
189
190
                </div>
              </div> 
191
192
193
194
195
196
197
198
199
              <div class="dropdown">
                <button class="dropbtn">{% trans %}My Benefits{% endtrans %}
                <i class="fa fa-caret-down"></i>
                </button>
                <div class="dropdown-content">
                  <a href="{{ url('core:page', page_name='partenaires')}}">{% trans %}Sponsors{% endtrans %}</a>
                  <a href="{{ url('core:page', page_name='avantages') }}">{% trans %}Subscriber benefits{% endtrans %}</a>
                </div>
              </div>
Soldat's avatar
Soldat committed
200
201
202
203
204
              <div class="dropdown">
                <button class="dropbtn">{% trans %}Help{% endtrans %} 
                <i class="fa fa-caret-down"></i>
                </button>
                <div class="dropdown-content">
205
                    <a href="{{ url('core:page', page_name='FAQ') }}">{% trans %}FAQ{% endtrans %}</a>
Soldat's avatar
Soldat committed
206
                    <a href="{{ url('core:page', 'contacts') }}">{% trans %}Contacts{% endtrans %}</a>
Soldat's avatar
Soldat committed
207
                    <a href="{{ url('core:page', page_name="Index") }}">{% trans %}Wiki{% endtrans %}</a>
Soldat's avatar
Soldat committed
208
209
                </div>
              </div> 
Skia's avatar
Skia committed
210
211
212
          </nav>
          {% endif %}
          {% endblock %}
Skia's avatar
Skia committed
213

Skia's avatar
Skia committed
214
215
216
217
218
          <ul id="quick_notif">
              {% for n in quick_notifs %}
              <li>{{ n }}</li>
              {% endfor %}
          </ul>
Skia's avatar
Skia committed
219

Skia's avatar
Skia committed
220
221
          <div id="content">
              {% if list_of_tabs %}
222
              <div class="tool_bar">
Skia's avatar
Skia committed
223
224
                  <div>{{ tabs_title }}</div>
                  <div class="tools">
225
                      {% for t in list_of_tabs -%}
Skia's avatar
Skia committed
226
227
228
229
230
                      <a href="{{ t.url }}"
                          {%- if current_tab == t.slug %}
                              class="selected_tab"
                          {%- endif -%}
                      >{{ t.name }}</a>
231
                      {%- endfor %}
Skia's avatar
Skia committed
232
233
234
                  </div>
              </div>
              {% endif %}
235

Skia's avatar
Skia committed
236
237
238
239
240
241
              {% if error %}
              {{ error }}
              {% endif %}
              {% block content %}
              {% endblock %}
          </div>
Skia's avatar
Skia committed
242
        </div>
Skia's avatar
Skia committed
243

Skia's avatar
Skia committed
244
        {% if not popup %}
Skia's avatar
Skia committed
245
        <footer>
Sli's avatar
Sli committed
246
            {% block footer %}
Skia's avatar
Skia committed
247
            <div>
Sli's avatar
Sli committed
248
249
                <a href="{{ url('core:page', 'contacts') }}">{% trans %}Contacts{% endtrans %}</a>
                <a href="{{ url('core:page', 'legals') }}">{% trans %}Legal notices{% endtrans %}</a>
250
                <a href="{{ url('core:page', 'copyright_agent') }}">{% trans %}Intellectual property{% endtrans %}</a>
Sli's avatar
Sli committed
251
252
                <a href="{{ url('core:page', 'docs') }}">{% trans %}Help & Documentation{% endtrans %}</a>
                <a href="{{ url('core:page', 'rd') }}">{% trans %}R&D{% endtrans %}</a>
Skia's avatar
Skia committed
253
            </div>
Skia's avatar
Skia committed
254
255
256
            {% trans %}Site made by good people{% endtrans %}
            {% endblock %}
        </footer>
Skia's avatar
Skia committed
257
        {% endif %}
Skia's avatar
Skia committed
258
259
260
261
262
        <!--
            {% block tests %}
            {{ tests }}
            {% endblock %}
        -->
263
        {% block script %}
Skia's avatar
Skia committed
264
        <script src="{{ static('core/js/ui/jquery-ui.min.js') }}"></script>
265
        <script src="{{ static('core/js/ui/i18n/datepicker-fr.js') }}"></script>
Skia's avatar
Skia committed
266
        <script src="{{ static('core/js/jquery.datetimepicker.full.min.js') }}"></script>
Skia's avatar
Skia committed
267
        <script src="{{ static('core/js/multiple-select.js') }}"></script>
268
        <script src="{{ static('ajax_select/js/ajax_select.js') }}"></script>
Skia's avatar
Skia committed
269
        <script src="{{ url('javascript-catalog') }}"></script>
Skia's avatar
Skia committed
270
        <script>
271
272
273
274
275
276
277
278
279
280
281
282
$('.select_single').multipleSelect({
    single: true,
    {% if not popup %}
    position: 'top',
    {% endif %}
});
$('.select_multiple').multipleSelect({
    filter: true,
    {% if not popup %}
    position: 'top',
    {% endif %}
});
283
284
285
286
287
288
289
290
$('.select_date').datepicker({
    changeMonth: true,
    changeYear: true,
    dayNamesShort: $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}"  ].dayNamesShort,
    dayNames: $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}"  ].dayNames,
    monthNamesShort: $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}"  ].monthNamesShort,
    monthNames: $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}"  ].monthNames,
}).datepicker( $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}"] );
291
292
$(document).keydown(function (e) {
    if ($(e.target).is('input')) { return }
293
    if ($(e.target).is('textarea')) { return }
Skia's avatar
Skia committed
294
    if ($(e.target).is('select')) { return }
295
296
297
298
299
    if (e.keyCode == 83) {
        $("#search").focus();
        return false;
    }
});
Skia's avatar
Skia committed
300
301
302
jQuery.datetimepicker.setLocale('{{ request.LANGUAGE_CODE|lower }}');
$('.select_datetime').datetimepicker({
        format: 'Y-m-d H:i:s',
303
});
Sli's avatar
Sli committed
304

Skia's avatar
Skia committed
305
        </script>
306
        {% endblock %}
Skia's avatar
Skia committed
307
    </body>
Skia's avatar
Skia committed
308
</html>