diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..51553b7 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# É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 +``` + +## Lancer + +Dans le dossier racine : + +```bash +flask run +``` diff --git a/app.py b/app.py new file mode 100644 index 0000000..7c4ec81 --- /dev/null +++ b/app.py @@ -0,0 +1,19 @@ +# Fichier principal +from flask import Flask, escape, request, url_for +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/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..af35d37 --- /dev/null +++ b/pages.py @@ -0,0 +1,10 @@ +from flask import render_template +import definitions as lib + +# Fonctions qui seront associées à des URLs + +def main(): + return render_template("index.html") + +def error(): + return render_template("error.html") diff --git a/readme b/readme deleted file mode 100644 index 1d51ac9..0000000 --- a/readme +++ /dev/null @@ -1 +0,0 @@ -Lis stp diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..b466fa2 --- /dev/null +++ b/static/style.css @@ -0,0 +1,17 @@ +body { +} + +h1 { +} + +p { +} + +table, tr, td { + border: 1px solid black; + border-collapse: collapse; +} + +.table_key { + font-weight: bold; +} diff --git a/temp infos b/temp infos new file mode 100644 index 0000000..e69de29 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/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 + + + +
+
+ +
+
+
+ + +
+
+
+ +
+
+ diff --git a/templates/sauveteur_temp.html b/templates/sauveteur_temp.html new file mode 100644 index 0000000..9d47853 --- /dev/null +++ b/templates/sauveteur_temp.html @@ -0,0 +1,28 @@ + + + + {{nom}} {{prenom}} - Sauveuteur du dunkerquois + + + +

{{nom}} {{prenom}}

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

{{description}}

+ +