Skip to content

Commit 2fafae5

Browse files
author
Christian Wansart
committed
add bootstrap
1 parent 0133c2d commit 2fafae5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+59685
-88
lines changed

src/main/java/de/cwansart/unipoll/CreateController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public String doCreate(@ModelAttribute("createForm") CreateForm createForm, Mode
6060
return "create";
6161
}
6262

63-
List<String> topics = Arrays.asList(createForm.getTopics().split(","));
64-
if (topics.isEmpty()) {
63+
List<String> topics = Arrays.asList(createForm.getTopics().split("\\r?\\n"));
64+
if (createForm.getTopics().isBlank() || topics.isEmpty()) {
6565
model.addAttribute("topics_error", "Topics may not be empty!");
6666
model.addAttribute("form", new CreateForm());
6767
return "create";

src/main/java/de/cwansart/unipoll/LoginController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ public String login(@RequestParam(name = "p", required = true) String page, Mode
3939
public String doLogin(@ModelAttribute("loginForm") LoginForm loginForm, @RequestParam(name = "p", required = true) String page, Model model) {
4040
if (!auth.login(loginForm.getPassword())) {
4141
model.addAttribute("error", "Invalid password!");
42+
model.addAttribute("loginForm", new LoginForm());
43+
model.addAttribute("page", page);
44+
return "login";
4245
} else {
4346
if (!page.equals("create") && !page.equals("list")) {
4447
throw new ResponseStatusException(HttpStatusCode.valueOf(400), "unknown redirect page");
4548
}
4649
return "redirect:/" + page;
4750
}
48-
model.addAttribute("loginForm", new LoginForm());
49-
return "login";
5051
}
5152
}

src/main/java/de/cwansart/unipoll/ResultController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public String show(
7676

7777
model.addAttribute("results", results);
7878
model.addAttribute("id", id);
79+
model.addAttribute("name", poll.get().getName());
7980
return "result";
8081
}
8182
}

0 commit comments

Comments
 (0)