diff --git a/app/templates/formsemestre_description.j2 b/app/templates/formsemestre_description.j2 index a2b7ae3..5e223a8 100644 --- a/app/templates/formsemestre_description.j2 +++ b/app/templates/formsemestre_description.j2 @@ -18,7 +18,7 @@ div.responsable { margin-bottom: 16px; } .photo-ens img { - width: 256px; + height: 200px; margin-top: 8px; margin-bottom: 8px; } @@ -57,7 +57,7 @@ table.course-details td {
Photo de {{sem.descr.responsable}} + alt="Photo de {{sem.descr.responsable}}"/>
@@ -104,13 +104,13 @@ table.course-details td { -
-API_URL={{cfg.API_URL}} +
+TODO: boite état inscriptions, places disponibles et lien vers formulaire d'inscription
{# XXX DEVELOPMENT XXX #} -
- +
+Informations de développement {% for k, v in sem.items() | sort(attribute='0') %}
diff --git a/app/templates/index.j2 b/app/templates/index.j2 index fa9da08..12db08a 100644 --- a/app/templates/index.j2 +++ b/app/templates/index.j2 @@ -32,11 +32,23 @@ div.sem.ouvert { color: #bc76bf; margin-left: 12px; } -div.inscription { +div.inscription, div.infos-semestre { margin-top: 8px; margin-left: 16px; font-size: 12pt; } + +div.infos-semestre span { + margin-right: 16px; +} + +.svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} + {% endblock %} @@ -60,11 +72,28 @@ div.inscription { s'inscrire {% if sem.descr.date_fin_inscriptions is not none %} - fermeture des inscriptions le {{sem.descr.date_fin_inscriptions|format_date}} - {% endif %} + fermeture des inscriptions le {{sem.descr.date_fin_inscriptions|format_date}} + {% endif %}
{% endif %} +
+ + + {{sem.descr.campus}} + + + + + {{sem.descr.horaire}} + + + + + {{sem.descr.responsable}} + +
+
{% endfor %}
diff --git a/scodoc/api.py b/scodoc/api.py index 0629a83..ce90fac 100644 --- a/scodoc/api.py +++ b/scodoc/api.py @@ -64,15 +64,19 @@ class APIAccessor: url = self.config["SCODOC_URL"] + f"/ScoDoc/{dept}/api" + path else: url = self.config["API_URL"] + path - reply = requests.get( - url, - headers=self.headers if headers is None else headers, - verify=self.config["SCODOC_CHECK_CERTIFICATE"], - timeout=self.config["API_TIMEOUT"], - ) + try: + reply = requests.get( + url, + headers=self.headers if headers is None else headers, + verify=self.config["SCODOC_CHECK_CERTIFICATE"], + timeout=self.config["API_TIMEOUT"], + ) + except (OSError, requests.exceptions.ConnectionError) as exc: + log("api.get: error: url={url} exc={exc}") + log("config={self.config}") + raise APIError(f"Impossible de se connecter à ScoDoc: problème de configuration?") from exc if reply.status_code != 200: - print("url", url) - print("reply", reply.text) + log("api.get: error: url={url} status={status_code}\nreply={reply.text}") try: payload = reply.json() except requests.exceptions.JSONDecodeError: