forked from ScoDoc/ScoDoc
Remplace préférence dépt. bul_display_publication par paramètre global: passerelle_disabled + cosmetic
This commit is contained in:
parent
6bfd461bf2
commit
b841b2f708
@ -48,13 +48,16 @@ class BonusConfigurationForm(FlaskForm):
|
||||
for (name, displayed_name) in ScoDocSiteConfig.get_bonus_sport_class_list()
|
||||
],
|
||||
)
|
||||
submit_bonus = SubmitField("Valider")
|
||||
submit_bonus = SubmitField("Enregistrer ce bonus")
|
||||
cancel_bonus = SubmitField("Annuler", render_kw={"formnovalidate": True})
|
||||
|
||||
|
||||
class ScoDocConfigurationForm(FlaskForm):
|
||||
"Panneau de configuration avancée"
|
||||
enable_entreprises = BooleanField("activer le module <em>entreprises</em>")
|
||||
disable_passerelle = BooleanField( # disable car par défaut activée
|
||||
"""cacher les fonctions liées à une passerelle de publication des résultats vers les étudiants ("œil"). N'affecte pas l'API, juste la présentation."""
|
||||
)
|
||||
month_debut_annee_scolaire = SelectField(
|
||||
label="Mois de début des années scolaires",
|
||||
description="""Date pivot. En France métropolitaine, août.
|
||||
@ -83,7 +86,7 @@ class ScoDocConfigurationForm(FlaskForm):
|
||||
disable_bul_pdf = BooleanField(
|
||||
"interdire les exports des bulletins en PDF (déconseillé)"
|
||||
)
|
||||
submit_scodoc = SubmitField("Valider")
|
||||
submit_scodoc = SubmitField("Enregistrer ces paramètres")
|
||||
cancel_scodoc = SubmitField("Annuler", render_kw={"formnovalidate": True})
|
||||
|
||||
|
||||
@ -98,6 +101,7 @@ def configuration():
|
||||
form_scodoc = ScoDocConfigurationForm(
|
||||
data={
|
||||
"enable_entreprises": ScoDocSiteConfig.is_entreprises_enabled(),
|
||||
"disable_passerelle": ScoDocSiteConfig.is_passerelle_disabled(),
|
||||
"month_debut_annee_scolaire": ScoDocSiteConfig.get_month_debut_annee_scolaire(),
|
||||
"month_debut_periode2": ScoDocSiteConfig.get_month_debut_periode2(),
|
||||
"email_from_addr": ScoDocSiteConfig.get("email_from_addr"),
|
||||
@ -130,6 +134,13 @@ def configuration():
|
||||
"Module entreprise "
|
||||
+ ("activé" if form_scodoc.data["enable_entreprises"] else "désactivé")
|
||||
)
|
||||
if ScoDocSiteConfig.disable_passerelle(
|
||||
disabled=form_scodoc.data["disable_passerelle"]
|
||||
):
|
||||
flash(
|
||||
"Fonction passerelle "
|
||||
+ ("cachées" if form_scodoc.data["disable_passerelle"] else "montrées")
|
||||
)
|
||||
if ScoDocSiteConfig.set_month_debut_annee_scolaire(
|
||||
int(form_scodoc.data["month_debut_annee_scolaire"])
|
||||
):
|
||||
|
@ -92,6 +92,7 @@ class ScoDocSiteConfig(db.Model):
|
||||
"INSTITUTION_CITY": str,
|
||||
"DEFAULT_PDF_FOOTER_TEMPLATE": str,
|
||||
"enable_entreprises": bool,
|
||||
"disable_passerelle": bool, # remplace pref. bul_display_publication
|
||||
"month_debut_annee_scolaire": int,
|
||||
"month_debut_periode2": int,
|
||||
"disable_bul_pdf": bool,
|
||||
@ -244,6 +245,12 @@ class ScoDocSiteConfig(db.Model):
|
||||
cfg = ScoDocSiteConfig.query.filter_by(name="enable_entreprises").first()
|
||||
return cfg is not None and cfg.value
|
||||
|
||||
@classmethod
|
||||
def is_passerelle_disabled(cls):
|
||||
"""True si on doit cacher les fonctions passerelle ("oeil")."""
|
||||
cfg = ScoDocSiteConfig.query.filter_by(name="disable_passerelle").first()
|
||||
return cfg is not None and cfg.value
|
||||
|
||||
@classmethod
|
||||
def is_user_require_email_institutionnel_enabled(cls) -> bool:
|
||||
"""True si impose saisie email_institutionnel"""
|
||||
@ -263,6 +270,11 @@ class ScoDocSiteConfig(db.Model):
|
||||
"""Active (ou déactive) le module entreprises. True si changement."""
|
||||
return cls.set("enable_entreprises", "on" if enabled else "")
|
||||
|
||||
@classmethod
|
||||
def disable_passerelle(cls, disabled: bool = True) -> bool:
|
||||
"""Désactive (ou active) les fonctions liées à la présence d'une passerelle. True si changement."""
|
||||
return cls.set("disable_passerelle", "on" if disabled else "")
|
||||
|
||||
@classmethod
|
||||
def disable_bul_pdf(cls, enabled=True) -> bool:
|
||||
"""Interdit (ou autorise) les exports PDF. True si changement."""
|
||||
|
@ -35,7 +35,7 @@ from flask_sqlalchemy.query import Query
|
||||
|
||||
import app
|
||||
from app import log
|
||||
from app.models import FormSemestre, ScolarNews
|
||||
from app.models import FormSemestre, ScolarNews, ScoDocSiteConfig
|
||||
import app.scodoc.sco_utils as scu
|
||||
from app.scodoc.gen_tables import GenTable
|
||||
from app.scodoc.sco_permissions import Permission
|
||||
@ -82,7 +82,7 @@ def index_html(showcodes=0, showsemtable=0, export_table_formsemestres=False):
|
||||
current_formsemestres_by_modalite, modalites = (
|
||||
sco_modalites.group_formsemestres_by_modalite(current_formsemestres)
|
||||
)
|
||||
|
||||
passerelle_disabled = ScoDocSiteConfig.is_passerelle_disabled()
|
||||
return render_template(
|
||||
"scolar/index.j2",
|
||||
current_user=current_user,
|
||||
@ -95,6 +95,8 @@ def index_html(showcodes=0, showsemtable=0, export_table_formsemestres=False):
|
||||
formsemestres=formsemestres,
|
||||
groupicon=scu.icontag("groupicon_img", title="Inscrits", border="0"),
|
||||
html_table_formsemestres=html_table_formsemestres,
|
||||
icon_hidden="" if passerelle_disabled else scu.ICON_HIDDEN,
|
||||
icon_published="" if passerelle_disabled else scu.ICON_PUBLISHED,
|
||||
locked_formsemestres=locked_formsemestres,
|
||||
modalites=modalites,
|
||||
nb_locked=locked_formsemestres.count(),
|
||||
@ -175,9 +177,10 @@ def _sem_table_gt(formsemestres: Query, showcodes=False, fmt="html") -> GenTable
|
||||
s["modalite"],
|
||||
)
|
||||
)
|
||||
columns_ids = (
|
||||
"lockimg",
|
||||
"published",
|
||||
columns_ids = ["lockimg"]
|
||||
if not ScoDocSiteConfig.is_passerelle_disabled():
|
||||
columns_ids.append("published")
|
||||
columns_ids += [
|
||||
"dash_mois_fin",
|
||||
"semestre_id_n",
|
||||
"modalite",
|
||||
@ -187,7 +190,7 @@ def _sem_table_gt(formsemestres: Query, showcodes=False, fmt="html") -> GenTable
|
||||
"etapes_apo_str",
|
||||
"elt_annee_apo",
|
||||
"elt_sem_apo",
|
||||
)
|
||||
]
|
||||
if showcodes:
|
||||
columns_ids = ("formsemestre_id",) + columns_ids
|
||||
|
||||
|
@ -1601,18 +1601,6 @@ class BasePreferences:
|
||||
"labels": ["non", "oui"],
|
||||
},
|
||||
),
|
||||
(
|
||||
"bul_display_publication",
|
||||
{
|
||||
"initvalue": 1,
|
||||
"title": "Afficher icône indiquant si les bulletins sont publiés",
|
||||
"explanation": "décocher si vous n'avez pas de passerelle ou portail étudiant publiant les bulletins",
|
||||
"input_type": "boolcheckbox",
|
||||
"labels": ["non", "oui"],
|
||||
"category": "bul",
|
||||
"only_global": False,
|
||||
},
|
||||
),
|
||||
# champs des bulletins PDF:
|
||||
(
|
||||
"bul_pdf_title",
|
||||
|
@ -246,9 +246,11 @@ def _trombino_zip(groups_infos):
|
||||
|
||||
|
||||
# Copy photos from portal to ScoDoc
|
||||
def trombino_copy_photos(group_ids=[], dialog_confirmed=False):
|
||||
def trombino_copy_photos(group_ids=None, dialog_confirmed=False):
|
||||
"Copy photos from portal to ScoDoc (overwriting local copy)"
|
||||
group_ids = [] if group_ids is None else group_ids
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(group_ids)
|
||||
breakpoint()
|
||||
back_url = "groups_view?%s&curtab=tab-photos" % groups_infos.groups_query_args
|
||||
|
||||
portal_url = sco_portal_apogee.get_portal_url()
|
||||
|
@ -1668,6 +1668,12 @@ def is_entreprises_enabled():
|
||||
return ScoDocSiteConfig.is_entreprises_enabled()
|
||||
|
||||
|
||||
def is_passerelle_disabled():
|
||||
from app.models import ScoDocSiteConfig
|
||||
|
||||
return ScoDocSiteConfig.is_passerelle_disabled()
|
||||
|
||||
|
||||
def is_assiduites_module_forced(
|
||||
formsemestre_id: int = None, dept_id: int = None
|
||||
) -> bool:
|
||||
|
@ -21,6 +21,13 @@
|
||||
|
||||
{% block app_content %}
|
||||
|
||||
<style>
|
||||
div.config-generale div.scobox {
|
||||
background-color: #e7e2ff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="config-generale">
|
||||
<h1>Configuration générale</h1>
|
||||
<div class="sco_help greenboldtext">Les paramètres donnés ici s'appliquent à tout ScoDoc (tous les départements).</div>
|
||||
|
||||
@ -30,22 +37,24 @@ Heure: <b><tt>{{ time.strftime("%d/%m/%Y %H:%M") }}</tt></b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>ScoDoc</h2>
|
||||
<form id="configuration_form_scodoc" class="sco-form" action="" method="post" enctype="multipart/form-data" novalidate>
|
||||
{{ form_scodoc.hidden_tag() }}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ wtf.quick_form(form_scodoc) }}
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">ScoDoc : paramètres généraux</div>
|
||||
<form id="configuration_form_scodoc" class="sco-form" action="" method="post" enctype="multipart/form-data" novalidate>
|
||||
{{ form_scodoc.hidden_tag() }}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ wtf.quick_form(form_scodoc) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 16px;">
|
||||
<a class="stdlink" href="{{url_for('scodoc.config_personalized_links')}}">Éditer des liens personnalisés</a>
|
||||
</div>
|
||||
</form>
|
||||
<div style="margin-top: 16px;">
|
||||
<a class="stdlink" href="{{url_for('scodoc.config_personalized_links')}}">Éditer des liens personnalisés</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h2>Calcul des "bonus" définis par l'établissement</h2>
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">Calcul des "bonus" définis par l'établissement</div>
|
||||
<form id="configuration_form" class="sco-form" action="" method="post" enctype="multipart/form-data" novalidate>
|
||||
{{ form_bonus.hidden_tag() }}
|
||||
<div class="row">
|
||||
@ -55,31 +64,31 @@ Heure: <b><tt>{{ time.strftime("%d/%m/%Y %H:%M") }}</tt></b>
|
||||
</div>
|
||||
<div id="bonus_description"></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Gestion des images: logos, signatures, ...</h2>
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">Gestion des images: logos, signatures, ...</div>
|
||||
<div class="sco_help">Ces images peuvent être intégrées dans les documents
|
||||
générés par ScoDoc: bulletins, PV, etc.
|
||||
</div>
|
||||
<p><a class="stdlink" href="{{url_for('scodoc.configure_logos')}}">Configuration des images et logos</a>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h2>Exports Apogée</h2>
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">Exports Apogée</div>
|
||||
<p><a class="stdlink" href="{{url_for('scodoc.config_codes_decisions')}}">Configuration des codes de décision</a>
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Assiduité et emplois du temps</h2>
|
||||
</div>
|
||||
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">Assiduité et emplois du temps</div>
|
||||
<p><a class="stdlink" href="{{url_for('scodoc.config_assiduites')}}">Configuration du suivi de l'assiduité et accès aux emplois du temps</a>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<h2>Utilisateurs, Rôles et CAS</h2>
|
||||
<section>
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">Utilisateurs, Rôles et CAS</div>
|
||||
<div>
|
||||
🎎 <a class="stdlink" href="{{url_for('scodoc.config_roles')}}">Définition des rôles et permissions</a>
|
||||
</div>
|
||||
@ -95,13 +104,15 @@ Heure: <b><tt>{{ time.strftime("%d/%m/%Y %H:%M") }}</tt></b>
|
||||
les permissions des rôles standards à leurs valeurs par défaut</a>
|
||||
(efface les modifications apportées aux rôles)
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<h2>Protection des données et RGPD</h2>
|
||||
<section>
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">Protection des données et RGPD</div>
|
||||
<div>📇 <a class="stdlink" href="{{url_for('scodoc.config_rgpd')}}">RGPD et données personnelles</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
@ -24,15 +24,15 @@
|
||||
not sco.sem.etat %}<a href="{{url_for('notes.formsemestre_flip_lock', scodoc_dept=g.scodoc_dept,
|
||||
formsemestre_id=sco.sem.id)}}">{{scu.icontag("lock_img", border="0", title="Semestre
|
||||
verrouillé")|safe}}</a>{% endif %}</span><span class="eye">
|
||||
{% if sco.prefs["bul_display_publication"] %}
|
||||
<a href="{{url_for('notes.formsemestre_change_publication_bul', scodoc_dept=g.scodoc_dept,
|
||||
{% if not scu.is_passerelle_disabled() %}
|
||||
<a href="{{url_for('notes.formsemestre_change_publication_bul', scodoc_dept=g.scodoc_dept,
|
||||
formsemestre_id=sco.sem.id)}}">
|
||||
{% if sco.sem.bul_hide_xml %}
|
||||
{{ scu.ICON_HIDDEN|safe}}
|
||||
{{ scu.ICON_HIDDEN|safe}}
|
||||
{% else %}
|
||||
{{ scu.ICON_PUBLISHED|safe }}
|
||||
{% endif %}
|
||||
{{ scu.ICON_PUBLISHED|safe }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -26,7 +26,9 @@
|
||||
scu.icontag("lock_img", border="0", title="Semestre verrouillé")|safe
|
||||
}}</a>
|
||||
{%- endif -%}
|
||||
</span><span class="eye"><a href="{{
|
||||
</span>
|
||||
{%-if not scu.is_passerelle_disabled()-%}
|
||||
<span class="eye"><a href="{{
|
||||
url_for('notes.formsemestre_change_publication_bul',
|
||||
scodoc_dept=g.scodoc_dept, formsemestre_id=formsemestre.id )
|
||||
}}">{%-
|
||||
@ -36,6 +38,7 @@
|
||||
{{scu.ICON_PUBLISHED|safe}}
|
||||
{%- endif -%}
|
||||
</a></span>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
{{sem_menu_bar|safe}}
|
||||
</div>
|
@ -87,7 +87,7 @@ div.modalite {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
span.effectif {
|
||||
div.effectif {
|
||||
display: inline-block;
|
||||
min-width: 24px;
|
||||
text-align: right;
|
||||
@ -119,6 +119,9 @@ span.effectif {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.left-section img:nth-child(2) {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.date {
|
||||
display: flex;
|
||||
@ -186,6 +189,7 @@ span.effectif {
|
||||
<div class="cur-formsemestre {{'new-sem' if loop.first or formsemestre.semestre_id != loop.previtem.semestre_id}}">
|
||||
<div class="left-section">
|
||||
{{groupicon|safe if formsemestre.inscriptions|length else emptygroupicon|safe}}
|
||||
{{icon_hidden|safe if formsemestre.bul_hide_xml else icon_published|safe }}
|
||||
<div class="date">
|
||||
<div class="date-begin"><a title="{{formsemestre.session_id()}}">{{formsemestre.mois_debut()}}</a></div>
|
||||
<div class="date-end">{{formsemestre.mois_fin()}}</div>
|
||||
|
Loading…
Reference in New Issue
Block a user