Fix bugs
This commit is contained in:
parent
45401e3255
commit
1c7f7e648a
10
app.py
10
app.py
|
|
@ -77,20 +77,16 @@ def scan(id: int):
|
|||
if calibration_id is None:
|
||||
raise RuntimeError("Impossible de faire l'acquisition sans étalonnage")
|
||||
|
||||
return render_template('scan.html', object=object)
|
||||
return render_template('scan.html', object=object, calibrated=True)
|
||||
|
||||
|
||||
@app.route('/scan-acquisition/<id>')
|
||||
def scan_existing(id: int):
|
||||
conn = db.get()
|
||||
calibration_id = session.get('calibration_id', None)
|
||||
calibrated = session.get('calibration_id', None) is not None
|
||||
acquisition = db.Acquisition.get_from_id(id, conn)
|
||||
object = acquisition.object(conn)
|
||||
|
||||
if calibration_id is None:
|
||||
raise RuntimeError("Impossible de faire l'acquisition sans étalonnage")
|
||||
|
||||
return render_template('scan.html', object=object, acquisition=acquisition)
|
||||
return render_template('scan.html', object=object, acquisition=acquisition, calibrated=calibrated)
|
||||
|
||||
|
||||
@app.route("/calibrate/")
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
<div class="field is-grouped is-grouped-multiline">
|
||||
<div class="control">
|
||||
<button {% if acquisition and acquisition.validated %}disabled{% endif %} id="scan-button" class="button is-link">Lancer l'acquisition</button>
|
||||
<button {% if not calibrated or (acquisition and acquisition.validated) %}disabled{% endif %} id="scan-button" class="button is-link" {% if acquisition and acquisition.validated %}title="Vous ne pouvez pas refaire cette acquisition car elle a été validée"{% elif not calibrated %}title="Étalonnez le scanner pour pouvoir lancer l'acquisition"{% endif %}>Lancer l'acquisition</button>
|
||||
</div>
|
||||
</div>
|
||||
<article id="error-container" class="message is-danger" style="display: none;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue