Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Consistently use array access syntax in template. Use page offset to calculate numbering. Use latest MongoDB Docker image.
  • Loading branch information
odrotbohm committed Jul 29, 2024
1 parent 3743072 commit 9988a78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions web/querydsl/src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ <h3 class="panel-title">Search</h3>

<div class="form-group col-sm-6">
<label for="firstname" class="control-label">Firstname:</label>
<input id="firstname" name="firstname" th:value="${param.firstname}" type="text" class="form-control" autofocus="autofocus" />
<input id="firstname" name="firstname" th:value="${param['firstname']}" type="text" class="form-control" autofocus="autofocus" />
</div>
<div class="form-group col-sm-6">
<label for="lastname" class="control-label">Lastname:</label>
<input id="lastname" name="lastname" th:value="${param.lastname}" type="text" class="form-control" autofocus="autofocus" />
<input id="lastname" name="lastname" th:value="${param['lastname']}" type="text" class="form-control" autofocus="autofocus" />
</div>
<div class="form-group col-sm-6">
<label for="address.city" class="control-label">City:</label>
Expand All @@ -42,7 +42,7 @@ <h3 class="panel-title">Search</h3>
</div>
<div class="form-group col-sm-6">
<label for="nationality" class="control-label">Nationality:</label>
<input id="nationality" name="nationality" th:value="${param.nationality}" type="text"
<input id="nationality" name="nationality" th:value="${param['nationality']}" type="text"
class="form-control" />
</div>
<div class="form-group col-sm-12">
Expand Down Expand Up @@ -73,11 +73,11 @@ <h3 class="panel-title">Search</h3>
<th>City</th>
<th>Street</th>
<th>Email</th>
</tr>
</tr>
</thead>
<tbody>
<tr th:each="user : ${users}">
<td th:text="${users.number * users.size + userStat.index + 1} + '.'">1.</td>
<td th:text="${users.pageable.offset + userStat.index + 1} + '.'">1.</td>
<td class="text-center">
<img th:src="${user.picture.small}" class="rounded-circle" />
</td>
Expand Down
6 changes: 4 additions & 2 deletions web/querydsl/src/test/java/example/users/TestApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

/**
* @author Tim Sparg
* @author Oliver Drotbohm
*/
public class TestApplication {

public static void main(String[] args) {
SpringApplication.from(Application::main).with(TestcontainersConfiguration.class).run(args);
SpringApplication.from(Application::main)
.with(TestcontainersConfiguration.class)
.run(args);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/**
* @author Tim Sparg
* @author Oliver Drotbohm
*/
@TestConfiguration(proxyBeanMethods = false)
public class TestcontainersConfiguration {
Expand All @@ -32,7 +33,6 @@ public class TestcontainersConfiguration {
@ServiceConnection
@RestartScope
MongoDBContainer mongoDbContainer() {
return new MongoDBContainer(DockerImageName.parse("mongo:7"));
return new MongoDBContainer(DockerImageName.parse("mongo:latest"));
}

}

0 comments on commit 9988a78

Please sign in to comment.