use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.
the class NewsletterSubscriptionValidationView method setParameter.
@Override
public void setParameter(@NotNull final BeforeEvent beforeEvent, @Nullable @OptionalParameter final String parameter) {
final var location = beforeEvent.getLocation();
final var queryParameters = location.getQueryParameters();
final var parameters = queryParameters.getParameters();
final var emailAddress = parameters.getOrDefault("email", List.of("")).get(0);
final var validationCode = parameters.getOrDefault("code", List.of("")).get(0);
final var validationOkay = databaseService.validateSubscription(emailAddress, validationCode);
final var content = new Div();
content.add(new H2("Newsletter Subscription Validation"));
content.add(new Html(validationOkay ? "<p class=\"successful\">You successfully subscribed to our newsletter.</p>" : "<p class=\"failed\">Your subscription was not successful.<br/>Check the link in the email you received shortly.</p>"));
content.add(new RouterLink("Back to home page", HomeView.class));
setContent(content);
}
use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.
the class EventArticle method addTitle.
/**
* Add the event title.
* @param event the event
*/
protected void addTitle(@NotNull final Event event) {
final var detailLink = event.getCompleteEventUrl();
add(new Anchor(detailLink, new H2(event.getTitle())));
if (!event.getSubtitle().isBlank()) {
add(new Anchor(detailLink, new H3(event.getSubtitle())));
}
}
use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.
the class WebsiteFooter method createAbout.
private Component createAbout() {
final var layout = new HorizontalLayout();
layout.setId("website-footer-about");
final var title = new Div(new H2("About"));
final var about = new Html("<div>%s</div>".formatted(configuration.getWebsiteAboutText()));
layout.add(new HorizontalLayout(title, about));
return layout;
}
use of com.vaadin.flow.component.html.H2 in project sapl-demos by heutelbeck.
the class MainLayout method createDrawerContent.
private Component createDrawerContent() {
H2 appName = new H2("SAPL Vaadin Demo");
appName.addClassNames("flex", "items-center", "h-xl", "m-0", "px-m", "text-m");
com.vaadin.flow.component.html.Section section = new com.vaadin.flow.component.html.Section(appName, createNavigation(), createFooter());
section.addClassNames("flex", "flex-col", "items-stretch", "max-h-full", "min-h-full");
return section;
}
use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.
the class EventsView method beforeEnter.
@Override
public void beforeEnter(@NotNull final BeforeEnterEvent beforeEnterEvent) {
final var params = beforeEnterEvent.getRouteParameters();
final var location = params.get("location");
final var events = databaseService.upcomingEvents().toList();
final var subMenu = createSubMenu(events, location.orElse(null));
final var eventsList = new Div();
eventsList.addClassName("events-list");
final var filteredEventPreviews = events.stream().filter(event -> location.isEmpty() || URLUtil.createReadableUrl(event.getLocation()).equals(location.get())).map(EventPreview::new).toList();
if (filteredEventPreviews.isEmpty()) {
eventsList.add(new H2("No upcoming events found"));
eventsList.add(new H3("Please try a different location from the menu to the left."));
} else {
eventsList.add(filteredEventPreviews.toArray(new EventPreview[0]));
}
setSubMenu(subMenu);
setContent(eventsList);
}
Aggregations