From 3097daa4fa7e4a71495757da404316d4dcb1c229 Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 18:36:43 +0100 Subject: [PATCH 01/20] =?UTF-8?q?Ajout=20des=20d=C3=A9pendances?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++++++++ readme | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 README.md delete mode 100644 readme diff --git a/README.md b/README.md new file mode 100644 index 0000000..3b5e631 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Équipe CMI - Nuit de l'Info 2021 - Sauveteurs Dunkerquois + +## Dépendances + +Ce site utilise [Python 3](https://www.python.org/), [Flask](https://palletsprojects.com/p/flask/), et [SQLite3](https://docs.python.org/3/library/sqlite3.html) + +Flask doit être installé, SQLite3 est distribué avec la version classique de python. + +```bash +pip install flask +``` diff --git a/readme b/readme deleted file mode 100644 index 1d51ac9..0000000 --- a/readme +++ /dev/null @@ -1 +0,0 @@ -Lis stp From c6381538edeb138a4c65fdbdf6522a11e113a705 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 19:04:05 +0100 Subject: [PATCH 02/20] =?UTF-8?q?Cr=C3=A9ation=20du=20fichier=20de=20style?= =?UTF-8?q?s=20CSS.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/styles.css | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 frontend/styles.css diff --git a/frontend/styles.css b/frontend/styles.css new file mode 100644 index 0000000..e69de29 From aa7e37ddfe1257e50db218da0683623c6ceb911f Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 19:05:44 +0100 Subject: [PATCH 03/20] Base de serveur --- app.py | 9 +++++++++ definitions.py | 8 ++++++++ pages.py | 4 ++++ templates/main.html | 3 +++ 4 files changed, 24 insertions(+) create mode 100644 app.py create mode 100644 definitions.py create mode 100644 pages.py create mode 100644 templates/main.html diff --git a/app.py b/app.py new file mode 100644 index 0000000..29c0713 --- /dev/null +++ b/app.py @@ -0,0 +1,9 @@ +# Fichier principal +from flask import Flask, escape, request +import pages + +app = Flask(__name__) + +@app.route('/') +def main(): + return pages.main() diff --git a/definitions.py b/definitions.py new file mode 100644 index 0000000..893429a --- /dev/null +++ b/definitions.py @@ -0,0 +1,8 @@ +### Fonctions communes + +def read(path): + # Retourne le contenu texte d'un fichier + f = open(path,'r') + result = f.read() + f.close() + return result diff --git a/pages.py b/pages.py new file mode 100644 index 0000000..767097e --- /dev/null +++ b/pages.py @@ -0,0 +1,4 @@ +import definitions as lib + +def main(): + return lib.read("templates/main.html") diff --git a/templates/main.html b/templates/main.html new file mode 100644 index 0000000..9188e32 --- /dev/null +++ b/templates/main.html @@ -0,0 +1,3 @@ +

Bienvenue !

+ +

Ceci est la page d'accueil !

From ee296068fb64d969792bffc116ddb4b927b0b83f Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 19:08:56 +0100 Subject: [PATCH 04/20] Ajout de la commande pour lancer --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3b5e631..51553b7 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,11 @@ Flask doit être installé, SQLite3 est distribué avec la version classique de ```bash pip install flask ``` + +## Lancer + +Dans le dossier racine : + +```bash +flask run +``` From b221431d069d9b47329a9d28fe5f5707e7012704 Mon Sep 17 00:00:00 2001 From: Jaenai Rugengande Ihimbazwe Date: Thu, 2 Dec 2021 19:09:09 +0100 Subject: [PATCH 05/20] Ajout de la page d'accueil index.html. --- frontend/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 frontend/index.html diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..d91c266 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,15 @@ + + + Sauveteurs du dunkerquois + + +
+ +
+
+ + +
+ \ No newline at end of file From fcfa994ffb44466089e101502024505063904692 Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 19:10:38 +0100 Subject: [PATCH 06/20] Ajout du gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ From 896f39f5de361f7ac5aa6ca830bb8c513677f4ca Mon Sep 17 00:00:00 2001 From: antux18 Date: Thu, 2 Dec 2021 19:12:52 +0100 Subject: [PATCH 07/20] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'frontend/ind?= =?UTF-8?q?ex.html'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index d91c266..3e3728b 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,8 +4,8 @@
- +
Date: Thu, 2 Dec 2021 19:13:50 +0100 Subject: [PATCH 08/20] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'frontend/ind?= =?UTF-8?q?ex.html'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 3e3728b..cb2bc06 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,8 +4,8 @@
- +
Date: Thu, 2 Dec 2021 19:20:07 +0100 Subject: [PATCH 09/20] Add 'temp infos ' --- temp infos | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 temp infos diff --git a/temp infos b/temp infos new file mode 100644 index 0000000..e69de29 From 484c6981599b499f20ecd1aff1317b4e0ba98eb4 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 19:39:30 +0100 Subject: [PATCH 10/20] Modification de la page d'accueil. Ajout d'un template pour les sauveteurs. --- frontend/index.html | 23 ++++++++++++++++------- templates/sauveteur_temp.html | 13 +++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 templates/sauveteur_temp.html diff --git a/frontend/index.html b/frontend/index.html index cb2bc06..f8ca3b4 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,15 +1,24 @@ - + + Sauveteurs du dunkerquois + +
-
+
+
+ + +
+
- - -
- \ No newline at end of file + +
+ + diff --git a/templates/sauveteur_temp.html b/templates/sauveteur_temp.html new file mode 100644 index 0000000..e3e51a6 --- /dev/null +++ b/templates/sauveteur_temp.html @@ -0,0 +1,13 @@ + + + + Sauveteurs du dunkerquois + + + +

{{nom}}} {{prenom}}

+ +
+

+ + From a7725094df21e6552a61fc1d9cb9320aa5f04bd8 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 19:40:47 +0100 Subject: [PATCH 11/20] =?UTF-8?q?Mis=20=C3=A0=20jour=20template=20sauveteu?= =?UTF-8?q?r.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/sauveteur_temp.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/sauveteur_temp.html b/templates/sauveteur_temp.html index e3e51a6..7f2b371 100644 --- a/templates/sauveteur_temp.html +++ b/templates/sauveteur_temp.html @@ -1,7 +1,7 @@ - Sauveteurs du dunkerquois + {{nom}} {{prenom}} From f3aa21f816028aa1d641c2acb21f53585761a40e Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 19:41:51 +0100 Subject: [PATCH 12/20] Base css --- app.py | 5 ++++- pages.py | 5 ++++- static/style.css | 13 +++++++++++++ templates/main.html | 12 ++++++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 static/style.css diff --git a/app.py b/app.py index 29c0713..bf5dc42 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,5 @@ # Fichier principal -from flask import Flask, escape, request +from flask import Flask, escape, request, url_for import pages app = Flask(__name__) @@ -7,3 +7,6 @@ app = Flask(__name__) @app.route('/') def main(): return pages.main() + +if __name__=="__main__": + app.run(debug=True) diff --git a/pages.py b/pages.py index 767097e..35b94b5 100644 --- a/pages.py +++ b/pages.py @@ -1,4 +1,7 @@ +from flask import render_template import definitions as lib +# Fonctions qui seront associées à des URLs + def main(): - return lib.read("templates/main.html") + return render_template("main.html") diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..0a9cefb --- /dev/null +++ b/static/style.css @@ -0,0 +1,13 @@ +body { + background-color: lightblue; +} + +h1 { + color: white; + text-align: center; +} + +p { + font-family: verdana; + font-size: 20px; +} diff --git a/templates/main.html b/templates/main.html index 9188e32..888c9fb 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,3 +1,11 @@ -

Bienvenue !

+ + + + + + +

Bienvenue !

+

Ceci est la page d'accueil !

+ + -

Ceci est la page d'accueil !

From 92e44f60293dd5d9c03757e5014520d18ce6fe63 Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 19:46:38 +0100 Subject: [PATCH 13/20] Fixed css --- templates/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/main.html b/templates/main.html index 888c9fb..d7a89ef 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,7 +1,7 @@ - +

Bienvenue !

From 853b2c8af2ea3cf367e3e690d1493f793a52a8f9 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 19:51:38 +0100 Subject: [PATCH 14/20] =?UTF-8?q?Mis=20=C3=A0=20jour=20template=20sauveteu?= =?UTF-8?q?r.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/sauveteur_temp.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/sauveteur_temp.html b/templates/sauveteur_temp.html index 7f2b371..00f291b 100644 --- a/templates/sauveteur_temp.html +++ b/templates/sauveteur_temp.html @@ -1,12 +1,19 @@ - {{nom}} {{prenom}} + {{nom}} {{prenom}} - Sauveuteur du dunkerquois

{{nom}}} {{prenom}}

+ + + + + + +
Nom{{nom}}
Prénom{{prenom}}Sauvetages effectués{{nb_sauvetages}}Personnes sauvées{{nb_sauves}}

From 782616c5dcb0e857a11d30ce13adce3e48dd63b8 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 19:53:36 +0100 Subject: [PATCH 15/20] =?UTF-8?q?D=C3=A9placement=20de=20la=20page=20d'acc?= =?UTF-8?q?ueil.=20Suppression=20de=20la=20template=20main.html.=20Suppres?= =?UTF-8?q?sion=20du=20fichier=20styles=20inutile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 24 ------------------------ frontend/styles.css | 0 templates/main.html | 33 +++++++++++++++++++++++---------- 3 files changed, 23 insertions(+), 34 deletions(-) delete mode 100644 frontend/index.html delete mode 100644 frontend/styles.css diff --git a/frontend/index.html b/frontend/index.html deleted file mode 100644 index f8ca3b4..0000000 --- a/frontend/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - Sauveteurs du dunkerquois - - - -
-
- -
-
-
- - -
-
-
- -
-
- diff --git a/frontend/styles.css b/frontend/styles.css deleted file mode 100644 index e69de29..0000000 diff --git a/templates/main.html b/templates/main.html index d7a89ef..9768fc8 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,11 +1,24 @@ - - - - - -

Bienvenue !

-

Ceci est la page d'accueil !

- - - + + + Sauveteurs du dunkerquois + + + +
+
+ +
+
+
+ + +
+
+
+ +
+
+ From c69396b11ea12380cecad582e225691e19f6ae99 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 20:12:54 +0100 Subject: [PATCH 16/20] Finalisation initiale template sauveteur. --- static/style.css | 14 +++++++++----- templates/sauveteur_temp.html | 22 +++++++++++++++------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/static/style.css b/static/style.css index 0a9cefb..b466fa2 100644 --- a/static/style.css +++ b/static/style.css @@ -1,13 +1,17 @@ body { - background-color: lightblue; } h1 { - color: white; - text-align: center; } p { - font-family: verdana; - font-size: 20px; +} + +table, tr, td { + border: 1px solid black; + border-collapse: collapse; +} + +.table_key { + font-weight: bold; } diff --git a/templates/sauveteur_temp.html b/templates/sauveteur_temp.html index 00f291b..414b339 100644 --- a/templates/sauveteur_temp.html +++ b/templates/sauveteur_temp.html @@ -2,18 +2,26 @@ {{nom}} {{prenom}} - Sauveuteur du dunkerquois - + -

{{nom}}} {{prenom}}

+

{{nom}} {{prenom}}

- + - - - - + + + + + + + + + + + +
Nom{{nom}}Nom{{nom}}
Prénom{{prenom}}Sauvetages effectués{{nb_sauvetages}}Personnes sauvées{{nb_sauves}}
Prénom{{prenom}}
Sauvetages effectués{{nb_sauvetages}}
Personnes sauvées{{nb_sauves}}
Gratifications{{gratifications}}

From a03f6a94ebd45453d0d6ff3c7fb5819452be9c3a Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 20:14:13 +0100 Subject: [PATCH 17/20] Ajout de page d'erreur --- app.py | 7 +++++++ pages.py | 3 +++ templates/error.html | 11 +++++++++++ templates/main.html | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 templates/error.html diff --git a/app.py b/app.py index bf5dc42..7c4ec81 100644 --- a/app.py +++ b/app.py @@ -5,8 +5,15 @@ import pages app = Flask(__name__) @app.route('/') +@app.route('/home') +@app.route('/home/') def main(): return pages.main() +@app.errorhandler(404) +def error(e): + return pages.error() + + if __name__=="__main__": app.run(debug=True) diff --git a/pages.py b/pages.py index 35b94b5..a786077 100644 --- a/pages.py +++ b/pages.py @@ -5,3 +5,6 @@ import definitions as lib def main(): return render_template("main.html") + +def error(): + return render_template("error.html") diff --git a/templates/error.html b/templates/error.html new file mode 100644 index 0000000..f324eed --- /dev/null +++ b/templates/error.html @@ -0,0 +1,11 @@ + + + + + + +

Erreur !

+

Retour à la page d'accueil

+ + + diff --git a/templates/main.html b/templates/main.html index d7a89ef..fc5fbcc 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,7 +1,7 @@ - +

Bienvenue !

From 51d774639daf7984c71507fffa969bb32928f2ec Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 20:15:11 +0100 Subject: [PATCH 18/20] =?UTF-8?q?Mise=20=C3=A0=20jour=20lien=20CSS=20dans?= =?UTF-8?q?=20page=20accueil.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/index.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 templates/index.html diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..0969bca --- /dev/null +++ b/templates/index.html @@ -0,0 +1,24 @@ + + + + Sauveteurs du dunkerquois + + + +
+
+ +
+
+
+ + +
+
+
+ +
+
+ From 6192844c9443530db79ac7dcc60f96b91131711c Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Thu, 2 Dec 2021 20:17:23 +0100 Subject: [PATCH 19/20] Service du bon fichier index --- pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages.py b/pages.py index a786077..af35d37 100644 --- a/pages.py +++ b/pages.py @@ -4,7 +4,7 @@ import definitions as lib # Fonctions qui seront associées à des URLs def main(): - return render_template("main.html") + return render_template("index.html") def error(): return render_template("error.html") From cf0150287000d81f339c36bbaca9dcd4e535e516 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 2 Dec 2021 20:19:27 +0100 Subject: [PATCH 20/20] Maj temp sauveteurs. --- templates/sauveteur_temp.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/sauveteur_temp.html b/templates/sauveteur_temp.html index 414b339..9d47853 100644 --- a/templates/sauveteur_temp.html +++ b/templates/sauveteur_temp.html @@ -23,6 +23,6 @@ Gratifications{{gratifications}} -

+

{{description}}