1 | <!-- Modal for adding documents -->
|
---|
2 | <div class="modal fade" id="addDocumentModal" tabindex="-1" aria-labelledby="addDocumentModalLabel" aria-hidden="true">
|
---|
3 | <div class="modal-dialog">
|
---|
4 | <div class="modal-content">
|
---|
5 | <div class="modal-header">
|
---|
6 | <h5 class="modal-title" id="addDocumentModalLabel">Додади документ</h5>
|
---|
7 | <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
---|
8 | </div>
|
---|
9 | <form id="documentForm" action="/admin/documents" method="post">
|
---|
10 | <div class="modal-body">
|
---|
11 |
|
---|
12 | <div class="mb-3">
|
---|
13 | <label for="documentNumber" class="form-label">Број на лична карта</label>
|
---|
14 | <input type="text" class="form-control" id="documentNumber" name="documentNumber">
|
---|
15 | </div>
|
---|
16 | <div class="mb-3">
|
---|
17 | <label for="validFrom" class="form-label">Важи од:</label>
|
---|
18 | <input type="date" class="form-control" id="validFrom" name="issueDate">
|
---|
19 | </div>
|
---|
20 | <div class="mb-3">
|
---|
21 | <label for="validTo" class="form-label">Важи до:</label>
|
---|
22 | <input type="date" class="form-control" id="validTo" name="expiryDate">
|
---|
23 | </div>
|
---|
24 | <div class="mb-3">
|
---|
25 | <label for="validTo" class="form-label">Издавач:</label>
|
---|
26 | <input type="text" class="form-control" id="issuer" name="issuer">
|
---|
27 | </div>
|
---|
28 | <input type="hidden" id="citizenId" name="citizenId">
|
---|
29 | <input type="hidden" id="documentId" name="documentId">
|
---|
30 |
|
---|
31 | </div>
|
---|
32 | <div class="modal-footer">
|
---|
33 | <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Назад</button>
|
---|
34 | <button type="submit" class="btn btn-primary">Зачувај</button>
|
---|
35 | </div>
|
---|
36 | </form>
|
---|
37 | </div>
|
---|
38 | </div>
|
---|
39 | </div>
|
---|
40 |
|
---|
41 | <nav class="navbar bg-secondary bg-gradient container-fluid px-0">
|
---|
42 | <div class="container-fluid">
|
---|
43 | <span class="navbar-brand mb-0 h1">Податоци за гласачите - избирачки список</span>
|
---|
44 | </div>
|
---|
45 | </nav>
|
---|
46 |
|
---|
47 | <div class="container-fluid">
|
---|
48 | <div class="container my-3">
|
---|
49 | <form th:object="${citizen}" action="/admin/citizens" method="post">
|
---|
50 | <input type="hidden" th:field="*{id}">
|
---|
51 | <div class="mb-3">
|
---|
52 | <label for="name" class="form-label">Име</label>
|
---|
53 | <input type="text" th:field="*{name}" class="form-control" id="name" aria-describedby="emailHelp">
|
---|
54 | </div>
|
---|
55 | <div class="mb-3">
|
---|
56 | <label for="surname" class="form-label">Презиме</label>
|
---|
57 | <input type="text" th:field="*{surname}" class="form-control" id="surname" aria-describedby="emailHelp">
|
---|
58 | </div>
|
---|
59 | <div class="mb-3">
|
---|
60 | <label for="dateOfBirth" class="form-label">Датум на раѓање</label>
|
---|
61 | <input type="date" th:field="*{dateOfBirth}" class="form-control" id="dateOfBirth"
|
---|
62 | aria-describedby="emailHelp">
|
---|
63 | </div>
|
---|
64 | <div class="mb-3">
|
---|
65 | <label for="idNum" class="form-label">ЕМБГ</label>
|
---|
66 | <input type="text" th:field="*{idNum}" class="form-control" id="idNum" aria-describedby="emailHelp">
|
---|
67 | </div>
|
---|
68 | <div class="row d-flex flex-row mb-3">
|
---|
69 | <label class="form-label">Адреса</label>
|
---|
70 | <div class="col col-md-6">
|
---|
71 | <label class="form-label">Улица</label>
|
---|
72 | <input list="streets" class="form-select" id="street" th:value="*{address?.street}" name="street">
|
---|
73 | <datalist id="streets">
|
---|
74 | <option th:each="street : ${streets}" th:value="${street}"></option>
|
---|
75 | </datalist>
|
---|
76 | </div>
|
---|
77 | <div class="col col-md-2">
|
---|
78 | <label class="form-label">Број</label>
|
---|
79 | <input type="number" min="1" class="form-control" id="houseNumber"
|
---|
80 | th:value="*{address?.houseNumber}" name="houseNumber">
|
---|
81 | </div>
|
---|
82 | <div class="col col-md-2">
|
---|
83 | <label class="form-label">Влез</label>
|
---|
84 | <input type="text" min="1" class="form-control" id="entranceNumber"
|
---|
85 | th:value="*{address?.entranceNumber}" name="entranceNumber">
|
---|
86 | </div>
|
---|
87 | <div class="col col-md-2">
|
---|
88 | <label class="form-label">Стан</label>
|
---|
89 | <input type="text" min="1" class="form-control" id="apartmentNumber"
|
---|
90 | th:value="*{address?.apartmentNumber}" name="apartmentNumber">
|
---|
91 | </div>
|
---|
92 | </div>
|
---|
93 | <div class="mb-3">
|
---|
94 | <label class="form-label">Општина</label>
|
---|
95 | <select class="form-control" id="municipality" th:value="*{address?.municipality}" name="municipality">
|
---|
96 | <option th:each="municipality : ${municipalities}" th:value="${municipality.id}"
|
---|
97 | th:text="${municipality.name}"></option>
|
---|
98 | </select>
|
---|
99 | </div>
|
---|
100 | <button type="submit" class="btn btn-primary">Запиши</button>
|
---|
101 | </form>
|
---|
102 | </div>
|
---|
103 | <div class="container my-3">
|
---|
104 | <form th:object="${citizen}" action="/admin/citizens" method="post">
|
---|
105 | <input type="hidden" th:field="*{id}">
|
---|
106 | </form>
|
---|
107 | </div>
|
---|
108 |
|
---|
109 | <div class="container-fluid">
|
---|
110 | <table class="table table-striped table-hover">
|
---|
111 | <thead class="table-header">
|
---|
112 | <tr>
|
---|
113 | <th>#</th>
|
---|
114 | <th>Име</th>
|
---|
115 | <th>Презиме</th>
|
---|
116 | <th>Датум на раѓање</th>
|
---|
117 | <th>ЕМБГ</th>
|
---|
118 | <th>Улица</th>
|
---|
119 | <th>Број</th>
|
---|
120 | <th>Влез</th>
|
---|
121 | <th>Стан</th>
|
---|
122 | <th>Општина</th>
|
---|
123 | <th>Број на лична карта</th>
|
---|
124 | <th>Важи од</th>
|
---|
125 | <th>Важи до</th>
|
---|
126 | <th colspan="2">Акции</th>
|
---|
127 | </tr>
|
---|
128 | </thead>
|
---|
129 | <tbody>
|
---|
130 | <tr class="citizen-row" th:onclick="|window.location.href='/admin/citizens/${citizen.id}/edit';|"
|
---|
131 | th:each="citizen, iter : ${citizens}"
|
---|
132 | th:class="${citizen.type().equals('candidate') ? 'table-danger' : citizen.type().equals('committee') ? 'table-info' : ''}">
|
---|
133 | <td th:text="${iter.count}"></td>
|
---|
134 | <td th:text="${citizen.name}"></td>
|
---|
135 | <td th:text="${citizen.surname}"></td>
|
---|
136 | <td th:text="${citizen.dateOfBirth}"></td>
|
---|
137 | <td th:text="${citizen.idNum}"></td>
|
---|
138 | <td th:text="${citizen?.address?.street}"></td>
|
---|
139 | <td th:text="${citizen?.address?.houseNumber}"></td>
|
---|
140 | <td th:text="${citizen?.address?.entranceNumber}"></td>
|
---|
141 | <td th:text="${citizen?.address?.apartmentNumber}"></td>
|
---|
142 | <td th:text="${citizen?.address?.municipality?.name}"></td>
|
---|
143 | <td th:text="${citizen?.document?.documentNumber}"></td>
|
---|
144 | <td th:text="${citizen?.document?.issueDate}"></td>
|
---|
145 | <td th:text="${citizen?.document?.expiryDate}"></td>
|
---|
146 | <td>
|
---|
147 | <a href="#" class="add-document-link btn btn-success" data-bs-toggle="modal"
|
---|
148 | data-bs-target="#addDocumentModal"
|
---|
149 | th:data-citizen-id="${citizen.id}" th:data-document-number="${citizen?.document?.documentNumber}"
|
---|
150 | th:data-valid-from="${citizen?.document?.issueDate}"
|
---|
151 | th:data-valid-to="${citizen?.document?.expiryDate}"
|
---|
152 | th:data-issuer="${citizen?.document?.issuer}"
|
---|
153 | th:data-document-id="${citizen?.document?.id}">
|
---|
154 | Документ
|
---|
155 | </a>
|
---|
156 | </td>
|
---|
157 | <td>
|
---|
158 | <a th:href="${'/admin/citizens/' + citizen.id + '/candidate'}"
|
---|
159 | class="add-document-link btn btn-danger">
|
---|
160 | Кандидат
|
---|
161 | </a>
|
---|
162 | </td>
|
---|
163 | <td>
|
---|
164 | <a th:href="${'/admin/citizens/' + citizen.id + '/committee'}"
|
---|
165 | class="add-document-link btn btn-info">
|
---|
166 | Комисија
|
---|
167 | </a>
|
---|
168 | </td>
|
---|
169 | </tr>
|
---|
170 | </tbody>
|
---|
171 | </table>
|
---|
172 | </div>
|
---|
173 |
|
---|
174 | </div>
|
---|
175 | <script>
|
---|
176 | $(document).ready(function () {
|
---|
177 | $('.add-document-link').on('click', function (e) {
|
---|
178 | e.stopPropagation();
|
---|
179 | var citizenId = $(this).data('citizen-id');
|
---|
180 | var documentNumber = $(this).data('document-number');
|
---|
181 | var validFrom = $(this).data('valid-from');
|
---|
182 | var validTo = $(this).data('valid-to');
|
---|
183 | var issuer = $(this).data('issuer');
|
---|
184 | var documentId = $(this).data('document-id');
|
---|
185 |
|
---|
186 | $('#citizenId').val(citizenId);
|
---|
187 | $('#documentNumber').val(documentNumber);
|
---|
188 | $('#validFrom').val(validFrom);
|
---|
189 | $('#validTo').val(validTo);
|
---|
190 | $('#issuer').val(issuer);
|
---|
191 | $('#documentId').val(documentId);
|
---|
192 | });
|
---|
193 | });
|
---|
194 | </script>
|
---|