Corrige templates formsemestre

This commit is contained in:
Emmanuel Viennet 2024-04-07 19:52:22 +02:00
parent a747ed22e2
commit e44a5ee55d
9 changed files with 46 additions and 28 deletions

View File

@ -179,6 +179,7 @@ def sco_header(
H = [
"""<!DOCTYPE html><html lang="fr">
<!-- ScoDoc legacy -->
<head>
<meta charset="utf-8"/>
<title>%(page_title)s</title>

View File

@ -141,7 +141,9 @@ def sidebar(etudid: int = None):
params = {}
H = [
f"""<div class="sidebar">
f"""
<!-- sidebar py -->
<div class="sidebar">
{ sidebar_common() }
<div class="box-chercheetud">Chercher étudiant:<br>
<form method="get" id="form-chercheetud"

View File

@ -837,8 +837,7 @@ du programme" (menu "Semestre") si vous avez un semestre en cours);
<a href="{url_for('notes.refcomp_show',
scodoc_dept=g.scodoc_dept, refcomp_id=formation.referentiel_competence.id)}"
class="stdlink">
{formation.referentiel_competence.type_titre}
{formation.referentiel_competence.specialite_long}
{formation.referentiel_competence.get_title()}
</a>&nbsp;"""
msg_refcomp = "changer"
H.append(f"""<ul><li>{descr_refcomp}""")

View File

@ -143,8 +143,10 @@ def _build_menu_stats(formsemestre: FormSemestre):
]
def formsemestre_status_menubar(formsemestre: FormSemestre) -> str:
def formsemestre_status_menubar(formsemestre: FormSemestre | None) -> str:
"""HTML to render menubar"""
if formsemestre is None:
return ""
formsemestre_id = formsemestre.id
if formsemestre.etat:
change_lock_msg = "Verrouiller"

View File

@ -1535,6 +1535,9 @@ def graph_cursus(
# semestre de depart en vert
n = g.get_node("SEM" + str(formsemestre_id))[0]
n.set_color("green")
n.set_style("filled")
n.set_fillcolor("lightgreen")
n.set_penwidth(2.0)
# demissions en rouge, octagonal
for nid in dem_nodes.values():
n = g.get_node(nid)[0]

View File

@ -11,9 +11,9 @@
)}}">{{etud.nomprenom}}</a></h2>
{% endif %}
<form name="f" method="GET" action="{{request.base_url}}">
<input type="hidden" name="formsemestre_id" value="{{formsemestre.id}}"></input>
<input type="hidden" name="etudid" value="{{etud.id}}"></input>
<input type="hidden" name="fmt" value="{{fmt}}"></input>
<input type="hidden" name="formsemestre_id" value="{{formsemestre.id}}">
<input type="hidden" name="etudid" value="{{etud.id}}">
<input type="hidden" name="fmt" value="{{fmt}}">
<div class="bull_titre_semestre">
Bulletin
<span class="bull_liensemestre">
@ -36,7 +36,7 @@
formsemestre_id=formsemestre.id,
etudid=etud.id,
)
}}&version='+this.value;"" class="noprint">
}}&version='+this.value;" class="noprint">
{% if formsemestre.formation.is_apc() %}
{% set menu_items = scu.BULLETINS_VERSIONS_BUT.items() %}
{% else %}

View File

@ -11,19 +11,25 @@
{% if sco.formsemestre.semestre_id != -1 %}, {{sco.formsemestre.formation.get_cursus().SESSION_NAME}}
{{sco.formsemestre.semestre_id}}
{% endif %}</a>
{% if sco.formsemestre.modalite %} en {{sco.formsemestre.modalite}}{% endif %}</span>
{% if sco.formsemestre.modalite %} en {{sco.formsemestre.modalite}}{% endif %}
</span>
<span class="dates">
<a title="du {{sco.formsemestre.date_debut.strftime('%d/%m/%Y')}}
au {{sco.formsemestre.date_fin.strftime('%d/%m/%Y')}} ">{{scu.MONTH_NAMES_ABBREV[ sco.formsemestre.date_debut.month - 1]}}
{{sco.formsemestre.date_debut.year}} - {{scu.MONTH_NAMES_ABBREV[sco.formsemestre.date_fin.month - 1]}}
{{sco.formsemestre.date_fin.year}}</a></span>
{{sco.formsemestre.date_fin.year}}</a>
</span>
<span class="resp"><a
title="{{sco.formsemestre.responsables_str(abbrev_prenom=False)}}">{{sco.formsemestre.responsables_str()}}</a></span>
<span class="nbinscrits"><a class="discretelink" href="{{url_for('scolar.groups_view', scodoc_dept=g.scodoc_dept,
formsemestre_id=sco.formsemestre.id)}}">{{sco.formsemestre.inscriptions|length}} inscrits</a></span><span class="lock">{% if
not sco.formsemestre.etat %}<a href="{{url_for('notes.formsemestre_flip_lock', scodoc_dept=g.scodoc_dept,
formsemestre_id=sco.formsemestre.id)}}">{{sco.formsemestre.inscriptions|length}} inscrits</a></span>
<span class="lock">
{% if not sco.formsemestre.etat %}<a href="{{url_for('notes.formsemestre_flip_lock', scodoc_dept=g.scodoc_dept,
formsemestre_id=sco.formsemestre.id)}}">{{scu.icontag("lock_img", border="0", title="Semestre
verrouillé")|safe}}</a>{% endif %}</span><span class="eye">
verrouillé")|safe}}</a>
{% endif %}
</span>
<span class="eye">
{% if not scu.is_passerelle_disabled() %}
<a href="{{url_for('notes.formsemestre_change_publication_bul', scodoc_dept=g.scodoc_dept,
formsemestre_id=sco.formsemestre.id)}}">
@ -32,10 +38,11 @@
{% else %}
{{ scu.ICON_PUBLISHED|safe }}
{% endif %}
</a>
{% endif %}
</span>
</div>
{{ sco.formsemestre_menu_bar|safe }}
{{ sco.formsemestre_status_menu_bar()|safe }}
</div>
<!-- end of formsemestre_header -->

View File

@ -1,6 +1,5 @@
{%- extends 'babase.j2' -%}
{# -*- Base des pages ordinaires, dans départements -*- #}
<!-- sco_page -->
{% block styles %}
{{super()}}
@ -22,24 +21,25 @@
{% endblock %}
{% block content %}
<!-- sco_page -->
{% block scodoc_sidebar %}
{% include "sidebar.j2" %}
{% include "sidebar.j2" %}
{% endblock %}
<div id="gtrcontent" class="gtrcontent">
{% include "flashed_messages.j2" %}
{% if sco.formsemestre %}
{% block formsemestre_header %}
{% include "formsemestre_header.j2" %}
{% endblock %}
{% endif %}
<div id="gtrcontent" class="gtrcontent">
{% include "flashed_messages.j2" %}
{% if sco.formsemestre %}
{% block formsemestre_header %}
{% include "formsemestre_header.j2" %}
{% endblock %}
{% endif %}
<div class="sco-app-content">
{% block app_content %}
page vide
{% endblock %}
<div class="sco-app-content">
{% block app_content %}
page vide
{% endblock %}
</div>
</div>
</div>
{% endblock %}
{% block scripts %}

View File

@ -135,6 +135,10 @@ class ScoData:
self.formsemestre.id if self.formsemestre else None
)
def formsemestre_status_menu_bar(self) -> str:
"Le HTML de la barre de menu semestre"
return sco_formsemestre_status.formsemestre_status_menubar(self.formsemestre)
from app.views import (
absences,