Skip to content

Commit 9de7eb7

Browse files
author
Max Bruchmann
committed
added data dialect to thymeleaf starter dependency
added data dialect usage to spring-boot-sample-web-ui project
1 parent dfcb6d1 commit 9de7eb7

File tree

4 files changed

+9
-3
lines changed
  • spring-boot-samples/spring-boot-sample-web-ui/src/main/resources/templates/messages
  • spring-boot-starters/spring-boot-starter-thymeleaf

4 files changed

+9
-3
lines changed

spring-boot-samples/spring-boot-sample-web-ui/src/main/resources/templates/messages/list.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!DOCTYPE html>
22
<html xmlns:th="http://www.thymeleaf.org"
33
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
4+
xmlns:data="https://github.com/mxab/thymeleaf-extras-data-attribute"
45
layout:decorator="layout">
56
<head>
67
<title>Messages : View all</title>
@@ -27,7 +28,7 @@ <h1 layout:fragment="header">Messages : View all</h1>
2728
</tr>
2829
<tr th:each="message : ${messages}">
2930
<td th:text="${message.id}">1</td>
30-
<td th:text="${#calendars.format(message.created)}">
31+
<td th:text="${#calendars.format(message.created)}" data:created="${message.created.timeInMillis}">
3132
July 11, 2012 2:17:16 PM CDT
3233
</td>
3334
<td>

spring-boot-samples/spring-boot-sample-web-ui/src/main/resources/templates/messages/view.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<html xmlns:th="http://www.thymeleaf.org"
22
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
3+
xmlns:data="https://github.com/mxab/thymeleaf-extras-data-attribute"
34
layout:decorator="layout">
45
<head>
56
<title>Messages : View</title>
@@ -22,7 +23,7 @@ <h1 layout:fragment="header">Messages : Create</h1>
2223
<dt>ID</dt>
2324
<dd id="id" th:text="${message.id}">123</dd>
2425
<dt>Date</dt>
25-
<dd id="created"
26+
<dd id="created" data:created="${message.created.timeInMillis}"
2627
th:text="${#calendars.format(message.created)}">
2728
July 11, 2012 2:17:16 PM CDT
2829
</dd>

spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,9 @@
4444
<groupId>nz.net.ultraq.thymeleaf</groupId>
4545
<artifactId>thymeleaf-layout-dialect</artifactId>
4646
</dependency>
47+
<dependency>
48+
<groupId>com.github.mxab.thymeleaf.extras</groupId>
49+
<artifactId>thymeleaf-extras-data-attribute</artifactId>
50+
</dependency>
4751
</dependencies>
4852
</project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
provides: thymeleaf-spring4,thymeleaf-layout-dialect
1+
provides: thymeleaf-spring4,thymeleaf-layout-dialect,thymeleaf-extras-data-attribute

0 commit comments

Comments
 (0)