Browse Source

Lists controller Edit and Delete links for places, regions and countries

Andrew Grant 6 months ago
parent
commit
69bac8da42

+ 2 - 2
src/main/resources/templates/country/list.html

@@ -36,8 +36,8 @@
                         <a th:action="delete" class="btn btn-danger btn-sm" href=""
                            th:href="'country/' + ${country.id} + '/delete'"
                            th:text="Delete"></a>
-                    <a th:action="edit" class="btn btn-warning btn-sm"
-                       th:href="'country/' + ${country.id} + '/edit'"
+                     <a> th:action="edit" class="btn btn-warning btn-sm" href =""
+                       th:href="@{/place/{id}/edit(id=${country.id})}"
                        th:text="Edit"></a>
                     </span></td>
             </tr>

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

@@ -41,10 +41,10 @@
                 <td th:text="${place.region.country != null} ? ${place.region.country.name}"></td>
                 <td><span>
                      <a th:action="delete" class="btn btn-danger btn-sm" href=""
-                        th:href="'place/' + ${place.id} + '/delete'"
+                        th:href="@{/region/{id}/delete(id=${region.id})}"
                         th:text="Delete"></a>
-                    <a th:action="edit" class="btn btn-warning btn-sm"
-                       th:href="'place/' + ${place.id} + '/edit'"
+                    <a> th:action="edit" class="btn btn-warning btn-sm" href =""
+                       th:href="@{/place/{id}/edit(id=${place.id})}"
                        th:text="Edit"></a>
                     </span></td>
             </tr>

+ 2 - 2
src/main/resources/templates/region/list.html

@@ -35,10 +35,10 @@
                 <td th:text="${region.country.name}"></td>
                 <td><span>
                         <a th:action="delete" class="btn btn-danger btn-sm" href=""
-                           th:href="'region/' + ${region.id} + '/delete'"
+                           th:href="@{/region/{id}/delete(id=${region.id})}"
                            th:text="Delete"></a>
                     <a th:action="edit" class="btn btn-warning btn-sm"
-                       th:href="'region/' + ${region.id} + '/edit'"
+                       th:href="@{/region/{id}/edit(id=${region.id})}"
                        th:text="Edit"></a>
                     </span></td>
             </tr>