-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cathrkri
committed
Mar 12, 2026
1 parent
6a11481
commit cef3db0
Showing
3 changed files
with
114 additions
and
45 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...pplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,15 @@ | ||
| package ntnu.systemutvikling.team6.controller; | ||
|
|
||
| import javafx.fxml.FXML; | ||
| import javafx.scene.layout.FlowPane; | ||
|
|
||
| public class CharityPageController { | ||
| @FXML private FlowPane charityPage; | ||
|
|
||
| @FXML | ||
| public void initialize() { | ||
|
|
||
| } | ||
|
|
||
|
|
||
| } |
50 changes: 50 additions & 0 deletions
50
...papplication/src/main/java/ntnu/systemutvikling/team6/controller/FrontpageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package ntnu.systemutvikling.team6.controller; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import javafx.fxml.FXML; | ||
| import javafx.fxml.FXMLLoader; | ||
| import javafx.scene.Parent; | ||
| import javafx.scene.layout.FlowPane; | ||
| import ntnu.systemutvikling.team6.models.Charity; | ||
|
|
||
| public class FrontpageController { | ||
|
|
||
| @FXML | ||
| private FlowPane cardsContainer; | ||
|
|
||
| @FXML | ||
| public void initialize() { | ||
| try { | ||
|
|
||
| List<Charity> charities = | ||
| List.of( | ||
| new Charity("Redd Barna", | ||
| "Protecting children's rights worldwide.", | ||
| "Children"), | ||
| new Charity("Leger Uten Grenser", | ||
| "Emergency medical aid in crisis areas.", | ||
| "Health"), | ||
| new Charity( | ||
| "Kirkens Nødhjelp", | ||
| "Humanitarian aid and long-term development work.", | ||
| "Emergency Aid")); | ||
|
|
||
| for (Charity ch : charities) { | ||
|
|
||
| FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/organizationCard.fxml")); | ||
|
|
||
| Parent card = loader.load(); | ||
|
|
||
| OrganizationCardController cardController = loader.getController(); | ||
|
|
||
| cardController.setOrganization(ch.getName(), ch.getDescription()); | ||
|
|
||
| cardsContainer.getChildren().add(card); | ||
| } | ||
|
|
||
| } catch (Exception e) { | ||
| e.printStackTrace(); | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters