ScoDoc/app/templates/sidebar.j2

158 lines
6.3 KiB
Plaintext
Raw Permalink Normal View History

2021-12-04 21:06:32 +01:00
{# Barre marge gauche ScoDoc #}
2021-12-28 16:17:07 +01:00
{# -*- mode: jinja-html -*- #}
2021-12-04 21:06:32 +01:00
<!-- sidebar -->
{# sidebar_common #}
<div class="scodoc-index" mobile="true">
<a href="{{url_for('scodoc.index', scodoc_dept=g.scodoc_dept)}}">ScoDoc</a>
</div>
2024-08-14 14:44:19 +02:00
2021-12-04 21:06:32 +01:00
<div id="authuser"><a id="authuserlink" href="{{
url_for('users.user_info_page', scodoc_dept=g.scodoc_dept, user_name=current_user.user_name)
2021-12-26 19:15:47 +01:00
}}">{{current_user.user_name}}</a>
<br /><a id="deconnectlink" href="{{url_for('auth.logout')}}">déconnexion</a>
2021-12-04 21:06:32 +01:00
</div>
{% block sidebar_dept %}
<div class="sidebar-link-dept">
<a href="{{ url_for('scolar.index_html', scodoc_dept=g.scodoc_dept) }}"
>Dépt. {{ sco.prefs["DeptName"] }}</a>
</div>
{% if sco.prefs["DeptIntranetURL"] %}
<div class="sidebar-item">
<a href="{{ sco.prefs['DeptIntranetURL'] }}">{{ sco.prefs["DeptIntranetTitle"] }}</a>
</div>
{% endif %}
2021-12-04 21:06:32 +01:00
{% endblock %}
<div class="sidebar-item">
<a href="{{url_for('scolar.index_html', scodoc_dept=g.scodoc_dept)}}">Semestres</a>
</div>
<div class="sidebar-item">
<a href="{{url_for('notes.index_html', scodoc_dept=g.scodoc_dept)}}">Formations</a>
</div>
2021-12-04 21:06:32 +01:00
{% if current_user.has_permission(sco.Permission.AbsChange)%}
<div class="sidebar-item">
<a href="{{url_for('assiduites.bilan_dept', scodoc_dept=g.scodoc_dept)}}">Assiduité</a>
</div>
{% endif %}
{% if current_user.has_permission(sco.Permission.UsersAdmin)
or current_user.has_permission(sco.Permission.UsersView)
2021-12-04 21:06:32 +01:00
%}
<div class="sidebar-item">
<a href="{{url_for('users.index_html', scodoc_dept=g.scodoc_dept)}}">Utilisateurs</a>
</div>
2021-12-04 21:06:32 +01:00
{% endif %}
{% if current_user.has_permission(sco.Permission.EditPreferences) %}
<div class="sidebar-item">
<a href="{{url_for('scolar.edit_preferences', scodoc_dept=g.scodoc_dept)}}">Paramétrage</a>
</div>
2021-12-04 21:06:32 +01:00
{% endif %}
<div class="sidebar-item" mobile="true">
<a href="{{url_for('scolar.dept_news', scodoc_dept=g.scodoc_dept)}}">Dernières Opérations</a>
</div>
2021-12-04 21:06:32 +01:00
{# /sidebar_common #}
<div class="box-chercheetud">Chercher étudiant:
2021-12-26 19:15:47 +01:00
<form method="get" id="form-chercheetud"
action="{{ url_for('scolar.search_etud_in_dept', scodoc_dept=g.scodoc_dept) }}">
<div>
<input type="text" size="12" class="in-expnom" name="expnom" spellcheck="false" />
2021-12-26 19:15:47 +01:00
</div>
</form>
2021-12-04 21:06:32 +01:00
</div>
<div class="etud-insidebar">
2021-12-26 19:15:47 +01:00
{% if sco.etud %}
<h2 id="insidebar-etud"><a href="{{url_for(
'scolar.fiche_etud', scodoc_dept=g.scodoc_dept, etudid=sco.etud.id )}}" class="sidebar">
2021-12-26 19:15:47 +01:00
<span class="fontred">{{sco.etud.nomprenom}}</span></a>
</h2>
<b>Absences</b>
2021-12-04 21:06:32 +01:00
{% if sco.etud_cur_sem %}
<span title="absences du {{ sco.etud_cur_sem['date_debut'].strftime('%d/%m/%Y') }}
au {{ sco.etud_cur_sem['date_fin'].strftime('%d/%m/%Y') }}" data-tooltip>({{sco.prefs["assi_metrique"]}})
<br />{{'%1g'|format(sco.nb_abs_just)}} J., {{'%1g'|format(sco.nb_abs_nj)}} N.J.</span>
2021-12-04 21:06:32 +01:00
{% endif %}
2021-12-26 19:15:47 +01:00
<ul>
{% if current_user.has_permission(sco.Permission.AbsChange) %}
2023-12-05 21:04:38 +01:00
<li><a href="{{ url_for('assiduites.ajout_assiduite_etud', scodoc_dept=g.scodoc_dept,
2021-12-04 21:06:32 +01:00
etudid=sco.etud.id) }}">Ajouter</a></li>
2023-06-20 15:50:56 +02:00
<li><a href="{{ url_for('assiduites.ajout_justificatif_etud', scodoc_dept=g.scodoc_dept,
2021-12-04 21:06:32 +01:00
etudid=sco.etud.id) }}">Justifier</a></li>
2021-12-26 19:15:47 +01:00
{% if sco.prefs["handle_billets_abs"] %}
2023-12-05 21:04:38 +01:00
<li><a href="{{ url_for('absences.billets_etud', scodoc_dept=g.scodoc_dept,
2021-12-04 21:06:32 +01:00
etudid=sco.etud.id) }}">Billets</a></li>
2021-12-26 19:15:47 +01:00
{% endif %}
{% endif %}
2023-12-12 03:05:31 +01:00
<li><a href="{{ url_for('assiduites.calendrier_assi_etud', scodoc_dept=g.scodoc_dept,
2021-12-04 21:06:32 +01:00
etudid=sco.etud.id) }}">Calendrier</a></li>
2023-12-05 21:04:38 +01:00
<li><a href="{{ url_for('assiduites.bilan_etud', scodoc_dept=g.scodoc_dept,
etudid=sco.etud.id) }}">Bilan</a></li>
2021-12-26 19:15:47 +01:00
</ul>
{% endif %}
</div> {# /etud-insidebar #}
2021-12-04 21:06:32 +01:00
{# LOGO #}
<div class="logo-insidebar">
<div class="sidebar-bottom">
<div class="sidebar-item">
<a href="{{ url_for( 'scodoc.about', scodoc_dept=g.scodoc_dept ) }}">À propos</a>
</div>
<div class="sidebar-item">
<a href="{{ scu.SCO_USER_MANUAL }}" target="_blank" rel="noopener">Aide</a>
</div>
2021-12-04 21:06:32 +01:00
</div>
</div>
<div class="logo-logo">
<a href="{{ url_for( 'scodoc.about', scodoc_dept=g.scodoc_dept ) }}">
2023-04-14 23:36:36 +02:00
{{ scu.icontag("scologo_img", no_size=True) | safe}}</a>
<div class="sidebar-item version">
{{ sco.SCOVERSION }}
</div>
{% if DEBUG %}
<div style="color:gold; background-color:navy; margin-top: 8px;">DEBUG</div>
{% endif %}
2021-12-04 21:06:32 +01:00
</div>
2024-08-14 14:44:19 +02:00
<!-- end of sidebar -->
<script>
// Mobile Sidebar Toggle
function toggleSidebarOffCanvas() {
// vérification de la taille de l'écran, si faux ne fait rien
if (window.innerWidth > 768) {
return;
}
const sidebar = document.querySelector('#sidebar');
const expanded = sidebar.getAttribute('aria-expanded') === 'true';
sidebar.setAttribute('aria-expanded', !expanded);
2024-08-19 18:22:40 +02:00
toggleScroll();
}
function toggleScroll(){
const changeScroll = (b) => {
document.querySelectorAll("body, html").forEach(el => el.classList.toggle("no-scroll", b));
}
const sidebar = document.querySelector('#sidebar');
const formSemestreMenu = document.querySelector('.sco-formsemestre-menu-menu');
const sidebarExpanded = sidebar ? sidebar.getAttribute('aria-expanded') === 'true' : false;
const formSemestreMenuExpanded = formSemestreMenu ? formSemestreMenu.classList.contains("active") : false;
2024-08-19 18:22:40 +02:00
let isScrollToggled = document.body.classList.contains("no-scroll");
if (isScrollToggled && !sidebarExpanded && !formSemestreMenuExpanded) {
changeScroll(false);
}
else if (!isScrollToggled && (sidebarExpanded || formSemestreMenuExpanded)) {
changeScroll(true);
}
2024-08-14 14:44:19 +02:00
}
</script>