Sith/core/templates/core/base.jinja

193 lines
8.4 KiB
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="fr">
<head>
{% block head %}
<title>{% block title %}{% trans %}Welcome!{% endtrans %}{% endblock %}</title>
<link rel="stylesheet" href="{{ static('core/base.css') }}">
<link rel="stylesheet" href="{{ static('core/multiple-select.css') }}">
<link rel="stylesheet" href="{{ static('core/jquery.datetimepicker.min.css') }}">
<link rel="stylesheet" href="{{ static('core/js/ui/jquery-ui.min.css') }}">
<link rel="stylesheet" href="{{ static('ajax_select/css/ajax_select.css') }}">
<link rel="stylesheet" href="{{ static('core/style.css') }}">
{% endblock %}
</head>
<body>
{% block header %}
{% if not popup %}
<div id="logo"><a href="{{ url('core:index') }}"><img src="{{ static('core/img/logo.png') }}"
alt="{% trans %}Logo{% endtrans %}" /></a></div>
{% 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 %}
<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 %}
<ul>
{% 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(): %}
<span style="color: orange">&#x3f;</span>
{% elif bar.is_open(): %}
<span style="color: green">&#x2713;</span>
{% else %}
<span style="color: red">&#10007;</span>
{% endif %}
{{ bar }}
</a>
</li>
{% endfor %}
</ul>
<a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a>
<a href="#" onclick="display_notif()">&#x1f514; ({{ user.notifications.filter(viewed=False).count() }})</a>
<ul id="notif">
{% for n in user.notifications.filter(viewed=False).order_by('-id') %}
<li><a href="{{ url("core:notification", notif_id=n.id) }}">
<span style="font-size: small; ">{{ n.date|date(DATE_FORMAT) }} {{
n.date|time(DATETIME_FORMAT) }}</span><br>
{{ n }}</a></li>
{% endfor %}
<li><a href="{{ url('core:notification_list') }}">{% trans %}View more{% endtrans %}</a>
<a href="{{ url('core:notification_list') }}?see_all">{% trans %}Mark all as read{% endtrans %}</a></li>
</ul>
<a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a>
<a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
<form action="{{ url('core:search') }}" method="GET">
<input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" id="search" />
<input type="submit" value="{% trans %}Search{% endtrans %}" style="display: none;" />
</form>
{% endif %}
</header>
{% else %}
<div id="popupheader">{{ user.get_display_name() }}</div>
{% endif %}
{% endblock %}
<div id="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 %}
</div>
{% block nav %}
{% if not popup %}
<nav>
<a href="https://ae.utbm.fr/">{% trans %}Main{% endtrans %}</a>
<a href="https://ae.utbm.fr/matmatronch/">{% trans %}Matmatronch{% endtrans %}</a>
<a href="{{ url('core:page', page_name="Index") }}">{% trans %}Wiki{% endtrans %}</a>
<a href="{{ url('sas:main') }}">{% trans %}SAS{% endtrans %}</a>
<a href="https://ae.utbm.fr/forum2/">{% trans %}Forum{% endtrans %}</a>
<a href="{{ url('core:page', "services") }}">{% trans %}Services{% endtrans %}</a>
<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>
</nav>
{% endif %}
{% endblock %}
<div id="content">
{% 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 %}
{% if error %}
{{ error }}
{% endif %}
{% block content %}
{% endblock %}
</div>
{% if not popup %}
<footer>
{% block footer %}
<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 notices{% 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>
{% trans %}Site made by good people{% endtrans %}
{% endblock %}
</footer>
{% endif %}
<!--
{% block tests %}
{{ tests }}
{% endblock %}
-->
{% block script %}
<script src="{{ static('core/js/jquery-3.1.0.min.js') }}"></script>
<script src="{{ static('core/js/ui/jquery-ui.min.js') }}"></script>
<script src="{{ static('core/js/ui/i18n/datepicker-fr.js') }}"></script>
<script src="{{ static('core/js/jquery.datetimepicker.full.min.js') }}"></script>
<script src="{{ static('core/js/multiple-select.js') }}"></script>
<script src="{{ static('ajax_select/js/ajax_select.js') }}"></script>
<script src="{{ url('javascript-catalog') }}"></script>
<script src="{{ static('core/js/script.js') }}"></script>
<script>
$('.select_single').multipleSelect({
single: true,
{% if not popup %}
position: 'top',
{% endif %}
});
$('.select_multiple').multipleSelect({
filter: true,
{% if not popup %}
position: 'top',
{% endif %}
});
$('.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 }}"] );
$(document).keydown(function (e) {
if ($(e.target).is('input')) { return }
if ($(e.target).is('textarea')) { return }
if ($(e.target).is('select')) { return }
if (e.keyCode == 83) {
$("#search").focus();
return false;
}
});
jQuery.datetimepicker.setLocale('{{ request.LANGUAGE_CODE|lower }}');
$('.select_datetime').datetimepicker({
format: 'Y-m-d H:i:s',
});
</script>
{% endblock %}
</body>
</html>