diff --git a/src/main/java/edu/group5/app/App.java b/src/main/java/edu/group5/app/App.java index 6402156..17f99de 100644 --- a/src/main/java/edu/group5/app/App.java +++ b/src/main/java/edu/group5/app/App.java @@ -82,7 +82,7 @@ public void init() { OrganizationService organizationService = new OrganizationService(organizationRepository, orgScraper); this.root = new BorderPane(); this.appState = new AppState(); - this.nav = new NavigationController(root, appState, userService, donationService, organizationService); + this.nav = new NavigationController(root, appState, userService, donationService, organizationService, getHostServices()); } @Override diff --git a/src/main/java/edu/group5/app/control/NavigationController.java b/src/main/java/edu/group5/app/control/NavigationController.java index 70079ae..2c47621 100644 --- a/src/main/java/edu/group5/app/control/NavigationController.java +++ b/src/main/java/edu/group5/app/control/NavigationController.java @@ -15,7 +15,13 @@ import edu.group5.app.view.loginpage.SignUpPageView; import edu.group5.app.view.organizationpage.OrganizationPageView; import edu.group5.app.view.userpage.UserPageView; +import javafx.application.HostServices; +import javafx.scene.control.Alert; +import javafx.scene.control.ButtonType; +import javafx.scene.control.Hyperlink; +import javafx.scene.control.Label; import javafx.scene.layout.BorderPane; +import javafx.scene.layout.VBox; /** * Controller responsible for handling navigation between different pages of the application. @@ -33,23 +39,25 @@ public class NavigationController { private final LoginHeader loginHeader; private final AppState appState; + private HostServices hostServices; private final AuthController authController; private final DonationController donationController; private final OrganizationController organizationController; public NavigationController(BorderPane root, AppState appState, UserService userService, - DonationService donationService, OrganizationService organizationService) { + DonationService donationService, OrganizationService organizationService, HostServices hostServices) { ParameterValidator.objectChecker(root, "Root BorderPane"); ParameterValidator.objectChecker(appState, "AppState"); ParameterValidator.objectChecker(userService, "UserService"); ParameterValidator.objectChecker(donationService, "DonationService"); ParameterValidator.objectChecker(organizationService, "OrganizationService"); + ParameterValidator.objectChecker(hostServices, "HostServices"); this.root = root; this.header = new Header(this); this.loginHeader = new LoginHeader(); - + this.hostServices = hostServices; this.appState = appState; this.authController = new AuthController(appState, this, userService); @@ -122,7 +130,31 @@ public void showDonationPage() { } public void showAboutUsPage() { - root.setTop(header); + Alert aboutUs = new Alert(Alert.AlertType.INFORMATION); + aboutUs.setTitle("About us"); + aboutUs.setHeaderText("Help Me Help - About Us"); + + Label description = new Label( + "Help Me Help is a charity donation application designed to connect donors with organizations in need. " + + "Our mission is to make it easy for people to support causes they care about and make a positive impact in the world.\n\n" + + "This application was developed by Team 5 as part of a IDATT1005 course project at NTNU spring 2026." + ); + description.setWrapText(true); + description.maxWidthProperty().bind(aboutUs.getDialogPane().widthProperty().subtract(40)); + + Hyperlink websiteLink = new Hyperlink("For more information about the project, visit our GitHub repository"); + websiteLink.setOnAction(e -> hostServices.showDocument("https://git.ntnu.no/Group-5/Help-Me-Help")); + + VBox content = new VBox(10, description, websiteLink); + content.setPrefWidth(420); + + aboutUs.getDialogPane().setContentText(null); + aboutUs.getDialogPane().setContent(content); + + // Optional: single Close button instead of OK + aboutUs.getButtonTypes().setAll(ButtonType.CLOSE); + + aboutUs.showAndWait(); } /**