aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Gruin2020-09-13 13:51:38 +0200
committerAlban Gruin2020-09-13 16:42:20 +0200
commit69170ef4009cb7145f3a50999b898b9d2e8d7ee7 (patch)
treec7809808fb4350bcd81f64a3a9cfbd4ef39591fc
parent5ae315463cfaf48cbfda4d45020ebc8e8223a147 (diff)
Add webpages and style
Signed-off-by: Alban Gruin <alban at pa1ch dot fr>
-rw-r--r--src/pages.ml96
-rw-r--r--src/pages.mli19
-rw-r--r--static/css/style.css38
3 files changed, 153 insertions, 0 deletions
diff --git a/src/pages.ml b/src/pages.ml
new file mode 100644
index 0000000..0f68092
--- /dev/null
+++ b/src/pages.ml
@@ -0,0 +1,96 @@
+(*
+ * Copyright (C) 2020 Alban Gruin
+ *
+ * ucs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * ucs 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with ucs. If not, see <http://www.gnu.org/licenses/>.
+ *)
+
+let common content =
+{|<!DOCTYPE html>
+<html lang="fr">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>µCS</title>
+ <link rel="stylesheet" href="/css/style.css">
+ </head>
+ <body>
+ <header>
+ <h1><a href="/">µCS</a></h1>
+ </header>
+ <article>|} ^ content ^
+{| </article>
+ <footer>
+ <p>(c) 2020 &ndash; Alban Gruin &ndash; µCS 0.1.0 « CANIS MINOR »</p>
+ </footer>
+ </body>
+</html>
+|}
+
+let main = common {|
+ <section>
+ <h3>Récupérer un emploi du temps au format ICS</h3>
+ <form action="/lnk" method="get">
+ <label for="id_group">Nom du groupe</label>
+ <input type="text" name="group" id="id_group" required />
+ <input type="submit" value="Générer un ICS" />
+ </form>
+ </section>
+ <section>
+ <p>
+ Le format ICS (ou iCalendar) permet d’importer un calendrier
+ dans un agenda électronique.<br />
+ <a href="https://fr.wikipedia.org/wiki/ICalendar">En savoir plus</a>
+ <p>
+ Il existe plusieurs logiciels ou services permettant
+ d’utiliser ces fichiers :
+ <ul>
+ <li>sur Linux et Windows, l’extension Lightning du logiciel
+ Thunderbird ;</li>
+ <li>sur Mac et iOS, iCloud ;</li>
+ <li>sur Android, l’application libre ICSx<sup>5</sup> peut les
+ récupérer périodiquement et les afficher sur l’application
+ Agenda de base.
+ <a href="https://f-droid.org/fr/packages/at.bitfire.icsdroid/">Elle
+ est gratuite sur F-Droid</a> ;</li>
+ <li>sur Web, NextCloud.</li>
+ </ul>
+ <p>
+ <b>N’utilisez pas Google Calendar pour synchroniser un
+ calendrier ICS</b>. Ce service empêche de définir la
+ fréquence de synchronisation ou de forcer une mise à jour et
+ conserve les événements en cache, même si on supprime le
+ calendrier. À cause de cela, il peut y avoir un délai de un
+ jour entre le changement d’une information sur celcatsanitizer
+ et sa prise en compte sans aucun recours possible.
+ <!-- Le lecteur attentif pourra se demander si il n’y a pas de
+conflit d’intérêt entre l’écosystème Android, dans lequel
+l’application de base (Agenda) ne peut se synchroniser qu’à Google
+Calendar à moins d’installer une application tierce (telles que
+DAVDroid ou ICSDroid, malheureusement payantes sur le Play Store mais
+gratuites sur F-Droid).
+
+Il pourra aussi se questionner sur la raison du mauvais support des
+ICS par ce service - serait-ce une technique pour inciter les
+utilisateurs à se servir de Google Calendar en priorité, au détriment
+des formats standards et des autres écosystèmes (par exemple, celui
+d’Apple), et ainsi attirer plus d’utilisateurs ? -->
+ </section>
+|}
+
+let link lnk = common @@ {|
+ <section>
+ <h3>Lien de l'emploi du temps</h3>
+ <a href="|} ^ lnk ^ {|">|} ^ lnk ^ {|</a>
+ </section>
+|}
diff --git a/src/pages.mli b/src/pages.mli
new file mode 100644
index 0000000..aef68b4
--- /dev/null
+++ b/src/pages.mli
@@ -0,0 +1,19 @@
+(*
+ * Copyright (C) 2020 Alban Gruin
+ *
+ * ucs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * ucs 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with ucs. If not, see <http://www.gnu.org/licenses/>.
+ *)
+
+val main : string
+val link : string -> string
diff --git a/static/css/style.css b/static/css/style.css
new file mode 100644
index 0000000..2ff6c67
--- /dev/null
+++ b/static/css/style.css
@@ -0,0 +1,38 @@
+body {
+ max-width: 60em;
+ margin: 1em auto;
+ padding: 0 .62em;
+ font: 1.2em/1.62em sans-serif;
+ word-wrap: break-word;
+}
+
+article {
+ max-width: 50em;
+ margin: 0 auto;
+}
+
+h1, h3 {
+ line-height: 1.2em;
+}
+
+a {
+ text-decoration: none;
+}
+
+a:hover, a:focus {
+ text-decoration: underline;
+}
+
+h1 a {
+ color: #31363b;
+}
+
+@media print {
+ body, article {
+ max-width: none;
+ }
+
+ header, footer {
+ display: none;
+ }
+}