Format HTML in web-ui sample
This commit is contained in:
parent
2f84cdc79f
commit
7f8aff0231
|
|
@ -1,32 +1,25 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
|
<html xmlns:th="http://www.thymeleaf.org"
|
||||||
<head>
|
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
|
||||||
<title>Layout</title>
|
<head>
|
||||||
<link rel="stylesheet"
|
<title>Layout</title>
|
||||||
th:href="@{/css/bootstrap.min.css}"
|
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"
|
||||||
href="../../css/bootstrap.min.css"/>
|
href="../../css/bootstrap.min.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<a class="brand"
|
<a class="brand"
|
||||||
href="https://github.com/ultraq/thymeleaf-layout-dialect">
|
href="https://github.com/ultraq/thymeleaf-layout-dialect">
|
||||||
Thymeleaf - Layout
|
Thymeleaf - Layout </a>
|
||||||
</a>
|
<ul class="nav">
|
||||||
<ul class="nav">
|
<li><a th:href="@{/}" href="messages.html"> Messages </a></li>
|
||||||
<li>
|
</ul>
|
||||||
<a th:href="@{/}" href="messages.html">
|
</div>
|
||||||
Messages
|
</div>
|
||||||
</a>
|
<h1 layout:fragment="header">Layout</h1>
|
||||||
</li>
|
<div layout:fragment="content">Fake content</div>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
</body>
|
||||||
</div>
|
|
||||||
<h1 layout:fragment="header">Layout</h1>
|
|
||||||
<div layout:fragment="content">
|
|
||||||
Fake content
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,47 +1,34 @@
|
||||||
<!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"
|
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
|
||||||
layout:decorator="layout">
|
layout:decorator="layout">
|
||||||
<head>
|
<head>
|
||||||
<title>Messages : Create</title>
|
<title>Messages : Create</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 layout:fragment="header">Messages : Create</h1>
|
<h1 layout:fragment="header">Messages : Create</h1>
|
||||||
<div layout:fragment="content"
|
<div layout:fragment="content" class="container">
|
||||||
class="container">
|
<form id="messageForm" th:action="@{/(form)}" th:object="${message}"
|
||||||
<form id="messageForm"
|
action="#" method="post">
|
||||||
th:action="@{/(form)}"
|
<div th:if="${#fields.hasErrors('*')}" class="alert alert-error">
|
||||||
th:object="${message}"
|
<p th:each="error : ${#fields.errors('*')}" th:text="${error}">
|
||||||
action="#"
|
Validation error</p>
|
||||||
method="post">
|
</div>
|
||||||
<div th:if="${#fields.hasErrors('*')}"
|
<div class="pull-right">
|
||||||
class="alert alert-error">
|
<a th:href="@{/}" href="messages.html"> Messages </a>
|
||||||
<p th:each="error : ${#fields.errors('*')}"
|
</div>
|
||||||
th:text="${error}">
|
<input type="hidden" th:field="*{id}"
|
||||||
Validation error
|
th:class="${#fields.hasErrors('id')} ? 'field-error'" /> <label
|
||||||
</p>
|
for="summary">Summary</label> <input type="text"
|
||||||
</div>
|
th:field="*{summary}"
|
||||||
<div class="pull-right">
|
th:class="${#fields.hasErrors('summary')} ? 'field-error'" /> <label
|
||||||
<a th:href="@{/}" href="messages.html">
|
for="text">Message</label>
|
||||||
Messages
|
<textarea th:field="*{text}"
|
||||||
</a>
|
th:class="${#fields.hasErrors('text')} ? 'field-error'"></textarea>
|
||||||
</div>
|
<div class="form-actions">
|
||||||
<input type="hidden"
|
<input type="submit" value="Save" />
|
||||||
th:field="*{id}"
|
</div>
|
||||||
th:class="${#fields.hasErrors('id')} ? 'field-error'"
|
</form>
|
||||||
/>
|
</div>
|
||||||
<label for="summary">Summary</label>
|
</body>
|
||||||
<input type="text"
|
</html>
|
||||||
th:field="*{summary}"
|
|
||||||
th:class="${#fields.hasErrors('summary')} ? 'field-error'"/>
|
|
||||||
<label for="text">Message</label>
|
|
||||||
<textarea
|
|
||||||
th:field="*{text}"
|
|
||||||
th:class="${#fields.hasErrors('text')} ? 'field-error'"></textarea>
|
|
||||||
<div class="form-actions">
|
|
||||||
<input type="submit" value="Save"/>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,37 @@
|
||||||
<!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"
|
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
|
||||||
layout:decorator="layout">
|
layout:decorator="layout">
|
||||||
<head>
|
<head>
|
||||||
<title>Messages : View all</title>
|
<title>Messages : View all</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 layout:fragment="header">Messages : View all</h1>
|
<h1 layout:fragment="header">Messages : View all</h1>
|
||||||
<div layout:fragment="content" class="container">
|
<div layout:fragment="content" 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>
|
||||||
<table class="table table-bordered table-striped">
|
<table class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>ID</td>
|
<td>ID</td>
|
||||||
<td>Created</td>
|
<td>Created</td>
|
||||||
<td>Summary</td>
|
<td>Summary</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:if="${messages.empty}">
|
<tr th:if="${messages.empty}">
|
||||||
<td colspan="3">
|
<td colspan="3">No messages</td>
|
||||||
No messages
|
</tr>
|
||||||
</td>
|
<tr th:each="message : ${messages}">
|
||||||
</tr>
|
<td th:text="${message.id}">1</td>
|
||||||
<tr th:each="message : ${messages}">
|
<td th:text="${#calendars.format(message.created)}">July 11,
|
||||||
<td th:text="${message.id}">1</td>
|
2012 2:17:16 PM CDT</td>
|
||||||
<td th:text="${#calendars.format(message.created)}">
|
<td><a href="view.html" th:href="@{'/' + ${message.id}}"
|
||||||
July 11, 2012 2:17:16 PM CDT
|
th:text="${message.summary}"> The summary </a></td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
</tbody>
|
||||||
<a href="view.html"
|
</table>
|
||||||
th:href="@{'/' + ${message.id}}"
|
</div>
|
||||||
th:text="${message.summary}">
|
</body>
|
||||||
The summary
|
</html>
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,35 @@
|
||||||
<html xmlns:th="http://www.thymeleaf.org"
|
<html xmlns:th="http://www.thymeleaf.org"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
|
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
|
||||||
layout:decorator="layout">
|
layout:decorator="layout">
|
||||||
<head>
|
<head>
|
||||||
<title>Messages : View</title>
|
<title>Messages : View</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 layout:fragment="header">Messages : Create</h1>
|
<h1 layout:fragment="header">Messages : Create</h1>
|
||||||
<div layout:fragment="content"
|
<div layout:fragment="content" class="container">
|
||||||
class="container">
|
<div class="alert alert-success" th:if="${globalMessage}"
|
||||||
<div class="alert alert-success"
|
th:text="${globalMessage}">Some Success message</div>
|
||||||
th:if="${globalMessage}"
|
<div class="pull-right">
|
||||||
th:text="${globalMessage}">
|
<a th:href="@{/}" href="list.html"> Messages </a>
|
||||||
Some Success message
|
</div>
|
||||||
</div>
|
<dl>
|
||||||
<div class="pull-right">
|
<dt>ID</dt>
|
||||||
<a th:href="@{/}" href="list.html">
|
<dd id="id" th:text="${message.id}">123</dd>
|
||||||
Messages
|
<dt>Date</dt>
|
||||||
</a>
|
<dd id="created" th:text="${#calendars.format(message.created)}">
|
||||||
</div>
|
July 11, 2012 2:17:16 PM CDT</dd>
|
||||||
<dl>
|
<dt>Summary</dt>
|
||||||
<dt>ID</dt>
|
<dd id="summary" th:text="${message.summary}">A short summary...
|
||||||
<dd id="id" th:text="${message.id}">123</dd>
|
</dd>
|
||||||
<dt>Date</dt>
|
<dt>Message</dt>
|
||||||
<dd id="created"
|
<dd id="text" th:text="${message.text}">A detailed message that
|
||||||
th:text="${#calendars.format(message.created)}">
|
is longer than the summary.</dd>
|
||||||
July 11, 2012 2:17:16 PM CDT
|
</dl>
|
||||||
</dd>
|
<div class="pull-left">
|
||||||
<dt>Summary</dt>
|
<a href="messages" th:href="@{'/delete/' + ${message.id}}">
|
||||||
<dd id="summary"
|
delete </a> | <a href="form.html"
|
||||||
th:text="${message.summary}">
|
th:href="@{'/modify/' + ${message.id}}"> modify </a>
|
||||||
A short summary...
|
</div>
|
||||||
</dd>
|
</div>
|
||||||
<dt>Message</dt>
|
</body>
|
||||||
<dd id="text"
|
</html>
|
||||||
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>
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue