Editeur partition: pas d'affichage config EDT si EDT non configuré

This commit is contained in:
Emmanuel Viennet 2023-12-29 04:11:37 +01:00
parent 2b9b459106
commit d3b1aaabd8
3 changed files with 43 additions and 25 deletions

View File

@ -50,6 +50,11 @@ def get_ics_filename(edt_id: str) -> str | None:
return edt_ics_path.format(edt_id=edt_id)
def is_edt_configured() -> bool:
"True si accès EDT configuré"
return bool(ScoDocSiteConfig.get("edt_ics_path"))
def formsemestre_load_calendar(
formsemestre: FormSemestre = None, edt_id: str = None
) -> tuple[bytes, icalendar.cal.Calendar]:

View File

@ -1,4 +1,13 @@
{# -*- mode: jinja-html -*- #}
{% if not is_edt_configured %}
<style>
span.calendarEdit {
display: none;
}
</style>
{% endif %}
<h1>{% if not read_only %}Édition des p{% else %}P{%endif%}artitions</h1>
<main>

View File

@ -80,31 +80,34 @@ from app.scodoc.sco_exceptions import (
from app.scodoc.TrivialFormulator import DMY_REGEXP, TrivialFormulator, tf_error_message
from app.scodoc.gen_tables import GenTable
from app.scodoc import html_sco_header
from app.scodoc import sco_import_etuds
from app.scodoc import sco_archives_etud
from app.scodoc import codes_cursus
from app.scodoc import sco_cache
from app.scodoc import sco_debouche
from app.scodoc import sco_dept
from app.scodoc import sco_dump_db
from app.scodoc import sco_etud
from app.scodoc import sco_find_etud
from app.scodoc import sco_formsemestre
from app.scodoc import sco_formsemestre_inscriptions
from app.scodoc import sco_groups
from app.scodoc import sco_groups_edit
from app.scodoc import sco_groups_exports
from app.scodoc import sco_groups_view
from app.scodoc import sco_page_etud
from app.scodoc import sco_permissions_check
from app.scodoc import sco_photos
from app.scodoc import sco_portal_apogee
from app.scodoc import sco_preferences
from app.scodoc import sco_synchro_etuds
from app.scodoc import sco_trombino
from app.scodoc import sco_trombino_tours
from app.scodoc import sco_up_to_date
from app.scodoc import (
codes_cursus,
html_sco_header,
sco_import_etuds,
sco_archives_etud,
sco_cache,
sco_debouche,
sco_dept,
sco_dump_db,
sco_etud,
sco_edt_cal,
sco_find_etud,
sco_formsemestre,
sco_formsemestre_inscriptions,
sco_groups,
sco_groups_edit,
sco_groups_exports,
sco_groups_view,
sco_page_etud,
sco_permissions_check,
sco_photos,
sco_portal_apogee,
sco_preferences,
sco_synchro_etuds,
sco_trombino,
sco_trombino_tours,
sco_up_to_date,
)
from app.tables import list_etuds
@ -935,6 +938,7 @@ def partition_editor(formsemestre_id: int, edit_partition=False):
formsemestre=formsemestre,
read_only=not formsemestre.can_change_groups(),
edit_partition=edit_partition,
is_edt_configured=sco_edt_cal.is_edt_configured(),
scu=scu,
),
html_sco_header.sco_footer(),