forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
49
app/forms/pe/pe_sem_recap.py
Normal file
49
app/forms/pe/pe_sem_recap.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# ScoDoc
|
||||||
|
#
|
||||||
|
# Copyright (c) 1999 - 2024 Emmanuel Viennet. All rights reserved.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
# Emmanuel Viennet emmanuel.viennet@viennet.net
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
"""
|
||||||
|
Formulaire options génération table poursuite études (PE)
|
||||||
|
"""
|
||||||
|
|
||||||
|
from flask_wtf import FlaskForm
|
||||||
|
from wtforms import BooleanField, HiddenField, SubmitField
|
||||||
|
|
||||||
|
|
||||||
|
class ParametrageClasseurPE(FlaskForm):
|
||||||
|
"Formulaire paramétrage génération classeur PE"
|
||||||
|
cohorte_restreinte = BooleanField(
|
||||||
|
"Restreindre aux étudiants inscrits dans le semestre"
|
||||||
|
)
|
||||||
|
moyennes_tags = BooleanField("Générer les moyennes sur les tags de modules")
|
||||||
|
moyennes_ue_res_sae = BooleanField(
|
||||||
|
"Générer les moyennes des ressources et des SAEs par UE"
|
||||||
|
)
|
||||||
|
moyennes_ues_rcues = BooleanField("Générer moyennes des UEs et RCUEs (compétences)")
|
||||||
|
min_max_moy = BooleanField("Colonnes min/max/moy")
|
||||||
|
synthese_individuelle_etud = BooleanField(
|
||||||
|
"Générer la feuille synthèse avec un onglet par étudiant"
|
||||||
|
)
|
||||||
|
|
||||||
|
submit = SubmitField("Générer les classeurs poursuites d'études")
|
||||||
|
cancel = SubmitField("Annuler", render_kw={"formnovalidate": True})
|
@ -38,6 +38,7 @@
|
|||||||
from flask import flash, g, redirect, render_template, request, send_file, url_for
|
from flask import flash, g, redirect, render_template, request, send_file, url_for
|
||||||
|
|
||||||
from app.decorators import permission_required, scodoc
|
from app.decorators import permission_required, scodoc
|
||||||
|
from app.forms.pe.pe_sem_recap import ParametrageClasseurPE
|
||||||
from app.models import FormSemestre
|
from app.models import FormSemestre
|
||||||
from app.pe import pe_comp
|
from app.pe import pe_comp
|
||||||
from app.pe import pe_jury
|
from app.pe import pe_jury
|
||||||
@ -73,40 +74,44 @@ def pe_view_sem_recap(formsemestre_id: int):
|
|||||||
# Cosemestres diplomants
|
# Cosemestres diplomants
|
||||||
cosemestres = pe_comp.get_cosemestres_diplomants(annee_diplome)
|
cosemestres = pe_comp.get_cosemestres_diplomants(annee_diplome)
|
||||||
|
|
||||||
|
form = ParametrageClasseurPE()
|
||||||
|
|
||||||
if request.method == "GET":
|
if request.method == "GET":
|
||||||
return render_template(
|
return render_template(
|
||||||
"pe/pe_view_sem_recap.j2",
|
"pe/pe_view_sem_recap.j2",
|
||||||
annee_diplome=annee_diplome,
|
annee_diplome=annee_diplome,
|
||||||
|
form=form,
|
||||||
formsemestre=formsemestre,
|
formsemestre=formsemestre,
|
||||||
sco=ScoData(formsemestre=formsemestre),
|
sco=ScoData(formsemestre=formsemestre),
|
||||||
cosemestres=cosemestres,
|
cosemestres=cosemestres,
|
||||||
)
|
)
|
||||||
|
|
||||||
# request.method == "POST"
|
# request.method == "POST"
|
||||||
jury = pe_jury.JuryPE(annee_diplome)
|
if form.validate_on_submit():
|
||||||
if not jury.diplomes_ids:
|
jury = pe_jury.JuryPE(annee_diplome, options=form.data)
|
||||||
flash("aucun étudiant à considérer !")
|
if not jury.diplomes_ids:
|
||||||
return redirect(
|
flash("aucun étudiant à considérer !")
|
||||||
url_for(
|
return redirect(
|
||||||
"notes.pe_view_sem_recap",
|
url_for(
|
||||||
scodoc_dept=g.scodoc_dept,
|
"notes.pe_view_sem_recap",
|
||||||
formsemestre_id=formsemestre_id,
|
scodoc_dept=g.scodoc_dept,
|
||||||
|
formsemestre_id=formsemestre_id,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data = jury.get_zipped_data()
|
||||||
|
|
||||||
|
return send_file(
|
||||||
|
data,
|
||||||
|
mimetype="application/zip",
|
||||||
|
download_name=scu.sanitize_filename(jury.nom_export_zip + ".zip"),
|
||||||
|
as_attachment=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
data = jury.get_zipped_data()
|
return redirect(
|
||||||
|
url_for(
|
||||||
return send_file(
|
"notes.formsemestre_status",
|
||||||
data,
|
scodoc_dept=g.scodoc_dept,
|
||||||
mimetype="application/zip",
|
formsemestre_id=formsemestre_id,
|
||||||
download_name=scu.sanitize_filename(jury.nom_export_zip + ".zip"),
|
)
|
||||||
as_attachment=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
return render_template(
|
|
||||||
"pe/pe_view_sem_recap.j2",
|
|
||||||
annee_diplome=annee_diplome,
|
|
||||||
formsemestre=formsemestre,
|
|
||||||
sco=ScoData(formsemestre=formsemestre),
|
|
||||||
cosemestres=cosemestres,
|
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{% extends "sco_page.j2" %}
|
{% extends "sco_page.j2" %}
|
||||||
|
{% import 'wtf.j2' as wtf %}
|
||||||
|
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
@ -42,7 +43,9 @@
|
|||||||
|
|
||||||
<h3>Avis de poursuites d'études de la promo {{ annee_diplome }}</h3>
|
<h3>Avis de poursuites d'études de la promo {{ annee_diplome }}</h3>
|
||||||
|
|
||||||
<div class="help">
|
{{ wtf.quick_form(form) }}
|
||||||
|
|
||||||
|
<div class="help" style="margin-top: 16px;">
|
||||||
Seront (a minima) pris en compte les étudiants ayant été inscrits aux semestres suivants :
|
Seront (a minima) pris en compte les étudiants ayant été inscrits aux semestres suivants :
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -54,22 +57,4 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<progress id="pe_progress" style="visibility: hidden"></progress>
|
|
||||||
<br>
|
|
||||||
<button onclick="submitPEGeneration()">Générer les documents de la promo {{ annee_diplome }}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form method="post" id="pe_generation" style="visibility: hidden">
|
|
||||||
<input type="submit"
|
|
||||||
onclick="submitPEGeneration()" value=""/>
|
|
||||||
<input type="hidden" name="formsemestre_id" value="{{formsemestre.id}}">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function submitPEGeneration() {
|
|
||||||
// document.getElementById("pe_progress").style.visibility = 'visible';
|
|
||||||
document.getElementById("pe_generation").submit(); //attach an id to your form
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{% endblock app_content %}
|
{% endblock app_content %}
|
Loading…
Reference in New Issue
Block a user