Browse Source

Update web forms: use component naming scheme; use multiple lines on

some field values
Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
81b45f4c19
6 changed files with 182 additions and 149 deletions
  1. +155
    -55
      bookstore/src/main/resources/templates/apiref.html
  2. +2
    -16
      bookstore/src/main/resources/templates/bookadd.html
  3. +2
    -16
      bookstore/src/main/resources/templates/bookedit.html
  4. +17
    -28
      bookstore/src/main/resources/templates/booklist.html
  5. +1
    -15
      bookstore/src/main/resources/templates/fragments/devusers.html
  6. +5
    -19
      bookstore/src/main/resources/templates/fragments/loginout.html

+ 155
- 55
bookstore/src/main/resources/templates/apiref.html View File

@ -11,7 +11,12 @@
</title> </title>
</head> </head>
<body th:with="baseUrl=(@{__${#httpServletRequest.scheme}__} + '://' + @{__${#httpServletRequest.serverName}__} + ':' + @{__${#httpServletRequest.serverPort}__} + '/'), adminUser='admin:admin'">
<body th:with="
baseUrl = (@{__${#httpServletRequest.scheme}__} + '://' +
@{__${#httpServletRequest.serverName}__} + ':' +
@{__${#httpServletRequest.serverPort}__}),
adminUser = 'admin:admin'
">
<h1 th:text="${#messages.msgOrNull('page.title.webform.apiref')} ?: 'page.title.webform.apiref'"> <h1 th:text="${#messages.msgOrNull('page.title.webform.apiref')} ?: 'page.title.webform.apiref'">
page.title.webform.apiref page.title.webform.apiref
@ -23,6 +28,7 @@
*/--> */-->
<table class="table table-striped"> <table class="table table-striped">
<tbody> <tbody>
<!--/* ------------------------------ */-->
<tr> <tr>
<th class="apiref-table-right apiref-table-title"> <th class="apiref-table-right apiref-table-title">
<h3 th:text="${#messages.msgOrNull('page.text.apiref.endpoints')} ?: 'page.text.apiref.endpoints'"> <h3 th:text="${#messages.msgOrNull('page.text.apiref.endpoints')} ?: 'page.text.apiref.endpoints'">
@ -37,49 +43,67 @@
*/--> */-->
</th> </th>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/booklist/' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/booklist/'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/categories/' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTCATEGORIES}__} + '/' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/categories/'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTCATEGORIES}__} + '/'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/authors/' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/authors/'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<th class="apiref-table-right apiref-table-title"> <th class="apiref-table-right apiref-table-title">
<h3 th:text="${#messages.msgOrNull('page.text.apiref.examples')} ?: 'page.text.apiref.examples'"> <h3 th:text="${#messages.msgOrNull('page.text.apiref.examples')} ?: 'page.text.apiref.examples'">
@ -91,95 +115,127 @@
</th> </th>
<th></th> <th></th>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/booklist/search/title?name=Bloody+Chamber' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/search/title?name=Bloody+Chamber' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/booklist/search/title?name=Bloody+Chamber'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/search/title?name=Bloody+Chamber'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/categories/search/category?name=Fantasy' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTCATEGORIES}__} + '/search/category?name=Fantasy' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/categories/search/category?name=Fantasy'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTCATEGORIES}__} + '/search/category?name=Fantasy'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/categories/search/category?name=horr' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTCATEGORIES}__} + '/search/category?name=horr' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/categories/search/category?name=horr'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTCATEGORIES}__} + '/search/category?name=horr'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET &quot;' + ${baseUrl} + 'api/authors/search/fullname?firstname=Angela&lastname=Carter&quot;' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET &quot;' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/search/fullname?firstname=Angela&lastname=Carter&quot;' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/authors/search/fullname?firstname=Angela&lastname=Carter'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/search/fullname?firstname=Angela&lastname=Carter'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/authors/search/firstname?firstname=anGel' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/search/firstname?firstname=anGel' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/authors/search/firstname?firstname=anGel'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/search/firstname?firstname=anGel'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/authors/search/lastname?lastname=Sapkowski' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/search/lastname?lastname=Sapkowski' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/authors/search/lastname?lastname=Sapkowski'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/search/lastname?lastname=Sapkowski'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<th class="apiref-table-right apiref-table-title"> <th class="apiref-table-right apiref-table-title">
<h3 th:text="${#messages.msgOrNull('page.text.apiref.book.get')} ?: 'page.text.apiref.book.get'"> <h3 th:text="${#messages.msgOrNull('page.text.apiref.book.get')} ?: 'page.text.apiref.book.get'">
@ -188,9 +244,14 @@
</th> </th>
<th></th> <th></th>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request GET ' + ${baseUrl} + 'api/booklist/2' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request GET ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/2' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
<br> <br>
@ -200,13 +261,14 @@
</td> </td>
<td> <td>
<a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'" <a th:text="${#messages.msgOrNull('page.text.apiref.link')} ?: 'page.text.apiref.link'"
th:href="${baseUrl} + 'api/booklist/2'"
>
th:href="
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/2'
">
page.text.apiref.link page.text.apiref.link
</a> </a>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<th class="apiref-table-right apiref-table-title"> <th class="apiref-table-right apiref-table-title">
<h3 th:text="${#messages.msgOrNull('page.text.apiref.book.add')} ?: 'page.text.apiref.book.add'"> <h3 th:text="${#messages.msgOrNull('page.text.apiref.book.add')} ?: 'page.text.apiref.book.add'">
@ -215,38 +277,50 @@
</th> </th>
<th></th> <th></th>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<small th:text="${#messages.msgOrNull('page.text.apiref.book.add.a')} ?: 'page.text.apiref.book.add.a'"> <small th:text="${#messages.msgOrNull('page.text.apiref.book.add.a')} ?: 'page.text.apiref.book.add.a'">
page.text.apiref.book.add.a page.text.apiref.book.add.a
</small> </small>
<br> <br>
<code th:text="'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;The Witcher: Blood of Elves&quot;,&quot;year&quot;:1994,&quot;isbn&quot;:&quot;5474512-543&quot;,&quot;price&quot;:22.49}\' ' + ${baseUrl} + 'api/booklist' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;The Witcher: Blood of Elves&quot;,&quot;year&quot;:1994,&quot;isbn&quot;:&quot;5474512-543&quot;,&quot;price&quot;:22.49}\' ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<small th:text="${#messages.msgOrNull('page.text.apiref.book.add.b')} ?: 'page.text.apiref.book.add.b'"> <small th:text="${#messages.msgOrNull('page.text.apiref.book.add.b')} ?: 'page.text.apiref.book.add.b'">
page.text.apiref.book.add.b page.text.apiref.book.add.b
</small> </small>
<br> <br>
<code th:text="'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;Mass Effect: Retribution&quot;,&quot;year&quot;:2010,&quot;isbn&quot;:&quot;0345520-722&quot;,&quot;price&quot;:29.90,&quot;category&quot;:{&quot;name&quot;:&quot;Sci-Fi&quot;},&quot;author&quot;:{&quot;firstname&quot;:&quot;Drew&quot;,&quot;lastname&quot;:&quot;Karpyshyn&quot;}}\' ' + ${baseUrl} + 'api/booklist' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;Mass Effect: Retribution&quot;,&quot;year&quot;:2010,&quot;isbn&quot;:&quot;0345520-722&quot;,&quot;price&quot;:29.90,&quot;category&quot;:{&quot;name&quot;:&quot;Sci-Fi&quot;},&quot;author&quot;:{&quot;firstname&quot;:&quot;Drew&quot;,&quot;lastname&quot;:&quot;Karpyshyn&quot;}}\' ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<small th:text="${#messages.msgOrNull('page.text.apiref.book.add.c')} ?: 'page.text.apiref.book.add.c'"> <small th:text="${#messages.msgOrNull('page.text.apiref.book.add.c')} ?: 'page.text.apiref.book.add.c'">
page.text.apiref.book.add.c page.text.apiref.book.add.c
</small> </small>
<br> <br>
<code th:text="'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;Mass Effect: Deception&quot;,&quot;year&quot;:2012,&quot;isbn&quot;:&quot;0345520-739&quot;,&quot;price&quot;:34.65,&quot;category&quot;:{&quot;name&quot;:&quot;sci-fi&quot;}}\' ' + ${baseUrl} + 'api/booklist' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;Mass Effect: Deception&quot;,&quot;year&quot;:2012,&quot;isbn&quot;:&quot;0345520-739&quot;,&quot;price&quot;:34.65,&quot;category&quot;:{&quot;name&quot;:&quot;sci-fi&quot;}}\' ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
<br> <br>
@ -255,14 +329,18 @@
</small> </small>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<small th:text="${#messages.msgOrNull('page.text.apiref.book.add.d')} ?: 'page.text.apiref.book.add.d'"> <small th:text="${#messages.msgOrNull('page.text.apiref.book.add.d')} ?: 'page.text.apiref.book.add.d'">
page.text.apiref.book.add.d page.text.apiref.book.add.d
</small> </small>
<br> <br>
<code th:text="'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;Halo: The Flood&quot;,&quot;year&quot;:2003,&quot;isbn&quot;:&quot;0345459-210&quot;,&quot;price&quot;:24.99,&quot;category&quot;:{&quot;name&quot;:&quot;sCi-fI&quot;},&quot;author&quot;:{&quot;lastname&quot;:&quot;Dietz&quot;}}\' ' + ${baseUrl} + 'api/booklist' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request POST --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;Halo: The Flood&quot;,&quot;year&quot;:2003,&quot;isbn&quot;:&quot;0345459-210&quot;,&quot;price&quot;:24.99,&quot;category&quot;:{&quot;name&quot;:&quot;sCi-fI&quot;},&quot;author&quot;:{&quot;lastname&quot;:&quot;Dietz&quot;}}\' ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
<br> <br>
@ -271,13 +349,13 @@
</small> </small>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td> <td>
<small th:text="${#messages.msgOrNull('page.text.apiref.unix.info')} ?: 'page.text.apiref.unix.info'">page.text.apiref.unix.info</small> <small th:text="${#messages.msgOrNull('page.text.apiref.unix.info')} ?: 'page.text.apiref.unix.info'">page.text.apiref.unix.info</small>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<th class="apiref-table-right apiref-table-title"> <th class="apiref-table-right apiref-table-title">
<h3 th:text="${#messages.msgOrNull('page.text.apiref.book.edit')} ?: 'page.text.apiref.book.edit'"> <h3 th:text="${#messages.msgOrNull('page.text.apiref.book.edit')} ?: 'page.text.apiref.book.edit'">
@ -286,28 +364,39 @@
</th> </th>
<th></th> <th></th>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<small th:text="${#messages.msgOrNull('page.text.apiref.book.add.a')} ?: 'page.text.apiref.book.add.a'"> <small th:text="${#messages.msgOrNull('page.text.apiref.book.add.a')} ?: 'page.text.apiref.book.add.a'">
page.text.apiref.book.add.a page.text.apiref.book.add.a
</small> </small>
<br> <br>
<code th:text="'curl --include --request PUT --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;The Witcher: Blood of Elves&quot;,&quot;year&quot;:1999,&quot;isbn&quot;:&quot;3213221-3&quot;,&quot;price&quot;:22.49}\' ' + ${baseUrl} + 'api/booklist/2' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request PUT --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;The Witcher: Blood of Elves&quot;,&quot;year&quot;:1999,&quot;isbn&quot;:&quot;3213221-3&quot;,&quot;price&quot;:22.49}\' ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/2' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<small th:text="${#messages.msgOrNull('page.text.apiref.book.add.b')} ?: 'page.text.apiref.book.add.b'"> <small th:text="${#messages.msgOrNull('page.text.apiref.book.add.b')} ?: 'page.text.apiref.book.add.b'">
page.text.apiref.book.add.b page.text.apiref.book.add.b
</small> </small>
<br> <br>
<code th:text="'curl --include --request PUT --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;The Witcher: Blood of Elves - Enhanced Edition&quot;,&quot;year&quot;:2019,&quot;author&quot;:{&quot;firstname&quot;:&quot;Vitaly&quot;,&quot;lastname&quot;:&quot;Zarikov&quot;},&quot;category&quot;:{&quot;name&quot;:&quot;horror&quot;}}\' ' + ${baseUrl} + 'api/booklist/2' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request PUT --header &quot;Content-Type: application/json&quot; --data \'{&quot;title&quot;:&quot;The Witcher: Blood of Elves - Enhanced Edition&quot;,&quot;year&quot;:2019,&quot;author&quot;:{&quot;firstname&quot;:&quot;Vitaly&quot;,&quot;lastname&quot;:&quot;Zarikov&quot;},&quot;category&quot;:{&quot;name&quot;:&quot;horror&quot;}}\' ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/2' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td> <td>
<small th:text="${#messages.msgOrNull('page.text.apiref.book.edit.info')} ?: 'page.text.apiref.book.edit.info'"> <small th:text="${#messages.msgOrNull('page.text.apiref.book.edit.info')} ?: 'page.text.apiref.book.edit.info'">
@ -319,7 +408,7 @@
</small> </small>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<th class="apiref-table-right apiref-table-title"> <th class="apiref-table-right apiref-table-title">
<h3 th:text="${#messages.msgOrNull('page.text.apiref.book.delete')} ?: 'page.text.apiref.book.delete'"> <h3 th:text="${#messages.msgOrNull('page.text.apiref.book.delete')} ?: 'page.text.apiref.book.delete'">
@ -328,9 +417,14 @@
</th> </th>
<th></th> <th></th>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request DELETE ' + ${baseUrl} + 'api/booklist/2' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request DELETE ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTBOOKS}__} + '/2' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
<br> <br>
@ -339,7 +433,7 @@
<small th:text="${#messages.msgOrNull('page.text.apiref.unix.info')} ?: 'page.text.apiref.unix.info'">page.text.apiref.unix.info</small> <small th:text="${#messages.msgOrNull('page.text.apiref.unix.info')} ?: 'page.text.apiref.unix.info'">page.text.apiref.unix.info</small>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<th class="apiref-table-right apiref-table-title"> <th class="apiref-table-right apiref-table-title">
<h3 th:text="${#messages.msgOrNull('page.text.apiref.author.edit')} ?: 'page.text.apiref.author.edit'"> <h3 th:text="${#messages.msgOrNull('page.text.apiref.author.edit')} ?: 'page.text.apiref.author.edit'">
@ -348,9 +442,14 @@
</th> </th>
<th></th> <th></th>
</tr> </tr>
<!--/* ------------------------------ */-->
<tr> <tr>
<td class="apiref-table-right"> <td class="apiref-table-right">
<code th:text="'curl --include --request PUT --header &quot;Content-Type: application/json&quot; --data \'{&quot;firstname&quot;:&quot;Tanya&quot;,&quot;lastname&quot;:&quot;Rose&quot;}\' ' + ${baseUrl} + 'api/authors/1' + ' --user ' + ${adminUser}">
<code th:text="
'curl --include --request PUT --header &quot;Content-Type: application/json&quot; --data \'{&quot;firstname&quot;:&quot;Tanya&quot;,&quot;lastname&quot;:&quot;Rose&quot;}\' ' +
${baseUrl} + @{__${@Pages.REST}__} + @{__${@Pages.RESTAUTHORS}__} + '/1' +
' --user ' + ${adminUser}
">
code placeholder code placeholder
</code> </code>
<br> <br>
@ -359,10 +458,11 @@
<small th:text="${#messages.msgOrNull('page.text.apiref.unix.info')} ?: 'page.text.apiref.unix.info'">page.text.apiref.unix.info</small> <small th:text="${#messages.msgOrNull('page.text.apiref.unix.info')} ?: 'page.text.apiref.unix.info'">page.text.apiref.unix.info</small>
</td> </td>
</tr> </tr>
<!--/* ------------------------------ */-->
</tbody> </tbody>
<tr> <tr>
<td> <td>
<a class="btn btn-success" th:href="@{__${listpage}__}"
<a class="btn btn-success" th:href="@{__${@Pages.LIST}__}"
th:text="${#messages.msgOrNull('button.page.list.return')} ?: 'button.page.list.return'"> th:text="${#messages.msgOrNull('button.page.list.return')} ?: 'button.page.list.return'">
button.page.list.return button.page.list.return
</a> </a>


+ 2
- 16
bookstore/src/main/resources/templates/bookadd.html View File

@ -12,21 +12,7 @@
</head> </head>
<!--/* 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')}
">
<body>
<div style="display: flex;"> <div style="display: flex;">
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
@ -47,7 +33,7 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
<br> <br>
<a class="btn btn-success" th:href="@{../__${listpage}__}"
<a class="btn btn-success" th:href="@{../__${@Pages.LIST}__}"
th:text="${#messages.msgOrNull('button.page.list.return')} ?: 'button.page.list.return'"> th:text="${#messages.msgOrNull('button.page.list.return')} ?: 'button.page.list.return'">
button.page.list.return button.page.list.return
</a> </a>


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

@ -12,21 +12,7 @@
</head> </head>
<!--/* 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')}
">
<body>
<div style="display:flex;"> <div style="display:flex;">
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
@ -48,7 +34,7 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
<br> <br>
<a class="btn btn-success" th:href="@{__${listpage}__}"
<a class="btn btn-success" th:href="@{__${@Pages.LIST}__}"
th:text="${#messages.msgOrNull('button.page.list.return')} ?: 'button.page.list.return'"> th:text="${#messages.msgOrNull('button.page.list.return')} ?: 'button.page.list.return'">
button.page.list.return button.page.list.return
</a> </a>


+ 17
- 28
bookstore/src/main/resources/templates/booklist.html View File

@ -49,20 +49,7 @@ Idea of the following syntax used in this and other HTML document:
</head> </head>
<!--/* TODO: use proper and scalable fragment HTML replacement for this element */--> <!--/* 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')}
">
<body>
<div> <div>
@ -178,26 +165,26 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
<td> <td>
<p sec:authorize="hasAuthority('MARKETING')" <p sec:authorize="hasAuthority('MARKETING')"
th:text="${book.publish == true} ? (${#messages.msgOrNull('page.text.list.yes')} ?: 'page.text.list.yes') : (${#messages.msgOrNull('page.text.list.no')} ?: 'page.text.list.no')"
th:text="${book.publish == true} ? (${#messages.msgOrNull('page.text.book.publish.yes')} ?: 'page.text.book.publish.yes') : (${#messages.msgOrNull('page.text.book.publish.no')} ?: 'page.text.book.publish.no')"
> >
page.text.list.[yes|no]
page.text.book.publish.[yes|no]
</p> </p>
</td> </td>
<td sec:authorize="hasAuthority('ADMIN')"> <td sec:authorize="hasAuthority('ADMIN')">
<a class="btn btn-danger" <a class="btn btn-danger"
th:attr="onclick='javascript:return confirm(\'' + 'Delete book: ' + ${book.title} + '?' + '\');'" th:attr="onclick='javascript:return confirm(\'' + 'Delete book: ' + ${book.title} + '?' + '\');'"
th:href="@{__${deletepage}__/{hash_id}(hash_id=${book.bookHash.hashId})}"
th:text="${#messages.msgOrNull('page.text.list.delete')} ?: 'page.text.list.delete'">
page.text.list.delete
th:href="@{__${@Pages.DELETE}__/{hash_id}(hash_id=${book.bookHash.hashId})}"
th:text="${#messages.msgOrNull('page.text.book.delete')} ?: 'page.text.book.delete'">
page.text.book.delete
</a> </a>
</td> </td>
<td> <td>
<a class="btn btn-warning" sec:authorize="hasAnyAuthority(@BookAuth.SALES, @BookAuth.HELPDESK)" <a class="btn btn-warning" sec:authorize="hasAnyAuthority(@BookAuth.SALES, @BookAuth.HELPDESK)"
th:href="@{__${editpage}__/{hash_id}(hash_id=${book.bookHash.hashId})}"
th:text="${#messages.msgOrNull('page.text.list.edit')} ?: 'page.text.list.edit'">
page.text.list.edit
th:href="@{__${@Pages.EDIT}__/{hash_id}(hash_id=${book.bookHash.hashId})}"
th:text="${#messages.msgOrNull('page.text.book.edit')} ?: 'page.text.book.edit'">
page.text.book.edit
</a> </a>
</td> </td>
@ -206,9 +193,9 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
<td> <td>
<a class="btn btn-info" <a class="btn btn-info"
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
th:href="@{__${@Pages.JSON}__} + @{__${@Pages.JSONBOOK}__/{hash_id}(hash_id=${book.bookHash.hashId})}"
th:text="${#messages.msgOrNull('page.text.book.json')} ?: 'page.text.book.json'">
page.text.book.json
</a> </a>
</td> </td>
@ -216,7 +203,8 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
<tr> <tr>
<td> <td>
<a class="btn btn-success" th:href="@{__${addpage}__}" sec:authorize="hasAuthority(@BookAuth.SALES)"
<a class="btn btn-success" th:href="@{__${@Pages.ADD}__}"
sec:authorize="hasAuthority(@BookAuth.SALES)"
th:text="${#messages.msgOrNull('button.book.add')} ?: 'button.book.add'"> th:text="${#messages.msgOrNull('button.book.add')} ?: 'button.book.add'">
button.book.add button.book.add
</a> </a>
@ -230,7 +218,7 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
<td></td> <td></td>
<td></td> <td></td>
<td> <td>
<a class="btn btn-dark" th:href="@{__${jsonpage}__} + @{__${jsonlistpage}__}"
<a class="btn btn-dark" th:href="@{__${@Pages.JSON}__} + @{__${@Pages.JSONLIST}__}"
th:text="${#messages.msgOrNull('button.page.list.json')} ?: 'button.page.list.json'"> th:text="${#messages.msgOrNull('button.page.list.json')} ?: 'button.page.list.json'">
button.page.list.json button.page.list.json
</a> </a>
@ -239,7 +227,8 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
<tr style="background-color: #FFF !important;"> <tr style="background-color: #FFF !important;">
<td> <td>
<a class="btn btn-info" th:href="@{__${apirefpage}__}" sec:authorize="hasAuthority(@BookAuth.ADMIN)"
<a class="btn btn-info" th:href="@{__${@Pages.APIREF}__}"
sec:authorize="hasAuthority(@BookAuth.ADMIN)"
th:text="${#messages.msgOrNull('button.page.apiref')} ?: 'button.page.apiref'"> th:text="${#messages.msgOrNull('button.page.apiref')} ?: 'button.page.apiref'">
button.page.apiref button.page.apiref
</a> </a>


+ 1
- 15
bookstore/src/main/resources/templates/fragments/devusers.html View File

@ -5,21 +5,7 @@
<link type="text/css" rel="stylesheet" href="../../static/css/bootstrap.min.css" /> <link type="text/css" rel="stylesheet" href="../../static/css/bootstrap.min.css" />
</head> </head>
<!--/* 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')}
">
<body>
<th:block th:fragment="devusers"> <th:block th:fragment="devusers">
<style> <style>


+ 5
- 19
bookstore/src/main/resources/templates/fragments/loginout.html View File

@ -6,21 +6,7 @@
<link type="text/css" rel="stylesheet" href="../../static/css/bootstrap.min.css" /> <link type="text/css" rel="stylesheet" href="../../static/css/bootstrap.min.css" />
</head> </head>
<!--/* 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')}
">
<body>
<th:block th:fragment="loginout"> <th:block th:fragment="loginout">
<div id="bookstore-loginout"> <div id="bookstore-loginout">
@ -32,9 +18,9 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
*/--> */-->
<div sec:authorize="isAuthenticated()"> <div sec:authorize="isAuthenticated()">
<div> <div>
<form th:action="@{__${logoutpage}__}" method="post">
<form th:action="@{__${@Pages.LOGOUT}__}" method="post">
<button type="submit" class="btn btn-info" <button type="submit" class="btn btn-info"
th:href="@{__${logoutpage}__}"
th:href="@{__${@Pages.LOGOUT}__}"
th:text="${#messages.msgOrNull('button.page.logout')} ?: 'button.page.logout'"> th:text="${#messages.msgOrNull('button.page.logout')} ?: 'button.page.logout'">
button.page.logout button.page.logout
</button> </button>
@ -56,7 +42,7 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
*/--> */-->
<div sec:authorize="isAnonymous()"> <div sec:authorize="isAnonymous()">
<form th:action="@{__${loginpage}__}" method="post">
<form th:action="@{__${@Pages.LOGIN}__}" method="post">
<!--/* <!--/*
Keep normal id field as fallback (i.e. for defining plain HTML CSS styles) Keep normal id field as fallback (i.e. for defining plain HTML CSS styles)
@ -99,7 +85,7 @@ h2consolepage = ${@environment.getProperty('spring.h2.console.path')}
** END: login elements ** ** END: login elements **
*/--> */-->
<div th:if="${@environment.getActiveProfiles()[0] == 'dev'}" style="margin: 10px 0;"> <div th:if="${@environment.getActiveProfiles()[0] == 'dev'}" style="margin: 10px 0;">
<a th:href="@{__${h2consolepage}__}">H2 database console access</a>
<a th:href="@{__${@Pages.H2CONSOLE}__}">H2 database console access</a>
</div> </div>
</div> </div>
</th:block> </th:block>


Loading…
Cancel
Save