浏览代码

Lists controller Edit and Delete links for places, regions and countries (2)

Andrew Grant 6 月之前
父节点
当前提交
31f501088d

+ 5 - 4
src/main/resources/templates/country/list.html

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

+ 5 - 4
src/main/resources/templates/place/list.html

@@ -40,12 +40,13 @@
                 <td th:text="${place.region != null} ? ${place.region.name}"></td>
                 <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="@{/region/{id}/delete(id=${region.id})}"
-                        th:text="Delete"></a>
-                    <a> th:action="edit" class="btn btn-warning btn-sm" href =""
+                        <a th:action="delete" class="btn btn-danger btn-sm"
+                           th:href="@{/place/{id}/delete(id=${place.id})}"
+                           th:text="Delete"></a>
+                    <a th:action="edit" class="btn btn-warning btn-sm"
                        th:href="@{/place/{id}/edit(id=${place.id})}"
                        th:text="Edit"></a>
+
                     </span></td>
             </tr>
             <tfoot>

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

@@ -34,12 +34,13 @@
                 <td th:text="${region.name}"> First</td>
                 <td th:text="${region.country.name}"></td>
                 <td><span>
-                        <a th:action="delete" class="btn btn-danger btn-sm" href=""
+                        <a th:action="delete" class="btn btn-danger btn-sm"
                            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/{id}/edit(id=${region.id})}"
                        th:text="Edit"></a>
+
                     </span></td>
             </tr>
             <tfoot>