Browse Source

Fix database and table improvements

master
Kirill Nikolaev 1 month ago
parent
commit
bae3cd7634
Signed by: sokket <sokket@oceancraft.ru> GPG Key ID: 082FDA12D688C5C1
2 changed files with 15 additions and 6 deletions
  1. +2
    -1
      src/main/resources/application.properties
  2. +13
    -5
      src/main/resources/templates/table.html

+ 2
- 1
src/main/resources/application.properties View File

@@ -1 +1,2 @@

spring.datasource.url=jdbc:h2:file:./scoreboard;FILE_LOCK=FS
spring.jpa.hibernate.ddl-auto=update

+ 13
- 5
src/main/resources/templates/table.html View File

@@ -5,6 +5,11 @@
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head>
<body>
<style>
.selected {
background: darkgrey;
}
</style>
<table>
<thead>
<tr>
@@ -14,12 +19,15 @@
</tr>
</thead>
<tbody>
<tr th:each="player, i : ${players}">
<td th:text="${i.index + 1}">Position</td>
<td th:text="${player.getName()}"></td>
<td th:text="${player.getScore()}"></td>
</tr>
<th:block th:each="player, i : ${players}">
<tr th:classappend="${player.getName() == issuedBy}?selected">
<td th:text="${i.index + 1}">Position</td>
<td th:text="${player.getName()}"></td>
<td th:text="${player.getScore()}"></td>
</tr>
</th:block>
</tbody>

</table>
</body>
</html>

Loading…
Cancel
Save