From 5fd91c636b98b61aa82c7854f9e3bb3edd7fdf74 Mon Sep 17 00:00:00 2001 From: Julian Rother <julianr@fsmpi.rwth-aachen.de> Date: Tue, 17 Jul 2018 14:01:36 +0200 Subject: [PATCH] Added client-side-valiadion for chapter mark suggestions, closes #85 --- templates/lecture.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/lecture.html b/templates/lecture.html index e3b8eb6..ab2a96a 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -128,7 +128,7 @@ $(function() { var m = zeropad( Math.trunc((timestamp%3600)/60),2); var s = zeropad( Math.trunc(timestamp%60),2); var timeasstring = h+':'+m+':'+s; - return '<form method="post" data-url="{{ url_for('suggest_chapter', lectureid=lecture.id) }}" onSubmit="return hintchapterclick(this);"><input class="form-control" placeholder="00:00.000" name="time" type="text" value="'+timeasstring+'"><br><input class="form-control" placeholder="Kapitel" name="text" type="text"><br><input type="submit" class="btn btn-default" value="{% if ismod() %}Hinzufügen{% else %}Vorschlagen{% endif %}"></form>'; + return '<form class="needs-validation" method="post" data-url="{{ url_for('suggest_chapter', lectureid=lecture.id) }}" onSubmit="return hintchapterclick(this);"><input class="form-control" placeholder="00:00" name="time" type="text" value="'+timeasstring+'" pattern="(|[0-9]{1,2}:(|[0-9]{1,2}:))[0-9]{1,2}"><br><input class="form-control" placeholder="Titel" name="text" type="text" required><br><input type="submit" class="btn btn-default" value="{% if ismod() %}Hinzufügen{% else %}Vorschlagen{% endif %}"></form>'; } }) -- GitLab