diff --git a/app.py b/app.py index 40935a9..fb72fd5 100644 --- a/app.py +++ b/app.py @@ -1,93 +1,19 @@ -from flask import Flask, render_template, request -from datetime import datetime -from repertoire_web import ajouter, rechercher -from repertoire_identifiants_mot_de_passe import verif_user, add_user - -app = Flask(__name__) # crée l'application Flask - -@app.route("/") # URL racine : http://localhost:5000/ -def index(): - return render_template("user_search.html", display= "none") - #return render_template("index.html", Identifiant="Alban") - -@app.route("/index2/") # URL racine : http://localhost:5000/ -def index2(Identifiant): - return render_template("index.html", Identifiant=Identifiant) - - -@app.route("/cherche") -def cherche(): - return render_template("cherche.html") - -@app.route("/form_add_user") -def form_add_user(): - return render_template("add_user.html") - -@app.route("/result_add_user", methods=["POST"]) -def result_add_user(): - new_user = request.form.get("Identifiant", "").strip() - new_pasword = request.form.get("Mot_de_passe", "").strip() - add_user(new_user, new_pasword) - return render_template("index.html", Identifiant="Alban", added_user=new_user) - -@app.route("/ajout") -def ajout(): - return render_template("ajout.html") - -# Traitement des formulaires -@app.route("/resultat_recherche", methods=["POST"]) -def resultat_recherche(): - nom = request.form.get("nom", "").strip() - numero = rechercher(nom) - return render_template("resultat_recherche.html", nom=nom, numero=numero) - -@app.route("/resultat_ajout", methods=["POST"]) -def resultat_ajout(): - nom = request.form.get("nom", "").strip() - numero = request.form.get("numero", "").strip() - ajouter(nom, numero) - return render_template("resultat_ajout.html", nom=nom, numero=numero) - -@app.route("/user_search") -def user_search(): - return render_template("user_search.html",display = "none") - -@app.route("/result_search", methods=["POST"]) -def result_search(): - Identifiant = request.form.get("Identifiant", "").strip() - Mot_de_passe = request.form.get("Mot_de_passe", "").strip() - print([Identifiant,Mot_de_passe]) - if verif_user(Identifiant, Mot_de_passe): - return render_template("index.html", Identifiant=Identifiant) - else: - return render_template("user_search.html", display="visible") - -@app.route("/NOTES/") -def NOTES(Identifiant): - return render_template("NOTES.html", Identifiant=Identifiant) - -@app.route("/heure/") -def heure(Identifiant): - maintenant = datetime.now() - return render_template( - "heure.html", - h=maintenant.hour, - m=maintenant.minute, - s=maintenant.second, - Identifiant=Identifiant, - ) - -@app.route("/formulaire") -def formulaire(): - return render_template("formulaire.html") - -@app.route("/resultat", methods=["POST"]) -def resultat(): - nom = request.form.get("nom", "").strip() - prenom = request.form.get("prenom", "").strip() - return render_template("resultat.html", nom=nom, prenom=prenom) - -if __name__ == "__main__": - app.run() # lance le serveur (localhost:5000 par défaut) - - +# ************************************************************* +# ************** SERVEUR WEB FLASK***************************** +# ************************************************************* + +from flask import Flask, render_template + +app = Flask(__name__) # crée l'application Flask + +@app.route("/") # URL racine : http://localhost:5000/ +def index(): + return render_template("index.html") + +@app.route("/page_hopper") +def page_hopper(): + return render_template("page_hopper.html") + + +if __name__ == "__main__": + app.run() # lance le serveur (localhost:5000 par défaut) diff --git a/static/hopper_grace.jpg b/static/hopper_grace.jpg new file mode 100644 index 0000000..85d0925 Binary files /dev/null and b/static/hopper_grace.jpg differ diff --git a/static/images/banane.png b/static/images/banane.png new file mode 100644 index 0000000..c1dcf85 Binary files /dev/null and b/static/images/banane.png differ diff --git a/static/images/photo_informaticiens/JohnVonNeumann.jpg b/static/images/photo_informaticiens/JohnVonNeumann.jpg new file mode 100644 index 0000000..f3ff8f5 Binary files /dev/null and b/static/images/photo_informaticiens/JohnVonNeumann.jpg differ diff --git a/static/images/photo_informaticiens/alan_turing.jpg b/static/images/photo_informaticiens/alan_turing.jpg new file mode 100644 index 0000000..c67d537 Binary files /dev/null and b/static/images/photo_informaticiens/alan_turing.jpg differ diff --git a/static/images/photo_informaticiens/dennis_ritchie.jpg b/static/images/photo_informaticiens/dennis_ritchie.jpg new file mode 100644 index 0000000..9878d7b Binary files /dev/null and b/static/images/photo_informaticiens/dennis_ritchie.jpg differ diff --git a/static/images/photo_informaticiens/hopper_grace.jpg b/static/images/photo_informaticiens/hopper_grace.jpg new file mode 100644 index 0000000..85d0925 Binary files /dev/null and b/static/images/photo_informaticiens/hopper_grace.jpg differ diff --git a/static/images/photo_informaticiens/linus-torvalds.jpg b/static/images/photo_informaticiens/linus-torvalds.jpg new file mode 100644 index 0000000..3f2a518 Binary files /dev/null and b/static/images/photo_informaticiens/linus-torvalds.jpg differ diff --git a/static/images/photo_informaticiens/richard_stallman.jpg b/static/images/photo_informaticiens/richard_stallman.jpg new file mode 100644 index 0000000..90c2018 Binary files /dev/null and b/static/images/photo_informaticiens/richard_stallman.jpg differ diff --git a/static/images/photo_informaticiens/tim-berners-lee.jpg b/static/images/photo_informaticiens/tim-berners-lee.jpg new file mode 100644 index 0000000..9128d44 Binary files /dev/null and b/static/images/photo_informaticiens/tim-berners-lee.jpg differ diff --git a/static/style.css b/static/style.css index e053f0a..ff1d465 100644 --- a/static/style.css +++ b/static/style.css @@ -1,33 +1,52 @@ -.playwrite-cu-guides-regular { - font-family: "Playwrite CU Guides", cursive; - font-weight: 400; - font-style: normal; -} - - -.logo-style{ - border: solid 0px black; - background: silver; - text-align: center; - height: 94px; - width: 100px;} -body { - font-family: "Playwrite CU Guides", cursive; - background-color: #E9FAFC;} -h1 { - text-decoration: underline; - color: red;} - -h2 { - text-decoration: underline;} - -p { - color: blue;} - -table { - border-collapse: separate;} - -td { - border-style: inset; - border-color: #0000FF #00FFFF #00FFFF #0000FF;} - +body{ + background-color:ivory; + background-image: url(http://lorempixel.com/200/100/), url(http://lorempixel.com/400/200/); + background-size: cover; + background-repeat: repeat; +} + +h1{ + text-decoration:underline; + color:red; + text-align:center; + font-family:Cursive; +} + +th{ + border : 2px solid black; +} +.nom{ + text-align:left; +} + +.nom:hover{ + background-color:wheat; + color:green +} +.image{ + max-width : 400px; + text-align:center; + border-color:silver; + border-width:10px; + border-style:double; + overflow: scroll; + resize:both; + margin:50px; + animation-name: cos; + animation-duration: 2s; + animation-timing-function:ease-in ; + animation-direction: alternate; + animation-iteration-count: 2; + border-radius: 10px 30px 30px 30px; +} + +@keyframes cos { + 0% {transform : rotate(-45deg); left: -50px} + 100% {transform : rotate(45deg); left: 50px} +} + +.image:after { + content: "NSI" ; + color: red; +} + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 39d7403..a469043 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,69 +1,32 @@ - - - - - - - Accueil - - - - Logo -
-
-

Mon site journal

-

Accueil

-

Aller sur NOTES

-

Verifier l'heure

-

Aller au formulaire

-

Répertoire

- -
-
- {% if Identifiant == "Alban" %} -

Ajouter un utilisateur

-
-
-
- -
- {% endif %} -

Se connecter avec un autre identifiant

-
-
- - + + + + + + Site informaticiens + + +

+ Quelsques grands noms de l'informagique ! +

+ + + + + + + + + + + + + + + + +
+ Grace Hopper + L1 C2L1 C3
L2 C1L2 C2L2 C3
+ + \ No newline at end of file diff --git a/templates/page_hopper.html b/templates/page_hopper.html index b39a795..0463c7b 100644 --- a/templates/page_hopper.html +++ b/templates/page_hopper.html @@ -1,19 +1,19 @@ - - - - - - Site informaticiens - - -

- Grace Hopper -

- - Hopper - -
- - Retour à l'accueuil - + + + + + + Site informaticiens + + +

+ Grace Hopper +

+ + Hopper + +
+ + Retour à l'accueuil + \ No newline at end of file