Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public String showExhibitions(Model model) {
@RequestMapping(value = "/staff/exhibit/config", method = RequestMethod.POST)
public RedirectView createOrUpdateExhibition(HttpServletRequest request,
@RequestParam(required = false, name = "exhibitionParam") String exhibitID,
@RequestParam("spaceParam") String spaceID,
@RequestParam(required = false, name = "spaceParam") String spaceID,
@Valid @ModelAttribute("exhibitionConfigurationForm") ExhibitionConfigurationForm exhibitionConfigForm,
BindingResult result,
RedirectAttributes attributes) throws IOException {
Expand All @@ -107,6 +107,13 @@ public RedirectView createOrUpdateExhibition(HttpServletRequest request,
attributes.addAttribute("message", result.getFieldError().getDefaultMessage());
return new RedirectView(request.getContextPath() + "/staff/exhibit/config");
}

if (spaceID == null || spaceID.trim().isEmpty()) {
attributes.addAttribute("showAlert", true);
attributes.addAttribute("alertType", "danger");
attributes.addAttribute("message", "Please select a start space for the exhibition.");
return new RedirectView(request.getContextPath() + "/staff/exhibit/config");
}
ExhibitionModes exhibitMode = exhibitionConfigForm.getExhibitionMode();
List<String> languages = exhibitionConfigForm.getExhibitLanguage();
String defaultLanguage = exhibitionConfigForm.getDefaultExhibitLanguage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ <h2>Exhibition Configuration</h2>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" th:value="${exhibition?.id}" name="exhibitionParam" id="exhibitionParam"/>
<label for="space">Select the start space of the exhibition:</label>
<select class="form-control" name="spaceParam">
<select class="form-control" name="spaceParam" required>
<option value="">-- Please select a start space --</option>
<option th:id="${space.id}" th:each="space: ${spacesList}" th:value="${space.id}"
th:selected="${#strings.equals(space.id,exhibition?.startSpace?.id)}">
[[${space.name}]]
Expand Down