base.jinja 6.12 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
8
        <link rel="stylesheet" href="{{ static('core/multiple-select.css') }}">
        <link rel="stylesheet" href="{{ static('core/js/ui/jquery-ui.min.css') }}">
9
        <link rel="stylesheet" href="{{ static('ajax_select/css/ajax_select.css') }}">
Skia's avatar
Skia committed
10
        <link rel="stylesheet" href="{{ static('core/style.css') }}">
Skia's avatar
Skia committed
11
12
        {% endblock %}
    </head>
Skia's avatar
Skia committed
13

Skia's avatar
Skia committed
14
    <body>
Skia's avatar
Skia committed
15
        {% block header %}
Skia's avatar
Skia committed
16
        {% if not popup %}
Skia's avatar
Skia committed
17
18
19
20
21
22
23
        <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
24
25
26
27
28
29
30
31
32
33
34
35
            <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>
36
            <a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a> |
Skia's avatar
Skia committed
37
38
            <a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a> |
            <a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
Skia's avatar
Skia committed
39
            <form action="{{ url('core:search') }}" method="GET">
40
                <input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" id="search" />
Skia's avatar
Skia committed
41
42
                <input type="submit" value="{% trans %}Search{% endtrans %}" style="display: none;" />
            </form>
Skia's avatar
Skia committed
43
44
            {% endif %}
        </header>
Skia's avatar
Skia committed
45
46
47
        {% else %}
        <div id="popupheader">{{ user.get_display_name() }}</div>
        {% endif %}
Skia's avatar
Skia committed
48
        {% endblock %}
Skia's avatar
Skia committed
49
50
51
52

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

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

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

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