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('/')
|
||||
|
||||
|
||||
@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")
|
||||
def calibration():
|
||||
return render_template('calibration.html')
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>NenuScanner</title>
|
||||
<link rel="stylesheet" href="/static/bulma.min.css">
|
||||
{% block extracss %}
|
||||
|
||||
{% endblock extracss %}
|
||||
{% block extracss %}{% endblock extracss %}
|
||||
</head>
|
||||
<body>
|
||||
<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>
|
||||
{% if objects %}
|
||||
<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>
|
||||
{% for object in objects %}
|
||||
<li>{{ object.name }}</li>
|
||||
<li><a href="/object/{{ object.id }}">{{ object.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>Il n'y a aucun object pour le moment...</p>
|
||||
<p>Il n'y a aucun objet pour le moment...</p>
|
||||
{% 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 class="modal-background"></div>
|
||||
<form action="/create-object/" method="POST">
|
||||
<div class="modal-content">
|
||||
<div class="field">
|
||||
<label class="label">Nom de l'object</label>
|
||||
<label class="label">Nom de l'objet</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" name="name" placeholder="Nom de l'objet">
|
||||
</div>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<div class="field is-grouped is-grouped-centered">
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -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