Browse Source

Web forms: use Spring env properties for page URLs; add footer fragment

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
a91d1a61c3
4 changed files with 75 additions and 9 deletions
  1. +18
    -1
      bookstore/src/main/resources/templates/bookadd.html
  2. +19
    -2
      bookstore/src/main/resources/templates/bookedit.html
  3. +20
    -4
      bookstore/src/main/resources/templates/booklist.html
  4. +18
    -2
      bookstore/src/main/resources/templates/fragments/devusers.html

+ 18
- 1
bookstore/src/main/resources/templates/bookadd.html View File

@ -11,7 +11,23 @@
</title>
</head>
<body>
<!--/* TODO: use proper and scalable fragment HTML replacement for this element */-->
<body th:with="
indexpage = ${@environment.getProperty('page.url.index')},
listpage = ${@environment.getProperty('page.url.list')},
addpage = ${@environment.getProperty('page.url.add')},
deletepage = ${@environment.getProperty('page.url.delete')},
editpage = ${@environment.getProperty('page.url.edit')},
loginpage = ${@environment.getProperty('page.url.login')},
logoutpage = ${@environment.getProperty('page.url.logout')},
apirefpage = ${@environment.getProperty('page.url.apiref')},
jsonpage = ${@environment.getProperty('page.url.json')},
jsonbookpage = ${@environment.getProperty('page.url.json.book')},
jsonlistpage = ${@environment.getProperty('page.url.json.list')},
h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
">
<div style="display: flex;">
<div class="col-md-4 mb-3">
@ -39,5 +55,6 @@
</div>
<th:block th:replace="fragments/loginout :: loginout"/>
</div>
<th:block th:insert="fragments/footerpart :: footerpart"/>
</body>
</html>

+ 19
- 2
bookstore/src/main/resources/templates/bookedit.html View File

@ -11,7 +11,23 @@
</title>
</head>
<body>
<!--/* TODO: use proper and scalable fragment HTML replacement for this element */-->
<body th:with="
indexpage = ${@environment.getProperty('page.url.index')},
listpage = ${@environment.getProperty('page.url.list')},
addpage = ${@environment.getProperty('page.url.add')},
deletepage = ${@environment.getProperty('page.url.delete')},
editpage = ${@environment.getProperty('page.url.edit')},
loginpage = ${@environment.getProperty('page.url.login')},
logoutpage = ${@environment.getProperty('page.url.logout')},
apirefpage = ${@environment.getProperty('page.url.apiref')},
jsonpage = ${@environment.getProperty('page.url.json')},
jsonbookpage = ${@environment.getProperty('page.url.json.book')},
jsonlistpage = ${@environment.getProperty('page.url.json.list')},
h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
">
<div style="display:flex;">
<div class="col-md-4 mb-3">
@ -32,7 +48,7 @@
<br>
<a class="btn btn-success" th:href="@{/__${listpage}__}"
<a class="btn btn-success" th:href="@{__${listpage}__}"
th:text="${#messages.msgOrNull('button.page.list.return')} ?: 'button.page.list.return'">
button.page.list.return
</a>
@ -40,5 +56,6 @@
</div>
<th:block th:replace="fragments/loginout :: loginout"/>
</div>
<th:block th:insert="fragments/footerpart :: footerpart"/>
</body>
</html>

+ 20
- 4
bookstore/src/main/resources/templates/booklist.html View File

@ -47,7 +47,23 @@ Idea of the following syntax used in this and other HTML document:
</title>
</head>
<body>
<!--/* TODO: use proper and scalable fragment HTML replacement for this element */-->
<body th:with="
indexpage = ${@environment.getProperty('page.url.index')},
listpage = ${@environment.getProperty('page.url.list')},
addpage = ${@environment.getProperty('page.url.add')},
deletepage = ${@environment.getProperty('page.url.delete')},
editpage = ${@environment.getProperty('page.url.edit')},
loginpage = ${@environment.getProperty('page.url.login')},
logoutpage = ${@environment.getProperty('page.url.logout')},
apirefpage = ${@environment.getProperty('page.url.apiref')},
jsonpage = ${@environment.getProperty('page.url.json')},
jsonbookpage = ${@environment.getProperty('page.url.json.book')},
jsonlistpage = ${@environment.getProperty('page.url.json.list')},
h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
">
<div>
<div id="bookstore-topform-base">
@ -190,7 +206,7 @@ Idea of the following syntax used in this and other HTML document:
<td>
<a class="btn btn-info"
th:href="@{__${restpage}__/book/{hash_id}(hash_id=${book.bookHash.hashId})}"
th:href="@{__${jsonpage}__} + @{__${jsonbookpage}__/{hash_id}(hash_id=${book.bookHash.hashId})}"
th:text="${#messages.msgOrNull('page.text.list.json')} ?: 'page.text.list.json'">
page.text.list.json
</a>
@ -214,7 +230,7 @@ Idea of the following syntax used in this and other HTML document:
<td></td>
<td></td>
<td>
<a class="btn btn-dark" th:href="@{__${restpage}__} + '/' + @{__${listpage}__}"
<a class="btn btn-dark" th:href="@{__${jsonpage}__} + @{__${jsonlistpage}__}"
th:text="${#messages.msgOrNull('button.page.list.json')} ?: 'button.page.list.json'">
button.page.list.json
</a>
@ -247,7 +263,7 @@ Idea of the following syntax used in this and other HTML document:
</p>
<img src="http://dreamicus.com/data/abyss/abyss-08.jpg" style="max-width: 600px; height: auto;" alt="abyss">
</div>
</div>
<th:block th:insert="fragments/footerpart :: footerpart"/>
</body>
</html>

+ 18
- 2
bookstore/src/main/resources/templates/fragments/devusers.html View File

@ -4,7 +4,23 @@
<link type="text/css" rel="stylesheet" href="../../static/css/bookstore.css" />
<link type="text/css" rel="stylesheet" href="../../static/css/bootstrap.min.css" />
</head>
<body>
<!--/* TODO: use proper and scalable fragment HTML replacement for this element */-->
<body th:with="
indexpage = ${@environment.getProperty('page.url.index')},
listpage = ${@environment.getProperty('page.url.list')},
addpage = ${@environment.getProperty('page.url.add')},
deletepage = ${@environment.getProperty('page.url.delete')},
editpage = ${@environment.getProperty('page.url.edit')},
loginpage = ${@environment.getProperty('page.url.login')},
logoutpage = ${@environment.getProperty('page.url.logout')},
apirefpage = ${@environment.getProperty('page.url.apiref')},
jsonpage = ${@environment.getProperty('page.url.json')},
jsonbookpage = ${@environment.getProperty('page.url.json.book')},
jsonlistpage = ${@environment.getProperty('page.url.json.list')},
h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
">
<th:block th:fragment="devusers">
<style>
#devtable th, td {
@ -43,7 +59,7 @@
</tr>
</tbody>
</table>
<a href="/h2-console/">H2 database console</a>
<a th:href="@{__${h2consolepage}__}">H2 database console</a>
</div>
</th:block>
</body>

Loading…
Cancel
Save