use of org.komunumo.data.service.DatabaseService in project komunumo-server by komunumo.
the class MembersView method afterNavigation.
@Override
public void afterNavigation(@NotNull final AfterNavigationEvent afterNavigationEvent) {
final var url = afterNavigationEvent.getLocation().getPath();
final var subMenu = new SubMenu();
databaseService.getPages(PageParent.Members).forEach(page -> subMenu.add(new SubMenuItem(page.getCompletePageUrl(), page.getTitle(), url.equals(page.getCompletePageUrl()))));
subMenu.add(new SubMenuItem("/members/feedback", "Feedback", url.equals("members/feedback")));
setSubMenu(subMenu);
if (url.equals("members/feedback")) {
setContent(createFeedbackForm());
} else if (url.contains("/")) {
final var page = loadPage(databaseService, url);
this.getUI().ifPresent(ui -> ui.getPage().setTitle("%s: %s".formatted(databaseService.configuration().getWebsiteName(), page != null ? page.getTitle() : "Members")));
}
}
Aggregations