source: src/main/resources/templates/termini_form.html@ 850b344

Last change on this file since 850b344 was 850b344, checked in by Tamara Simikj <tamara.simic12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 3.1 KB
RevLine 
[850b344]1<!DOCTYPE html>
2<html lang="en" xmlns:width="http://www.w3.org/1999/xhtml">
3<head>
4 <meta charset="UTF-8">
5 <title>Add new date</title>
6 <link href="https://bootswatch.com/5/journal/bootstrap.css" rel="stylesheet">
7 <script src="https://bootswatch.com/_assets/css/custom.min.css"></script>
8 <script src="https://bootswatch.com/_vendor/prismjs/themes/prism-okaidia.css" ></script>
9 <script src="https://bootswatch.com/_vendor/font-awesome/css/font-awesome.min.css"></script>
10 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
11
12 <script type="text/javascript">
13 $(document).ready(function(){
14 var $regexname=/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}\:[0-9]{2}\:[0-9]{2}Z$/;
15 $('#pocetok').on('keypress keydown keyup',function(){
16 if (!$(this).val().match($regexname)) {
17 // there is a mismatch, hence show the error message
18 $('#message').removeClass('hidden');
19 $('#message').show();
20 }
21 else{
22 // else, do not display message
23 $('#message').hide();
24 $('#pocetok').addClass('is-valid');
25 }
26 });
27 });
28 </script>
29</head>
30<body>
31<div th:replace="layout.html :: header"></div>
32
33<form method="POST" th:action="@{'/termini/{id}' (id = ${termin?.id})}">
34 <fieldset>
35 <div class="container" width:50%>
36 <br>
37 <br>
38 <h3>Create new termin</h3>
39<!--th:value="${termin} ==null ? 'yyyy-MM-ddThh:mm:00Z' : ${termin?.pocetokFormatted2()}"-->
40 <div class="form-group">
41 <label class="form-label mt-4"for="pocetok" >Pocetok:</label>
42 <input id="pocetok" name="pocetok" type="text"
43
44 th:value="${termin?.pocetokFormatted2()}"
45 class="form-control"
46 placeholder="yyyy-MM-ddThh:mm:00Z"
47 pattern="[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}\:[0-9]{2}\:[0-9]{2}Z"
48 required>
49 </div>
50 <p><span id="message" class="text-warning hidden">Please Enter a time format - yyyy-MM-ddThh:mm:00Z</span></p>
51 <div class="form-group">
52 <label class="form-label mt-4"for="vremetraenje" >Vremetraenje:</label>
53 <input id="vremetraenje" name="vremetraenje" type="number"
54 th:value="${termin?.vremetraenje}"
55 class="form-control" >
56 </div>
57 <label for="vrabotenId" class="form-label mt-4">Vraboten:</label><br/>
58 <input id="vrabotenId" name="vrabotenId"
59 type="text"
60 th:value="${session.user.getVraboteni().getId()}"
61 class="form-control" readonly>
62
63
64 <br>
65 <div><button type="submit" class="btn btn-primary">Submit</button></div>
66 <a id="back" href="/termini" type="button" class="btn btn-link">Back to termini</a>
67 </div>
68 </div>
69 </fieldset>
70</form>
71<div th:replace="layout.html :: footer"></div>
72</body>
73</html>
Note: See TracBrowser for help on using the repository browser.