base.jinja 6.81 KB
Newer Older
Skia's avatar
Skia committed
1
2
<!DOCTYPE html>
<html lang="fr">
Skia's avatar
Skia committed
3
4
5
6
    <head>
        {% block head %}
        <title>{% block title %}{% trans %}Welcome!{% endtrans %}{% endblock %}</title>
        <link rel="stylesheet" href="{{ static('core/base.css') }}">
Skia's avatar
Skia committed
7
        <link rel="stylesheet" href="{{ static('core/multiple-select.css') }}">
Skia's avatar
Skia committed
8
        <link rel="stylesheet" href="{{ static('core/jquery.datetimepicker.min.css') }}">
Skia's avatar
Skia committed
9
        <link rel="stylesheet" href="{{ static('core/js/ui/jquery-ui.min.css') }}">
10
        <link rel="stylesheet" href="{{ static('ajax_select/css/ajax_select.css') }}">
Skia's avatar
Skia committed
11
        <link rel="stylesheet" href="{{ static('core/style.css') }}">
Skia's avatar
Skia committed
12
13
        {% endblock %}
    </head>
Skia's avatar
Skia committed
14

Skia's avatar
Skia committed
15
    <body>
Skia's avatar
Skia committed
16
        {% block header %}
Skia's avatar
Skia committed
17
        {% if not popup %}
Sli's avatar
Sli committed
18
19
20
21
        <div id="logo"><a href="{{ url('core:index') }}"><img src="{{ static('core/img/logo-white.png') }}"
                                                              alt="{% trans %}Logo{% endtrans %}" /></a>
        <img src="{{ static('core/img/logoGala.png')}}" alt="Gala"/>
        </div>
Skia's avatar
Skia committed
22
23
        <header>
            {% if not user.is_authenticated() %}
Krophil's avatar
Merging    
Krophil committed
24
            <a href="{{ url('core:login') }}">{% trans %}Login{% endtrans %}</a>
Skia's avatar
Skia committed
25
26
            <a href="{{ url('core:register') }}">{% trans %}Register{% endtrans %}</a>
            {% else %}
Skia's avatar
Skia committed
27
28
29
            <ul>
            {% for bar in Counter.objects.filter(type="BAR").all() %}
                <li>
Skia's avatar
Skia committed
30
                <a href="{{ url('counter:activity', counter_id=bar.id) }}" style="padding: 0px">
Lo-J's avatar
Lo-J committed
31
32
33
                {% if bar.is_inactive(): %}
                    <span style="color: orange">&#x3f;</span>
                {% elif bar.is_open(): %}
Skia's avatar
Skia committed
34
35
36
37
38
                    <span style="color: green">&#x2713;</span>
                {% else %}
                    <span style="color: red">&#10007;</span>
                {% endif %}
                    {{ bar }}
Skia's avatar
Skia committed
39
                </a>
Skia's avatar
Skia committed
40
41
42
                </li>
            {% endfor %}
            </ul>
Krophil's avatar
Merging    
Krophil committed
43
44
            <a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a>
            <a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a>
Skia's avatar
Skia committed
45
            <a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
Skia's avatar
Skia committed
46
            <form action="{{ url('core:search') }}" method="GET">
47
                <input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" id="search" />
Skia's avatar
Skia committed
48
49
                <input type="submit" value="{% trans %}Search{% endtrans %}" style="display: none;" />
            </form>
Skia's avatar
Skia committed
50
51
            {% endif %}
        </header>
Skia's avatar
Skia committed
52
53
54
        {% else %}
        <div id="popupheader">{{ user.get_display_name() }}</div>
        {% endif %}
Skia's avatar
Skia committed
55
        {% endblock %}
Skia's avatar
Skia committed
56
57
58
59

        <div id="language_chooser">
            {% for language in LANGUAGES %}
            <form action="{{ url('set_language') }}" method="post">{% csrf_token %}
Skia's avatar
Skia committed
60
                <input name="next" value="{{ request.path }}" type="hidden" />
Skia's avatar
Skia committed
61
                <input name="language" value="{{ language[0] }}" type="hidden" />
Skia's avatar
Skia committed
62
                <input type="submit" value="{{ language[0]|upper }}" />
Skia's avatar
Skia committed
63
64
65
66
            </form>
            {% endfor %}
        </div>

Skia's avatar
Skia committed
67
        {% block nav %}
Skia's avatar
Skia committed
68
        {% if not popup %}
Skia's avatar
Skia committed
69
        <nav>
Skia's avatar
Skia committed
70
71
            <a href="https://ae.utbm.fr/">{% trans %}Main{% endtrans %}</a>
            <a href="https://ae.utbm.fr/matmatronch/">{% trans %}Matmatronch{% endtrans %}</a>
Skia's avatar
Skia committed
72
            <a href="{{ url('core:page', page_name="Index") }}">{% trans %}Wiki{% endtrans %}</a>
Skia's avatar
Skia committed
73
74
            <a href="https://ae.utbm.fr/sas2/">{% trans %}SAS{% endtrans %}</a>
            <a href="https://ae.utbm.fr/forum2/">{% trans %}Forum{% endtrans %}</a>
Skia's avatar
Skia committed
75
            <a href="{{ url('core:page', "services") }}">{% trans %}Services{% endtrans %}</a>
Skia's avatar
Skia committed
76
77
78
            <a href="{{ url('core:file_list') }}">{% trans %}Files{% endtrans %}</a>
            <a href="https://ae.utbm.fr/article.php?name=liens">{% trans %}Sponsors{% endtrans %}</a>
            <a href="https://ae.utbm.fr/article.php?name=docs:index">{% trans %}Help{% endtrans %}</a>
Skia's avatar
Skia committed
79
        </nav>
Skia's avatar
Skia committed
80
        {% endif %}
Skia's avatar
Skia committed
81
        {% endblock %}
Skia's avatar
Skia committed
82

Skia's avatar
Skia committed
83
        <div id="content">
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
            {% if list_of_tabs %}
            <div class="tool-bar">
                <div>{{ tabs_title }}</div>
                <div class="tools">
                    {% for t in list_of_tabs %}
                    <a href="{{ t.url }}"
                        {%- if current_tab == t.slug -%}
                            class="selected_tab"
                        {%- endif -%}
                    >{{ t.name }}</a>
                    {% endfor %}
                </div>
                <hr>
            </div>
            {% endif %}

Skia's avatar
Skia committed
100
            {% if error %}
Skia's avatar
Skia committed
101
            {{ error }}
Skia's avatar
Skia committed
102
103
104
105
            {% endif %}
            {% block content %}
            {% endblock %}
        </div>
Skia's avatar
Skia committed
106

Skia's avatar
Skia committed
107
        {% if not popup %}
Skia's avatar
Skia committed
108
109
110
111
112
        <footer>
            {% block footer %}
            {% trans %}Site made by good people{% endtrans %}
            {% endblock %}
        </footer>
Skia's avatar
Skia committed
113
        {% endif %}
Skia's avatar
Skia committed
114
115
116
117
118
        <!--
            {% block tests %}
            {{ tests }}
            {% endblock %}
        -->
119
        {% block script %}
Skia's avatar
Skia committed
120
121
        <script src="{{ static('core/js/jquery-3.1.0.min.js') }}"></script>
        <script src="{{ static('core/js/ui/jquery-ui.min.js') }}"></script>
122
        <script src="{{ static('core/js/ui/i18n/datepicker-fr.js') }}"></script>
Skia's avatar
Skia committed
123
        <script src="{{ static('core/js/jquery.datetimepicker.full.min.js') }}"></script>
Skia's avatar
Skia committed
124
        <script src="{{ static('core/js/multiple-select.js') }}"></script>
125
        <script src="{{ static('ajax_select/js/ajax_select.js') }}"></script>
Skia's avatar
Skia committed
126
        <script src="{{ url('javascript-catalog') }}"></script>
Skia's avatar
Skia committed
127
128
        <script src="{{ static('core/js/script.js') }}"></script>
        <script>
129
130
131
132
133
134
135
136
137
138
139
140
$('.select_single').multipleSelect({
    single: true,
    {% if not popup %}
    position: 'top',
    {% endif %}
});
$('.select_multiple').multipleSelect({
    filter: true,
    {% if not popup %}
    position: 'top',
    {% endif %}
});
141
142
143
144
145
146
147
148
$('.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 }}"] );
149
150
$(document).keydown(function (e) {
    if ($(e.target).is('input')) { return }
151
    if ($(e.target).is('textarea')) { return }
Skia's avatar
Skia committed
152
    if ($(e.target).is('select')) { return }
153
154
155
156
157
    if (e.keyCode == 83) {
        $("#search").focus();
        return false;
    }
});
Skia's avatar
Skia committed
158
159
160
161
jQuery.datetimepicker.setLocale('{{ request.LANGUAGE_CODE|lower }}');
$('.select_datetime').datetimepicker({
        format: 'Y-m-d H:i:s',
        });
Skia's avatar
Skia committed
162
        </script>
163
        {% endblock %}
Skia's avatar
Skia committed
164
    </body>
Skia's avatar
Skia committed
165
</html>