Remove Thymeleaf's layout dialect from its starter and update samples

Closes gh-7557
pull/7744/merge
Andy Wilkinson 8 years ago
parent 9a7e5caea7
commit c00638fee3

@ -1,24 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" <html xmlns:th="http://www.thymeleaf.org">
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" <head>
layout:decorator="layout"> <title>Hello</title>
<head> </head>
<title>Hello</title> <body>
</head> <h1 th:text="${message}">Header</h1>
<body> <div class="content">
<h1 layout:fragment="header" th:text="${message}">Header</h1> <h2 th:text="${sessionVar}">Session Var</h2>
<div layout:fragment="content"> Lorem ipsum dolor sit amet,
<h2 th:text="${sessionVar}">Session Var</h2> consectetur adipiscing elit. Cras ut fringilla augue, quis dictum
Lorem ipsum dolor sit amet, turpis. Sed tincidunt mi vel euismod viverra. Nulla facilisi.
consectetur adipiscing elit. Cras ut fringilla augue, quis dictum Suspendisse mauris dolor, egestas ac leo at, porttitor ullamcorper
turpis. Sed tincidunt mi vel euismod viverra. Nulla facilisi. leo. Suspendisse consequat, justo ut rutrum interdum, nibh massa
Suspendisse mauris dolor, egestas ac leo at, porttitor ullamcorper semper dui, id sagittis tellus lectus at nibh. Etiam at scelerisque
leo. Suspendisse consequat, justo ut rutrum interdum, nibh massa nisi. Quisque vel eros tempor, fermentum sapien sed, gravida neque.
semper dui, id sagittis tellus lectus at nibh. Etiam at scelerisque Fusce interdum sed dolor a semper. Morbi porta mauris a velit laoreet
nisi. Quisque vel eros tempor, fermentum sapien sed, gravida neque. viverra. Praesent et tellus vehicula, sagittis mi quis, faucibus urna.
Fusce interdum sed dolor a semper. Morbi porta mauris a velit laoreet Ut diam tortor, vehicula eget aliquam eget, elementum a odio. Fusce at
viverra. Praesent et tellus vehicula, sagittis mi quis, faucibus urna. nisl sapien. Suspendisse potenti.
Ut diam tortor, vehicula eget aliquam eget, elementum a odio. Fusce at </div>
nisl sapien. Suspendisse potenti.</div> </body>
</body>
</html> </html>

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
<title>Layout</title>
<link rel="stylesheet" th:href="@{/css/application.css}" />
</head>
<body>
<h1 layout:fragment="header">Header</h1>
<div layout:fragment="content" class="content">Content</div>
</body>
</html>

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head (title)">
<title th:text="${title}">Fragments</title>
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"
href="../../css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div th:fragment="navbar" class="navbar">
<div class="navbar-inner">
<a class="brand" href="http://thymeleaf.org">Thymeleaf</a>
<ul class="nav">
<li><a th:href="@{/}" href="messages.html"> Messages </a></li>
</ul>
</div>
</div>
</div>
</body>
</html>

@ -1,25 +0,0 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
<title>Layout</title>
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"
href="../../css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<a class="brand"
href="https://github.com/ultraq/thymeleaf-layout-dialect">
Thymeleaf - Layout </a>
<ul class="nav">
<li><a th:href="@{/}" href="messages.html"> Messages </a></li>
</ul>
</div>
</div>
<h1 layout:fragment="header">Layout</h1>
<div layout:fragment="content">Fake content</div>
</div>
</body>
</html>

@ -1,34 +1,33 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" <html xmlns:th="http://www.thymeleaf.org">
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" <head th:replace="fragments :: head(title='Messages : Create')">
layout:decorator="layout"> <title>Messages : Create</title>
<head> </head>
<title>Messages : Create</title> <body>
</head> <div class="container">
<body> <div th:replace="fragments :: navbar"></div>
<h1 layout:fragment="header">Messages : Create</h1> <h1>Messages : Create</h1>
<div layout:fragment="content" class="container"> <form id="messageForm" th:action="@{/(form)}" th:object="${message}"
<form id="messageForm" th:action="@{/(form)}" th:object="${message}" action="#" method="post">
action="#" method="post"> <div th:if="${#fields.hasErrors('*')}" class="alert alert-error">
<div th:if="${#fields.hasErrors('*')}" class="alert alert-error"> <p th:each="error : ${#fields.errors('*')}" th:text="${error}">
<p th:each="error : ${#fields.errors('*')}" th:text="${error}"> Validation error</p>
Validation error</p> </div>
</div> <div class="pull-right">
<div class="pull-right"> <a th:href="@{/}" href="messages.html"> Messages </a>
<a th:href="@{/}" href="messages.html"> Messages </a> </div>
</div> <input type="hidden" th:field="*{id}"
<input type="hidden" th:field="*{id}" th:class="${#fields.hasErrors('id')} ? 'field-error'" /> <label
th:class="${#fields.hasErrors('id')} ? 'field-error'" /> <label for="summary">Summary</label> <input type="text"
for="summary">Summary</label> <input type="text" th:field="*{summary}"
th:field="*{summary}" th:class="${#fields.hasErrors('summary')} ? 'field-error'" /> <label
th:class="${#fields.hasErrors('summary')} ? 'field-error'" /> <label for="text">Message</label>
for="text">Message</label> <textarea th:field="*{text}"
<textarea th:field="*{text}" th:class="${#fields.hasErrors('text')} ? 'field-error'"></textarea>
th:class="${#fields.hasErrors('text')} ? 'field-error'"></textarea> <div class="form-actions">
<div class="form-actions"> <input type="submit" value="Save" />
<input type="submit" value="Save" /> </div>
</div> </form>
</form> </div>
</div> </body>
</body>
</html> </html>

@ -1,37 +1,38 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" <html xmlns:th="http://www.thymeleaf.org">
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" <head th:replace="fragments :: head(title='Messages : View all')">
layout:decorator="layout"> <title>Messages : View all</title>
<head> </head>
<title>Messages : View all</title> <body>
</head> <div class="container">
<body> <div th:replace="fragments :: navbar"></div>
<h1 layout:fragment="header">Messages : View all</h1> <h1>Messages : View all</h1>
<div layout:fragment="content" class="container"> <div class="container">
<div class="pull-right"> <div class="pull-right">
<a href="form.html" th:href="@{/(form)}">Create Message</a> <a href="form.html" th:href="@{/(form)}">Create Message</a>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<td>ID</td>
<td>Created</td>
<td>Summary</td>
</tr>
</thead>
<tbody>
<tr th:if="${messages.empty}">
<td colspan="3">No messages</td>
</tr>
<tr th:each="message : ${messages}">
<td th:text="${message.id}">1</td>
<td th:text="${#calendars.format(message.created)}">July 11,
2012 2:17:16 PM CDT</td>
<td><a href="view.html" th:href="@{'/' + ${message.id}}"
th:text="${message.summary}"> The summary </a></td>
</tr>
</tbody>
</table>
</div>
</div> </div>
<table class="table table-bordered table-striped"> </body>
<thead>
<tr>
<td>ID</td>
<td>Created</td>
<td>Summary</td>
</tr>
</thead>
<tbody>
<tr th:if="${messages.empty}">
<td colspan="3">No messages</td>
</tr>
<tr th:each="message : ${messages}">
<td th:text="${message.id}">1</td>
<td th:text="${#calendars.format(message.created)}">July 11,
2012 2:17:16 PM CDT</td>
<td><a href="view.html" th:href="@{'/' + ${message.id}}"
th:text="${message.summary}"> The summary </a></td>
</tr>
</tbody>
</table>
</div>
</body>
</html> </html>

@ -1,35 +1,33 @@
<html xmlns:th="http://www.thymeleaf.org" <!DOCTYPE html>
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" <html xmlns:th="http://www.thymeleaf.org">
layout:decorator="layout"> <head th:replace="fragments :: head(title='Messages : View')">
<head> <title>Messages : View</title>
<title>Messages : View</title> </head>
</head> <body>
<body> <div class="container">
<h1 layout:fragment="header">Messages : Create</h1> <div th:replace="fragments :: navbar"></div>
<div layout:fragment="content" class="container"> <h1>Messages : View</h1>
<div class="alert alert-success" th:if="${globalMessage}" <div class="alert alert-success" th:if="${globalMessage}"
th:text="${globalMessage}">Some Success message</div> th:text="${globalMessage}">Some Success message</div>
<div class="pull-right"> <div class="pull-right">
<a th:href="@{/}" href="list.html"> Messages </a> <a th:href="@{/}" href="list.html"> Messages </a>
</div>
<dl>
<dt>ID</dt>
<dd id="id" th:text="${message.id}">123</dd>
<dt>Date</dt>
<dd id="created" th:text="${#calendars.format(message.created)}">
July 11, 2012 2:17:16 PM CDT</dd>
<dt>Summary</dt>
<dd id="summary" th:text="${message.summary}">A short summary...</dd>
<dt>Message</dt>
<dd id="text" th:text="${message.text}">A detailed message that
is longer than the summary.</dd>
</dl>
<div class="pull-left">
<a href="messages" th:href="@{'/delete/' + ${message.id}}">delete </a> |
<a href="form.html" th:href="@{'/modify/' + ${message.id}}"> modify </a>
</div>
</div> </div>
<dl> </body>
<dt>ID</dt>
<dd id="id" th:text="${message.id}">123</dd>
<dt>Date</dt>
<dd id="created" th:text="${#calendars.format(message.created)}">
July 11, 2012 2:17:16 PM CDT</dd>
<dt>Summary</dt>
<dd id="summary" th:text="${message.summary}">A short summary...
</dd>
<dt>Message</dt>
<dd id="text" th:text="${message.text}">A detailed message that
is longer than the summary.</dd>
</dl>
<div class="pull-left">
<a href="messages" th:href="@{'/delete/' + ${message.id}}">
delete </a> | <a href="form.html"
th:href="@{'/modify/' + ${message.id}}"> modify </a>
</div>
</div>
</body>
</html> </html>

@ -30,9 +30,5 @@
<groupId>org.thymeleaf</groupId> <groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId> <artifactId>thymeleaf-spring5</artifactId>
</dependency> </dependency>
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

Loading…
Cancel
Save