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

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

Skia's avatar
Skia committed
65
        {% block nav %}
Skia's avatar
Skia committed
66
        {% if not popup %}
Skia's avatar
Skia committed
67
        <nav>
Skia's avatar
Skia committed
68
69
            <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
70
            <a href="{{ url('core:page', page_name="Index") }}">{% trans %}Wiki{% endtrans %}</a>
Skia's avatar
Skia committed
71
            <a href="{{ url('sas:main') }}">{% trans %}SAS{% endtrans %}</a>
Skia's avatar
Skia committed
72
            <a href="https://ae.utbm.fr/forum2/">{% trans %}Forum{% endtrans %}</a>
Skia's avatar
Skia committed
73
            <a href="{{ url('core:page', "services") }}">{% trans %}Services{% endtrans %}</a>
Skia's avatar
Skia committed
74
75
76
            <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
77
        </nav>
Skia's avatar
Skia committed
78
        {% endif %}
Skia's avatar
Skia committed
79
        {% endblock %}
Skia's avatar
Skia committed
80

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

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