Skip to content

Commit

Permalink
Merge pull request #61 from jkuznik/Task-49-Hotfix
Browse files Browse the repository at this point in the history
Task-49-Hotfix
  • Loading branch information
Slawek84PL authored Nov 26, 2024
2 parents f78f45b + b0eb4d4 commit 0f4866e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ public String createDisaster(Model model, @AuthenticationPrincipal AppUser userD
public String showDisasterList(Model model, @AuthenticationPrincipal AppUser userDetails) {
baseModel(model, userDetails);

if (!model.containsAttribute("list")) {
model.addAttribute("list", getDisasterDTOS("Wszystkie", "Wszystkie"));
model.addAttribute("googleApiKey", googleApiKey);
model.addAttribute("inLocationDisasterAmount", inLocationDisastersAmount());
}

model.addAttribute("googleApiKey", googleApiKey);
model.addAttribute("inLocationDisasterAmount", inLocationDisastersAmount());
return "listDisasters";
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pl.ateam.disasteralerts.web;

import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
Expand All @@ -18,6 +19,9 @@
@RequestMapping("/signup")
public class SignupViewController {

@Value("${google.maps.api.key}")
private String googleApiKey;

private final UserService userService;

public SignupViewController(UserService userService) {
Expand All @@ -29,6 +33,8 @@ public String signupView(Model model) {
model.addAttribute("userDto",
new UserRegisterDTO(null, null, null, null, null));
citiesList(model);
model.addAttribute("googleApiKey", googleApiKey);

return "signup";
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/templates/fragments.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
<div sec:authorize="isAnonymous()">
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link text-light" href="/">Login <i class="bi bi-forward"></i></a>
<a class="nav-link text-light" href="/">Logowanie <i class="bi bi-forward"></i></a>
</li>
<li class="nav-item">
<a class="nav-link text-light" href="/signup">Register <i class="bi bi-forward-fill"></i></a>
<a class="nav-link text-light" href="/signup">Rejestracja <i class="bi bi-forward-fill"></i></a>
</li>
</ul>
</div>
Expand All @@ -53,7 +53,7 @@
<a class="nav-link text-light" href="/users/edit"><i class="bi bi-person-lines-fill"></i> Edytuj dane</a>
</li>
<li class="nav-item">
<a class="nav-link text-light" href="/logout"><i class="bi bi-box-arrow-right"></i> Logout</a>
<a class="nav-link text-light" href="/logout"><i class="bi bi-box-arrow-right"></i> Wyloguj</a>
</li>
</ul>
</div>
Expand Down

0 comments on commit 0f4866e

Please sign in to comment.