source: src/main/resources/templates/add_product.html

main
Last change on this file was d14176d, checked in by HristijanMitic00 <hristijan.mitic.01@…>, 16 months ago

First commit

  • Property mode set to 100644
File size: 3.2 KB
Line 
1<th:block xmlns:th="http://www.thymeleaf.org">
2 <section class="jumbotron text-center">
3 <div class="container">
4 <h1 class="jumbotron-heading">FMO</h1>
5 <h2 class="jumbotron-heading">Food Market Online</h2>
6 </div>
7 </section>
8
9 <div class="container">
10 <div class="row">
11 <div class="col-md-5">
12 <form action="/products/add" method="POST">
13 <input id="id" type="hidden" name="id" th:value="(${product} != null ? ${product.getIdProdukt()} : '')">
14 <div class="form-group">
15 <label for="name">Product name</label>
16 <input type="text"
17 class="form-control"
18 id="name"
19 name="name"
20 th:value="(${product} != null ? ${product.getIme()} : '')"
21 required
22 placeholder="Enter product name">
23 </div>
24 <div class="form-group">
25 <label for="price">Price</label>
26 <input type="text"
27 class="form-control"
28 id="price"
29 name="price"
30 required
31 th:value="(${price?.getIznos()} )"
32 placeholder="Price">
33 </div>
34 <div class="form-group">
35 <label for="Description">Description</label>
36 <input type="text"
37 class="form-control"
38 id="description"
39 name="description"
40 th:value="(${product} != null ? ${product.getOpis()} : '')"
41 placeholder="Description">
42 </div>
43 <div class="form-group">
44 <label>Category</label>
45 <select name="category" class="form-control">
46 <option th:if="${chosen} != null"
47 th:selected="${chosen.getIdKategorija() != null &&
48 chosen.getIdKategorija() == cat.getIdKategorija()}"
49 th:each="cat : ${categories}"
50 th:value="${cat.getIdKategorija()}"
51 th:text="${cat.getIme()}">
52 </option>
53 <option th:if="${chosen} == null"
54 th:each="cat : ${categories}"
55 th:value="${cat.getIdKategorija()}"
56 th:text="${cat.getIme()}">
57 </option>
58 </select>
59 </div>
60 <div class="form-group">
61 <label>Date from</label>
62 <input type="date"
63 class="form-control"
64 id="date"
65 name="date"
66 th:value="${price?.getCenaOd()} ?: null"
67 required>
68 </div>
69 <div class="form-group">
70 <label>Date to</label>
71 <input type="date"
72 class="form-control"
73 id="dateTo"
74 name="dateTo"
75 th:value="${price?.getCenaDo() }">
76 </div>
77
78 <button id="submit" type="submit" class="btn btn-primary">Submit</button>
79 <a type="button" class="btn btn-primary" href="/products">Back</a>
80 </form>
81 </div>
82 </div>
83 </div>
84
85
86</th:block>
Note: See TracBrowser for help on using the repository browser.