Browse Source

SelectedCensusEntry Buttons

Andrew Grant 7 months ago
parent
commit
2cac7c2445

+ 7 - 0
docs/tyymeleaf.txt

@@ -0,0 +1,7 @@
+Buttons at the end of lists
+===========================
+
+<a th:action="delete" class="btn btn-danger btn-sm"
+                           th:href="@{/census/{id}/delete(id=${census.id})}"
+                           th:text="Delete"></a>
+

+ 4 - 4
src/main/resources/templates/census/list.html

@@ -35,14 +35,14 @@
                 <td th:text="${census.place}">123</td>
                 <td th:text="${census.censusDate.label}"></td>
                 <td><span>
-                        <a th:action="delete" class="btn btn-danger btn-sm" href=""
-                           th:href="'census/' + ${census.id} + '/delete'"
+                        <a th:action="delete" class="btn btn-danger btn-sm"
+                           th:href="@{/census/{id}/delete(id=${census.id})}"
                            th:text="Delete"></a>
                     <a th:action="edit" class="btn btn-warning btn-sm"
-                       th:href="'census/' + ${census.id} + '/edit'"
+                       th:href="@{/census/{id}/edit(id=${census.id})}"
                        th:text="Edit"></a>
                      <a th:action="entries" class="btn btn-info btn-sm"
-                        th:href="'selectedCensus/' + ${census.id} + '/entries'"
+                        th:href="@{/selectedCensus/{id}/entries(id=${census.id})}"
                         th:text="Entries"></a>
                     </span></td>
             </tr>

+ 3 - 3
src/main/resources/templates/selectedCensus/list.html

@@ -42,11 +42,11 @@
                 <td th:text="${entry.toString()}">123</td>
 
                 <td><span>
-                        <a th:action="delete" class="btn btn-danger btn-sm" href=""
-                           th:href="'censusEntry/' + ${entry.id} + '/delete'"
+                        <a th:action="delete" class="btn btn-danger btn-sm"
+                           th:href="@{/censusEntry/{id}/delete(id=${entry.id})}"
                            th:text="Delete"></a>
                     <a th:action="edit" class="btn btn-warning btn-sm"
-                       th:href="'censusEntry/' + ${entry.id} + '/edit'"
+                       th:href="@{/censusEntry/{id}/edit(id=${entry.id})}"
                        th:text="Edit"></a>
                     </span></td>
             </tr>