Working
This commit is contained in:
parent
ed80af586c
commit
e6dec9168e
7
app.py
7
app.py
|
|
@ -21,6 +21,13 @@ def create_object():
|
||||||
return redirect('/')
|
return redirect('/')
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/object/<id>')
|
||||||
|
def object(id: int):
|
||||||
|
conn = db.get()
|
||||||
|
object = db.Object.get_from_id(id, conn)
|
||||||
|
return render_template('object.html', object=object)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/calibration")
|
@app.route("/calibration")
|
||||||
def calibration():
|
def calibration():
|
||||||
return render_template('calibration.html')
|
return render_template('calibration.html')
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>NenuScanner</title>
|
<title>NenuScanner</title>
|
||||||
<link rel="stylesheet" href="/static/bulma.min.css">
|
<link rel="stylesheet" href="/static/bulma.min.css">
|
||||||
{% block extracss %}
|
{% block extracss %}{% endblock extracss %}
|
||||||
|
|
||||||
{% endblock extracss %}
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar has-shadow is-link is-boxed" role="navigation" aria-label="dropdown navigation">
|
<nav class="navbar has-shadow is-link is-boxed" role="navigation" aria-label="dropdown navigation">
|
||||||
|
|
|
||||||
|
|
@ -6,23 +6,23 @@
|
||||||
<h1 class="title">Bienvenue sur NenuScanner</h1>
|
<h1 class="title">Bienvenue sur NenuScanner</h1>
|
||||||
{% if objects %}
|
{% if objects %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p>Voici les objects existants dans la base de données :
|
<p>Voici les objets existants dans la base de données :
|
||||||
<ul>
|
<ul>
|
||||||
{% for object in objects %}
|
{% for object in objects %}
|
||||||
<li>{{ object.name }}</li>
|
<li><a href="/object/{{ object.id }}">{{ object.name }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Il n'y a aucun object pour le moment...</p>
|
<p>Il n'y a aucun objet pour le moment...</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button id="add-object" class="button is-primary">Ajouter un nouvel objet</button>
|
<button id="add-object" class="button is-link">Ajouter un nouvel objet</button>
|
||||||
<div id="add-object-modal" class="modal">
|
<div id="add-object-modal" class="modal">
|
||||||
<div class="modal-background"></div>
|
<div class="modal-background"></div>
|
||||||
<form action="/create-object/" method="POST">
|
<form action="/create-object/" method="POST">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">Nom de l'object</label>
|
<label class="label">Nom de l'objet</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" type="text" name="name" placeholder="Nom de l'objet">
|
<input class="input" type="text" name="name" placeholder="Nom de l'objet">
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
<div class="field is-grouped is-grouped-centered">
|
<div class="field is-grouped is-grouped-centered">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<button class="button is-primary">Créer un objet</button>
|
<button class="button is-link">Créer un objet</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<section class="section">
|
||||||
|
<div class="container">
|
||||||
|
<h1 class="title">{{ object.name }}</h1>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endblock content %}
|
||||||
|
|
||||||
Loading…
Reference in New Issue