Skip to content

Conversation

@Riggs333
Copy link

@Riggs333 Riggs333 commented Jan 5, 2023

No description provided.

- fix Thymeleaf deprecation warning regarding fragment reference
- remove obsolete (?) th:block element
- simplify boolean expression in th:if (remove '== true')
- move form element for editing team to fragment
- put attributes on separate lines
<th:block th:if="${team.editMode == false}">
<div th:insert="fragments :: showTeam" th:remove="tag"/>
</th:block>
<div th:if="${team.editMode}" th:insert="~{fragments :: editTeam}" th:remove="tag"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hattest du das ausprobiert? Ich habe (irgendwo bei SO) gelesen, dass aus Gründen ein insert eine höhere Präzedenz als ein if hat. 🤷

<div th:fragment="soccer-table" th:remove="tag">

<div th:insert="fragments :: position(${team})" th:each="team : ${soccerTable.positions}" th:remove="tag">
<div th:insert="~{fragments :: position(${team})}" th:each="team : ${soccerTable.positions}" th:remove="tag">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Tilde! Was tut das?

<form id="soccer-table"
class="soccer-table sortable"
hx-post="/soccerTable"
hx-trigger="end"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jo! Nice!
Gibt es prettier drüben bei euch? Ok Fangfrage! 😁

<div th:fragment="editTeam" th:remove="tag">
<input name='teamName' th:value="${team.name}" form="edit-soccer-table"/>
<input type='hidden' name='teamId' th:value="${team.id}" form="edit-soccer-table"/>
<form id="edit-soccer-table" hx-post="/saveSingleTeam" hx-swap="innerHTML" hx-target="#soccer-table">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dann habe ich doch nested Forms, oder? Das wollte ich verhindern mit dem Auslagern nach oben.

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("io.github.wimdeblauwe:htmx-spring-boot-thymeleaf:2.0.0")
implementation("org.springframework.boot:spring-boot-devtools")
developmentOnly("org.springframework.boot:spring-boot-devtools")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Ich hatte doch schon die Dev-Tools! Oder muss ich da noch mehr machen? Erkennt intellij das automatisch? Oder macht Gradle da was?

(Das hatte bei mir bislang keinen merkbaren Einfluss)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants