This commit is contained in:
batikano1 2021-12-03 06:04:35 +01:00
commit 3513a02f52
15 changed files with 115 additions and 56 deletions

7
app.py
View File

@ -25,6 +25,13 @@ def sauveteur(idsauveteur):
def bateau(idbateau): def bateau(idbateau):
return pages.bateau(idbateau) return pages.bateau(idbateau)
@app.route('/modifications')
@app.route('/modifications/')
@app.route('/modification')
@app.route('/modification/')
def modifs():
return pages.modifs()
@app.route('/expeditions/<int:idexpe>') @app.route('/expeditions/<int:idexpe>')
@app.route('/expedition/<int:idexpe>') @app.route('/expedition/<int:idexpe>')
def expe(idexpe): def expe(idexpe):

View File

@ -10,6 +10,9 @@ dbname = "site.db"
def main(): def main():
return render_template("index.html") return render_template("index.html")
def modifs():
return render_template("modification.html")
def error(): def error():
return render_template("error.html") return render_template("error.html")
@ -17,20 +20,18 @@ def bateau(idbateau):
dico = {} dico = {}
dico["NomBateau"] = "Le Bateau" dico["NomBateau"] = "Le Bateau"
dico["nom"] = "Le constructeur" dico["nom"] = "Le constructeur"
dico["Dimensions"] = 666 dico["date_naissance"] = "Aujourd'hui"
dico["DateInstallation"] = "Aujourd'hui" dico["date_mort"] = "Demain"
dico["DateCondamnation"] = "Demain"
dico["ville"] = "ici"
dico["HistoireBateau"] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at odio cursus, rutrum odio non, dignissim risus. Pellentesque non varius ante. Vivamus scelerisque pulvinar mauris, nec imperdiet ante mattis et." dico["HistoireBateau"] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at odio cursus, rutrum odio non, dignissim risus. Pellentesque non varius ante. Vivamus scelerisque pulvinar mauris, nec imperdiet ante mattis et."
result = lib.ex_sql(dbname,"SELECT * FROM bateau WHERE ship_id=?",(idbateau,)) result = lib.ex_sql(dbname,"SELECT * FROM bateau WHERE ship_id=?",(idbateau,))
if len(result)>=1: if len(result)>=1:
result = result[0] result = result[0]
dico["nom"] = result["nom"] dico["nom"] = result["nom"]
print(result) print(result)
dico["Dimensions"] = result["dimension"] dico["date_naissance"] = result["date_naissance"]
dico["DateInstallation"] = result["date_naissance"] dico["date_mort"] = result["date_mort"]
dico["DateCondamnation"] = result["date_mort"] dico["Histoire"] = result["histoire"]
return render_template("sauveteur.html",**dico) return render_template("bateau.html",**dico)
else: else:
return error() return error()

View File

@ -20,6 +20,10 @@ table, tr, td {
display: flex; display: flex;
} }
.form-pad {
padding: 20px;
}
#banner { #banner {
background-color: #dfcba8; background-color: #dfcba8;
margin-left: calc(-50vw + 50%); margin-left: calc(-50vw + 50%);
@ -41,8 +45,11 @@ table, tr, td {
} }
#logo_title { #logo_title {
padding-top: 10px;
padding-bottom: 10px;
font-weight: bold; font-weight: bold;
font-size: 30px; font-size: 30px;
color: black;
} }
#searchresults { #searchresults {

View File

@ -1,5 +1,5 @@
body { body {
background: black; background: #313131;
font-family: arial; font-family: arial;
color: white; color: white;
} }
@ -22,8 +22,12 @@ table, tr, td {
display: flex; display: flex;
} }
.form-pad {
padding: 20px;
}
#banner { #banner {
background-color: #a36f13; background-color: #9C7228;
margin-left: calc(-50vw + 50%); margin-left: calc(-50vw + 50%);
margin-right: calc(-50vw + 50%); margin-right: calc(-50vw + 50%);
margin-top: calc(-50vw + 50%); margin-top: calc(-50vw + 50%);
@ -34,7 +38,7 @@ table, tr, td {
} }
#banner_index { #banner_index {
background-color: #a36f13; background-color: #9C7228;
margin-left: calc(-50vw + 50%); margin-left: calc(-50vw + 50%);
margin-right: calc(-50vw + 50%); margin-right: calc(-50vw + 50%);
margin-top: calc(-50vw + 50%); margin-top: calc(-50vw + 50%);
@ -43,8 +47,15 @@ table, tr, td {
} }
#logo_title { #logo_title {
padding-top: 10px;
padding-bottom: 10px;
font-weight: bold; font-weight: bold;
font-size: 30px; font-size: 30px;
color: white;
}
#searchresults {
width: 75%;
} }
.searchbar { .searchbar {
@ -55,3 +66,11 @@ table, tr, td {
.right-align { .right-align {
margin-left: auto; margin-left: auto;
} }
a:link {
color: #8F9BFF;
}
a:visited {
color: #9BA6FF;
}

26
templates/bateau.html Normal file
View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<head>
<title>{{nom}} {{prenom}} - Sauveteurs du Dunkerquois</title>
{% include 'head.html' %}
</head>
<body>
{% include "smallheader.html" %}
<h1>{{nom}} - Un navire</h1>
<div class="flexbox">
<p>{{Histoire}}</p>
<p class="right-align">
<table>
<tr>
<td class="table_key">Nom</td><td>{{nom}}</td>
</tr>
<tr>
<td class="table_key">Mise à flot</td><td>{{date_naissance}}</td>
</tr>
<tr>
<td class="table_key">Mise en arrêt</td><td>{{date_mort}}</td>
</tr>
</table>
</p>
</div>
</body>
</html>

View File

@ -1,16 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8">
<title>404 Not Found - Sauveuteurs du dunkerquois</title> <title>404 Not Found - Sauveuteurs du dunkerquois</title>
<link href="../static/style.css" rel="stylesheet" type="text/css" /> {% include 'head.html' %}
<link rel="icon" type="image/png" href="../static/favicon.png" />
</head> </head>
<body> <body>
<header id="banner"> {% include 'smallheader.html' %}
<img src="../static/icon.png" width="150" height="75">
<span id="logo_title">Sauveuteurs du dunkerquois</span>
</header>
<h1>Page introuvable !</h1> <h1>Page introuvable !</h1>
<p>Retour à <a href="/home">la page d'accueil</a>.</p> <p>Retour à <a href="/home">la page d'accueil</a>.</p>
</body> </body>

View File

@ -1,4 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<<<<<<< HEAD
<!--- Variables <!--- Variables
nom nom
prenom prenom
@ -7,11 +8,14 @@ place
histoire histoire
!--> !-->
<!-- saved from url=(0055)file:///C:/Users/rugja/Marin/templates/bateau_temp.html --> <!-- saved from url=(0055)file:///C:/Users/rugja/Marin/templates/bateau_temp.html -->
=======
>>>>>>> f53b67000eac017030794619a1ccd0eaa7ad151e
<html><head> <html><head>
<title>{{nom}}- Sauveteurs du dunkerquois</title> <title>{{nom}}- Sauveteurs du dunkerquois</title>
{% include 'head.html' %} {% include 'head.html' %}
</head> </head>
<body> <body>
<<<<<<< HEAD
{% include "smallheader.html" %} {% include "smallheader.html" %}
<h1>{{nom}}</h1> <h1>{{nom}}</h1>
<div class="flexbox"> <div class="flexbox">
@ -27,4 +31,10 @@ histoire
<td>{{date}}</td> <td>{{date}}</td>
</tr> </tr>
</tbody></table> </tbody></table>
=======
{% include "smallheader.html" %}
<h1>{{siecle}}</h1>
</body>
</html>
>>>>>>> f53b67000eac017030794619a1ccd0eaa7ad151e

View File

@ -1,3 +1,3 @@
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../static/style.css" rel="stylesheet" type="text/css" /> <link href="../static/style_dark.css" rel="stylesheet" type="text/css" />
<link rel="icon" type="image/png" href="../static/favicon.png" /> <link rel="icon" type="image/png" href="../static/favicon.png" />

View File

@ -1,7 +1,8 @@
<center> <center>
<header id="banner_index"> <header id="banner_index">
<img src="../static/icon.png" width="250" height="125"> <img src="../static/icon.png" width="250" height="125">
<h1>Sauveteurs du Dunkerquois</h1> <br>
<div id="logo_title">Sauveteurs du Dunkerquois</div>
</header> </header>
<br> <br>
<form action="/search" method="post"> <form action="/search" method="post">

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<head>
<title>{{nom}} {{prenom}} - Sauveuteurs du dunkerquois</title>
{% include 'head.html' %}
</head>
<body>
{% include "smallheader.html" %}
<h1>Proposer une modification :</h1>
<form class="form-pad" method="post">
Votre nom (facultatif) : <input type="text" name="nom" placeholder="Votre nom"><br><br>
Votre prénom (facultatif) : <input type="text" name="prenom" placeholder="Votre prénom (facultatif)"><br><br>
Votre adresse e-mail (facultatif) : <input type="email" name="email" placeholder="Votre adresse e-mail (facultatif)"><br><br>
Nom de l'article à modifier : <input type="text" name="article" placeholder="Nom de l'article à modifier" required><br><br>
Modification suggérée :<br><textarea name="modif" placeholder="Modification suggérée" required></textarea><br><br>
<input type="submit" value="Envoyer">
</form>
</body>
</html>

View File

@ -1,12 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<!--- Variables
nom
prenom
date
place
histoire
!-->
<!-- saved from url=(0055)file:///C:/Users/rugja/Marin/templates/bateau_temp.html -->
<html><head> <html><head>
<title>{{nom}}{{prenom}}- Sauveuteurs du dunkerquois</title> <title>{{nom}}{{prenom}}- Sauveuteurs du dunkerquois</title>
{% include 'head.html' %} {% include 'head.html' %}
@ -35,7 +27,5 @@ histoire
<td>{{place}}</td> <td>{{place}}</td>
</tr> </tr>
</tbody></table> </tbody></table>
</body>
</html>
</body></html>

View File

@ -1,15 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<!--- Variables
nom
prenom
date_naissance
date_deces
nb_sauvetages
nb_sauves
gratifications
description
!-->
<head> <head>
<title>{{nom}} {{prenom}} - Sauveuteurs du dunkerquois</title> <title>{{nom}} {{prenom}} - Sauveuteurs du dunkerquois</title>
{% include 'head.html' %} {% include 'head.html' %}

View File

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<head> <head>
<title>Recherche - Sauveuteurs du dunkerquois</title> <title>Recherche - Sauveteurs du Dunkerquois</title>
{% include 'head.html' %} {% include 'head.html' %}
</head> </head>
<body> <body>

View File

@ -4,7 +4,7 @@
<span id="logo_title">Sauveteurs du Dunkerquois</span> <span id="logo_title">Sauveteurs du Dunkerquois</span>
</header></a> </header></a>
<br> <br>
<a href="https://www.google.com/">Proposer une modification</a> <a href="/modification">Proposer une modification</a>
<form action="/search" class="searchbar" method="post"> <form action="/search" class="searchbar" method="post">
<input type="text" name="search" value="" placeholder="Rechercher des sauveteurs, des bateaux, des expéditions..." size="40" required> <input type="text" name="search" value="" placeholder="Rechercher des sauveteurs, des bateaux, des expéditions..." size="40" required>
<input type="submit" value="Rechercher"> <input type="submit" value="Rechercher">

View File

@ -1,17 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<!--- Variables
nom
date
evenement
!-->
<!-- saved from url=(0055)file:///C:/Users/rugja/Marin/templates/bateau_temp.html -->
<html><head> <html><head>
<title>{{nom}} - Sauveuteurs du dunkerquois</title> <title>{{nom}} - Sauveuteurs du dunkerquois</title>
{% include 'head.html' %} {% include 'head.html' %}
</head> </head>
<body> <body>
{% include "smallheader.html" %} {% include "smallheader.html" %}
<h1>{{nom}}</h1> <h1>{{nom}}</h1>
<div class="flexbox"> <div class="flexbox">
<table> <table>
<tbody><tr> <tbody><tr>
@ -22,7 +16,7 @@ evenement
<td class="table_key">Date</td> <td class="table_key">Date</td>
<td>{{Annee}}</td> <td>{{Annee}}</td>
</tr> </tr>
<tr> <tr>
<script> {% for i in range(Evenement) %} <script> {% for i in range(Evenement) %}
{{ i }} {{ i }}
{% endfor %} {% endfor %}
@ -30,5 +24,7 @@ evenement
<td>{{Evenement}}</td> <td>{{Evenement}}</td>
<td>{{Evenement}}</td> <td>{{Evenement}}</td>
</tr> </tr>
</tbody></table> </tbody>
</body></html> </table>
</body>
</html>