Merge branch 'master' of https://forge.chapril.org/CretinsMotorisesIngenieux/Marin
Suppr temporaire.
This commit is contained in:
commit
2a1c774f45
13
app.py
13
app.py
|
@ -10,14 +10,25 @@ app = Flask(__name__)
|
|||
def main():
|
||||
return pages.main()
|
||||
|
||||
@app.route('/search', methods=['GET', 'POST'])
|
||||
def search():
|
||||
texte = request.form["search"]
|
||||
print(texte)
|
||||
return pages.main()
|
||||
|
||||
@app.route('/sauveteurs/<int:idsauveteur>')
|
||||
@app.route('/sauveteur/<int:idsauveteur>')
|
||||
def sauveteur(idsauveteur):
|
||||
return pages.sauveteur(idsauveteur)
|
||||
|
||||
@app.route('/bateaux/<int:idbateau>')
|
||||
@app.route('/bateau/<int:idbateau>')
|
||||
def bateau(idbateau):
|
||||
return pages.bateau(idbateau)
|
||||
|
||||
@app.errorhandler(404)
|
||||
def error(e):
|
||||
return pages.error()
|
||||
|
||||
|
||||
if __name__=="__main__":
|
||||
app.run(debug=True)
|
||||
|
|
33
pages.py
33
pages.py
|
@ -11,6 +11,27 @@ def main():
|
|||
def error():
|
||||
return render_template("error.html")
|
||||
|
||||
def bateau(idbateau):
|
||||
dico = {}
|
||||
dico["NomBateau"] = "Le Bateau"
|
||||
dico["nom"] = "Le constructeur"
|
||||
dico["Dimensions"] = 666
|
||||
dico["DateInstallation"] = "Aujourd'hui"
|
||||
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."
|
||||
result = lib.ex_sql(dbname,"SELECT * FROM bateau WHERE ship_id=?",(idbateau,))
|
||||
if len(result)>=1:
|
||||
result = result[0]
|
||||
dico["nom"] = result["nom"]
|
||||
print(result)
|
||||
dico["Dimensions"] = result["dimension"]
|
||||
dico["DateInstallation"] = result["date_naissance"]
|
||||
dico["DateCondamnation"] = result["date_mort"]
|
||||
return render_template("sauveteur.html",**dico)
|
||||
else:
|
||||
return error()
|
||||
|
||||
def sauveteur(idsauveteur):
|
||||
dico = {}
|
||||
dico["nom"] = "John"
|
||||
|
@ -19,7 +40,11 @@ def sauveteur(idsauveteur):
|
|||
dico["nb_sauves"] = 666
|
||||
dico["gratifications"] = 1
|
||||
dico["description"] = "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 sauveteur WHERE personal_id=?",(idsauveteur,))[0]
|
||||
dico["nom"] = result["nom"]
|
||||
dico["prenom"] = result["prenom"]
|
||||
return render_template("sauveteur.html",**dico)
|
||||
result = lib.ex_sql(dbname,"SELECT * FROM sauveteur WHERE personal_id=?",(idsauveteur,))
|
||||
if len(result)==1:
|
||||
result = result[0]
|
||||
dico["nom"] = result["nom"]
|
||||
dico["prenom"] = result["prenom"]
|
||||
return render_template("sauveteur.html",**dico)
|
||||
else:
|
||||
return error()
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 222 KiB |
|
@ -0,0 +1,57 @@
|
|||
body {
|
||||
background: black;
|
||||
font-family: arial;
|
||||
color: white;
|
||||
}
|
||||
|
||||
h1, p {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
table, tr, td {
|
||||
border: 1px solid white;
|
||||
border-collapse: collapse;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table_key {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#banner {
|
||||
background-color: #dfcba8;
|
||||
margin-left: calc(-50vw + 50%);
|
||||
margin-right: calc(-50vw + 50%);
|
||||
margin-top: calc(-50vw + 50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#banner_index {
|
||||
background-color: #dfcba8;
|
||||
margin-left: calc(-50vw + 50%);
|
||||
margin-right: calc(-50vw + 50%);
|
||||
margin-top: calc(-50vw + 50%);
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#logo_title {
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.searchbar {
|
||||
float: right;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.right-align {
|
||||
margin-left: auto;
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--- Variables
|
||||
nom
|
||||
constructeur
|
||||
dimensions
|
||||
installation
|
||||
condamnation
|
||||
origine
|
||||
histoire
|
||||
!-->
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<title>{{nom}} - Sauveuteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css">
|
||||
<link href="file:///C:/Users/rugja/Marin/templates/style.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<header id="banner">
|
||||
<img src="../static/icon.png" width="150" height="75">
|
||||
<span id="logo_title">Sauveuteurs du dunkerquois</span>
|
||||
</header>
|
||||
<br>
|
||||
<a href="https://www.google.com/">Proposer une modification</a>
|
||||
<form class="searchbar" method=get>
|
||||
<input type="text" placeholder="Saisissez votre recherche..." size=20>
|
||||
<input type="submit" value="Rechercher">
|
||||
</form>
|
||||
<h1>{{nom}}}</h1>
|
||||
<div class="flexbox">
|
||||
<p>{{HistoireBateau}}</p>
|
||||
<p class="right-align">
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td class="table_key">Nom</td>
|
||||
<td>{{NomBateau}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Constructeur</td>
|
||||
<td>{{nom}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Dimensions</td>
|
||||
<td>{{Dimensions}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Installation</td>
|
||||
<td>{{Date1}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Condamnation</td>
|
||||
<td>{{Date2}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Origine</td>
|
||||
<td>{{ville}}</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
|
||||
|
||||
</body></html>
|
|
@ -1,11 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="/static/style.css" rel="stylesheet" type="text/css" />
|
||||
<meta charset="utf-8">
|
||||
<title>404 Not Found - Sauveuteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="icon" type="image/png" href="../static/favicon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Erreur !</h1>
|
||||
<p>Retour à <a href="/home">la page d'accueil</a></p>
|
||||
<header id="banner">
|
||||
<img src="../static/icon.png" width="150" height="75">
|
||||
<span id="logo_title">Sauveuteurs du dunkerquois</span>
|
||||
</header>
|
||||
<h1>Page introuvable !</h1>
|
||||
<p>Retour à <a href="/home">la page d'accueil</a>.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--- Variables
|
||||
date
|
||||
evenement
|
||||
!-->
|
||||
<!-- saved from url=(0055)file:///C:/Users/rugja/Marin/templates/bateau_temp.html -->
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<title>{{siecle}}- Sauveuteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<header id="banner">
|
||||
<img src="../static/icon.png" width="150" height="75">
|
||||
<span id="logo_title">Sauveuteurs du dunkerquois</span>
|
||||
</header>
|
||||
<br>
|
||||
<a href="https://www.google.com/">Proposer une modification</a>
|
||||
<form class="searchbar" method=get>
|
||||
<input type="text" placeholder="Saisissez votre recherche..." size=20>
|
||||
<input type="submit" value="Rechercher">
|
||||
</form>
|
||||
<h1>{{siecle}}</h1>
|
||||
<div class="flexbox">
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<script> {% for i in range(Date) %}
|
||||
{{ i }}
|
||||
{% endfor %}
|
||||
</script>
|
||||
<td class="table_key">Date</td>
|
||||
<td>{{Annee}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<script> {% for i in range(Evenement) %}
|
||||
{{ i }}
|
||||
{% endfor %}
|
||||
</script>
|
||||
<td>{{Evenement}}</td>
|
||||
<td>{{Evenement}}</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</body></html>
|
|
@ -3,6 +3,7 @@
|
|||
<meta charset="utf-8">
|
||||
<title>Sauveteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="icon" type="image/png" href="../static/favicon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<header id="banner_index">
|
||||
|
@ -13,11 +14,11 @@
|
|||
</header>
|
||||
<br>
|
||||
<center>
|
||||
<form method="get" >
|
||||
<input type="text"
|
||||
placeholder="Rechercher un sauveteur, un bateau, une personne sauvée..." size=40>
|
||||
<input type="submit" value="Rechercher">
|
||||
</form>
|
||||
<form action="/search" method="post">
|
||||
<label for="search">Recherche :</label>
|
||||
<input type="text" name="search" value="" placeholder="Rechercher des sauveteurs, des bateaux, des expéditions..." size="40" required>
|
||||
<input type="submit" value="Rechercher">
|
||||
</form>
|
||||
<br>
|
||||
<div>
|
||||
<button action="/random">Page au hasard</button>
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--- Variables
|
||||
nom
|
||||
prenom
|
||||
date
|
||||
place
|
||||
histoire
|
||||
!-->
|
||||
<!-- saved from url=(0055)file:///C:/Users/rugja/Marin/templates/bateau_temp.html -->
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<title>{{nom}}{{prenom}}- Sauveuteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<header id="banner">
|
||||
<img src="../static/icon.png" width="150" height="75">
|
||||
<span id="logo_title">Sauveuteurs du dunkerquois</span>
|
||||
</header>
|
||||
<br>
|
||||
<a href="https://www.google.com/">Proposer une modification</a>
|
||||
<form class="searchbar" method=get>
|
||||
<input type="text" placeholder="Saisissez votre recherche..." size=20>
|
||||
<input type="submit" value="Rechercher">
|
||||
</form>
|
||||
<h1>{{nom}}}{{prenom}}</h1>
|
||||
<div class="flexbox">
|
||||
<p>{{histoire}}</p>
|
||||
<p class="right-align">
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td class="table_key">Nom</td>
|
||||
<td>{{nom}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Prenom</td>
|
||||
<td>{{prenom}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Date</td>
|
||||
<td>{{date}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Place</td>
|
||||
<td>{{place}}</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
|
||||
|
||||
</body></html>
|
|
@ -14,7 +14,8 @@ description
|
|||
<meta charset="utf-8">
|
||||
<title>{{nom}} {{prenom}} - Sauveuteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<link rel="icon" type="image/png" href="../static/favicon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<header id="banner">
|
||||
<img src="../static/icon.png" width="150" height="75">
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{nom}} {{prenom}} - Sauveuteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="icon" type="image/png" href="../static/favicon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<header id="banner">
|
||||
<img src="../static/icon.png" width="150" height="75">
|
||||
<span id="logo_title">Sauveuteurs du dunkerquois</span>
|
||||
</header>
|
||||
<br>
|
||||
<form class="searchbar" method=get>
|
||||
<input type="text" placeholder="Saisissez votre recherche..." size=20>
|
||||
<input type="submit" value="Rechercher">
|
||||
</form>
|
||||
<script> {% for key, value in dres %}
|
||||
{{<a href=}value{>}key{</a>}}
|
||||
{% endfor %}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--- Variables
|
||||
nom
|
||||
date
|
||||
evenement
|
||||
!-->
|
||||
<!-- saved from url=(0055)file:///C:/Users/rugja/Marin/templates/bateau_temp.html -->
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<title>{{nom}} - Sauveuteurs du dunkerquois</title>
|
||||
<link href="../static/style.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<header id="banner">
|
||||
<img src="../static/icon.png" width="150" height="75">
|
||||
<span id="logo_title">Sauveuteurs du dunkerquois</span>
|
||||
</header>
|
||||
<br>
|
||||
<a href="https://www.google.com/">Proposer une modification</a>
|
||||
<form class="searchbar" method=get>
|
||||
<input type="text" placeholder="Saisissez votre recherche..." size=20>
|
||||
<input type="submit" value="Rechercher">
|
||||
</form>
|
||||
<h1>{{nom}}</h1>
|
||||
<div class="flexbox">
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<script> {% for i in range(Date) %}
|
||||
{{ i }}
|
||||
{% endfor %}
|
||||
</script>
|
||||
<td class="table_key">Date</td>
|
||||
<td>{{Annee}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<script> {% for i in range(Evenement) %}
|
||||
{{ i }}
|
||||
{% endfor %}
|
||||
</script>
|
||||
<td>{{Evenement}}</td>
|
||||
<td>{{Evenement}}</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</body></html>
|
Loading…
Reference in New Issue