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,13 +1,11 @@
<!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>
<div layout:fragment="content">
<h2 th:text="${sessionVar}">Session Var</h2> <h2 th:text="${sessionVar}">Session Var</h2>
Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Cras ut fringilla augue, quis dictum consectetur adipiscing elit. Cras ut fringilla augue, quis dictum
@ -19,6 +17,7 @@
Fusce interdum sed dolor a semper. Morbi porta mauris a velit laoreet Fusce interdum sed dolor a semper. Morbi porta mauris a velit laoreet
viverra. Praesent et tellus vehicula, sagittis mi quis, faucibus urna. viverra. Praesent et tellus vehicula, sagittis mi quis, faucibus urna.
Ut diam tortor, vehicula eget aliquam eget, elementum a odio. Fusce at Ut diam tortor, vehicula eget aliquam eget, elementum a odio. Fusce at
nisl sapien. Suspendisse potenti.</div> nisl sapien. Suspendisse potenti.
</body> </div>
</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,13 +1,12 @@
<!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">
@ -30,5 +29,5 @@
</div> </div>
</form> </form>
</div> </div>
</body> </body>
</html> </html>

@ -1,13 +1,13 @@
<!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> </div>
@ -33,5 +33,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</body> </div>
</body>
</html> </html>

@ -1,12 +1,12 @@
<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">
@ -19,17 +19,15 @@
<dd id="created" th:text="${#calendars.format(message.created)}"> <dd id="created" th:text="${#calendars.format(message.created)}">
July 11, 2012 2:17:16 PM CDT</dd> July 11, 2012 2:17:16 PM CDT</dd>
<dt>Summary</dt> <dt>Summary</dt>
<dd id="summary" th:text="${message.summary}">A short summary... <dd id="summary" th:text="${message.summary}">A short summary...</dd>
</dd>
<dt>Message</dt> <dt>Message</dt>
<dd id="text" th:text="${message.text}">A detailed message that <dd id="text" th:text="${message.text}">A detailed message that
is longer than the summary.</dd> is longer than the summary.</dd>
</dl> </dl>
<div class="pull-left"> <div class="pull-left">
<a href="messages" th:href="@{'/delete/' + ${message.id}}"> <a href="messages" th:href="@{'/delete/' + ${message.id}}">delete </a> |
delete </a> | <a href="form.html" <a href="form.html" th:href="@{'/modify/' + ${message.id}}"> modify </a>
th:href="@{'/modify/' + ${message.id}}"> modify </a>
</div> </div>
</div> </div>
</body> </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