Browse Source

Prefer relative hrefs (for proxy server configurations)

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.1-alpha
Pekka Helenius 4 years ago
parent
commit
0524fdb984
3 changed files with 15 additions and 16 deletions
  1. +5
    -5
      bookstore/src/main/resources/templates/bookadd.html
  2. +4
    -4
      bookstore/src/main/resources/templates/bookedit.html
  3. +6
    -7
      bookstore/src/main/resources/templates/booklist.html

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

@ -2,13 +2,13 @@
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" />
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css" th:href="@{css/bootstrap.min.css}" />
<title>Add new book</title>
</head>
<body>
<div class="col-md-4 mb-3">
<h1>Add new book</h1>
<form th:object="${book}" action="#" th:action="@{bookadd}" method="post">
<div class="form-group">
@ -49,12 +49,12 @@
<button class="btn btn-primary" type="submit">Add book</button>
</form>
<br>
<form action="#" th:action="@{/booklist}" method="get">
<form action="#" th:action="@{booklist}" method="get">
<button class="btn btn-success" type="submit">Return to book list page</button>
</form>
</div>
</body>
</html>

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

@ -2,14 +2,14 @@
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" />
<link type="text/css" rel="stylesheet" href="../css/bootstrap.min.css" th:href="@{../css/bootstrap.min.css}" />
<title>Update existing book</title>
</head>
<body>
<div class="col-md-4 mb-3">
<h1>Update existing book</h1>
<form th:object="${book}" action="#" th:action="@{/bookedit/{id}(id=${book.id})}" method="post">
<form th:object="${book}" action="#" th:action="@{{id}(id=${book.id})}" method="post">
<div class="form-group">
<label for="BookAuthor">Author</label><br>
@ -46,11 +46,11 @@
<small class="form-text text-muted">Set book price</small>
<div class="alert alert-danger mt-2" th:if="${#fields.hasErrors('price')}" th:errors="*{price}">Invalid price</div>
</div>
<button class="btn btn-primary" type="submit">Update book</button>
</form>
<br>
<form action="#" th:action="@{/booklist}" method="get">
<form action="#" th:action="@{../booklist}" method="get">
<button class="btn btn-success" type="submit">Return to book list page</button>
</form>


+ 6
- 7
bookstore/src/main/resources/templates/booklist.html View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="/css/bootstrap.min.css"
th:href="@{/css/bootstrap.min.css}" />
<title>Bookstore page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css" th:href="@{css/bootstrap.min.css}" />
<title>Bookstore page</title>
</head>
<body>
<div>
@ -28,13 +27,13 @@
<td th:text="${#numbers.formatDecimal(book.price, 1, 2)}"></td>
<td><a class="btn btn-danger"
th:attr="onclick='return confirm(\'' + 'Delete book: ' + ${book.title} + '?' + '\');'"
th:href="@{/bookdelete/{id}(id=${book.id})}">Delete</a></td>
th:href="@{bookdelete/{id}(id=${book.id})}">Delete</a></td>
<td><a class="btn btn-warning"
th:href="@{/bookedit/{id}(id=${book.id})}">Edit</a></td>
th:href="@{bookedit/{id}(id=${book.id})}">Edit</a></td>
</tr>
</table>
<div>
<a class="btn btn-success" href="/bookadd">Add Book</a>
<a class="btn btn-success" href="bookadd">Add Book</a>
</div>
</div>
</body>


Loading…
Cancel
Save