base.jinja 6.51 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 %}
Skia's avatar
Skia committed
18
19
20
21
22
23
24
        <div id="logo"><a href="{{ url('core:index') }}"><img src="{{ static('core/img/logo.png') }}"
                                                              alt="{% trans %}Logo{% endtrans %}" /></a></div>
        <header>
            {% if not user.is_authenticated() %}
            <a href="{{ url('core:login') }}">{% trans %}Login{% endtrans %}</a> |
            <a href="{{ url('core:register') }}">{% trans %}Register{% endtrans %}</a>
            {% else %}
Skia's avatar
Skia committed
25
26
27
28
29
30
31
32
33
34
35
36
            <ul>
            {% for bar in Counter.objects.filter(type="BAR").all() %}
                <li>
                {% if bar.is_open() %}
                    <span style="color: green">&#x2713;</span>
                {% else %}
                    <span style="color: red">&#10007;</span>
                {% endif %}
                    {{ bar }}
                </li>
            {% endfor %}
            </ul>
37
            <a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a> |
Skia's avatar
Skia committed
38
39
            <a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a> |
            <a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
Skia's avatar
Skia committed
40
            <form action="{{ url('core:search') }}" method="GET">
41
                <input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" id="search" />
Skia's avatar
Skia committed
42
43
                <input type="submit" value="{% trans %}Search{% endtrans %}" style="display: none;" />
            </form>
Skia's avatar
Skia committed
44
45
            {% endif %}
        </header>
Skia's avatar
Skia committed
46
47
48
        {% else %}
        <div id="popupheader">{{ user.get_display_name() }}</div>
        {% endif %}
Skia's avatar
Skia committed
49
        {% endblock %}
Skia's avatar
Skia committed
50
51
52
53

        <div id="language_chooser">
            {% for language in LANGUAGES %}
            <form action="{{ url('set_language') }}" method="post">{% csrf_token %}
Skia's avatar
Skia committed
54
                <input name="next" value="{{ request.path }}" type="hidden" />
Skia's avatar
Skia committed
55
                <input name="language" value="{{ language[0] }}" type="hidden" />
Skia's avatar
Skia committed
56
                <input type="submit" value="{{ language[0]|upper }}" />
Skia's avatar
Skia committed
57
58
59
60
            </form>
            {% endfor %}
        </div>

Skia's avatar
Skia committed
61
        {% block nav %}
Skia's avatar
Skia committed
62
        {% if not popup %}
Skia's avatar
Skia committed
63
        <nav>
Skia's avatar
Skia committed
64
65
            <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
66
            <a href="{{ url('core:page', page_name="Index") }}">{% trans %}Wiki{% endtrans %}</a>
Skia's avatar
Skia committed
67
68
            <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
69
            <a href="{{ url('core:page', "services") }}">{% trans %}Services{% endtrans %}</a>
Skia's avatar
Skia committed
70
71
72
            <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
73
        </nav>
Skia's avatar
Skia committed
74
        {% endif %}
Skia's avatar
Skia committed
75
        {% endblock %}
Skia's avatar
Skia committed
76

Skia's avatar
Skia committed
77
        <div id="content">
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
            {% 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
94
            {% if error %}
Skia's avatar
Skia committed
95
            {{ error }}
Skia's avatar
Skia committed
96
97
98
99
            {% endif %}
            {% block content %}
            {% endblock %}
        </div>
Skia's avatar
Skia committed
100

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