Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace th:attr with hx:get #8

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/resources/templates/fragments/owners.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2>Owners</h2>
<tr th:each="owner : ${listOwners}">
<td>
<a th:href="@{/owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}"
th:attr="hx-get=@{/owners/__${owner.id}__}" hx-target="#block-content"/></a>
hx:get="@{/owners/__${owner.id}__}" hx-target="#block-content"/></a>
</td>
<td th:text="${owner.address}"/>
<td th:text="${owner.city}"/>
Expand Down Expand Up @@ -83,10 +83,10 @@ <h2>Owner Information</h2>
</tr>
</table>

<a th:attr="hx-get=@{__${owner.id}__/edit}" hx-target="#block-content" th:href="@{__${owner.id}__/edit}"
<a hx:get="@{__${owner.id}__/edit}" hx-target="#block-content" th:href="@{__${owner.id}__/edit}"
class="btn btn-primary">Edit
Owner</a>
<a th:attr="hx-get=@{__${owner.id}__/pets/new}" th:href="@{__${owner.id}__/pets/new}" hx-target="#block-content" class="btn btn-primary">Add
<a hx:get="@{__${owner.id}__/pets/new}" th:href="@{__${owner.id}__/pets/new}" hx-target="#block-content" class="btn btn-primary">Add
New Pet</a>
</div>

Expand Down Expand Up @@ -122,9 +122,9 @@ <h2>Pets and Visits</h2>
</tr>
<tr>
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/edit}"
th:attr="hx-get=@{__${owner.id}__/pets/__${pet.id}__/edit}" hx-target="#block-content">Edit Pet</a></td>
hx-get="@{__${owner.id}__/pets/__${pet.id}__/edit}" hx-target="#block-content">Edit Pet</a></td>
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/visits/new}"
th:attr="hx-get=@{__${owner.id}__/pets/__${pet.id}__/visits/new}" hx-target="#block-content">Add Visit</a></td>
hx:get="@{__${owner.id}__/pets/__${pet.id}__/visits/new}" hx-target="#block-content">Add Visit</a></td>
</tr>
</table>
</td>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/fragments/pagination.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<span th:fragment="item(url,page,condition)" th:tag="remove">
<a th:if="${condition}" th:attr="hx-get=@{${url} + '?page=' + ${page}}" th:href="@{'/owners?page=' + ${page}}" hx-target="#block-content">[[${page}]]</a>
<a th:if="${condition}" hx:get="@{${url}(page=${page})}" th:href="@{${url}(page=${page})}" hx-target="#block-content">[[${page}]]</a>
<span th:unless="${condition}">[[${page}]]</span>
</span>

<span th:fragment="control(url, page,condition,title,class)" th:tag="remove">
<a th:if="${condition}" th:attr="hx-get=@{${url} + '?page=' + ${page}}" th:href="@{'/owners?page=' + ${page}}" hx-target="#block-content" th:title="${title}" th:class="${class}"></a>
<a th:if="${condition}" hx:get="@{${url}(page=${page})}" th:href="@{${url}(page=${page})}" hx-target="#block-content" th:title="${title}" th:class="${class}"></a>
<span th:unless="${condition}" th:title="${title}" th:class="${class}"></span>
</span>

Expand Down
Loading