Skip to content

Commit

Permalink
Fixes: Fixed org_editPage page displaying wrongly, and fixed sidebar …
Browse files Browse the repository at this point in the history
…on org moving to user-side settings not org-side settings
  • Loading branch information
AdrianBalunan committed Apr 22, 2026
1 parent d232f05 commit b4b1b13
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
public class profileOrgEditController extends BaseController {
@FXML
private NavbarController navbarController;

@FXML private Label charityNameLabel;
@FXML private Label charityNameLabel2;
@FXML private TextArea descriptionField;

@Override
Expand All @@ -50,6 +52,7 @@ protected void authTokenisSet() {
private void populateFields(){
Charity usersCharity = authToken.isCharityUser();
charityNameLabel.setText(usersCharity.getName());
charityNameLabel2.setText(usersCharity.getName());
descriptionField.setText(usersCharity.getDescription());
}

Expand Down Expand Up @@ -99,7 +102,7 @@ private void switchToFeedbackPage(ActionEvent event){

@FXML
private void switchToSettingsPage(ActionEvent event){
LoaderScene.LoadScene("profile_user_Settings", event, null, null, authToken);
LoaderScene.LoadScene("profile_org_Settings", event, null, null, authToken);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void switchToEditPage(ActionEvent event) {

@FXML
private void switchToSettingsPage(ActionEvent event) {
LoaderScene.LoadScene("profile_user_Settings", event, null, null, authToken);
LoaderScene.LoadScene("profile_org_Settings", event, null, null, authToken);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void switchToFeedbackPage(ActionEvent event){

@FXML
private void switchToSettingsPage(ActionEvent event){
LoaderScene.LoadScene("profile_user_Settings", event, null, null, authToken);
LoaderScene.LoadScene("profile_org_Settings", event, null, null, authToken);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,6 @@

</children>
</VBox>

<HBox alignment="CENTER">
<children>
<Label text="" textFill="#7E8288">
<font>
<Font size="22" />
</font>
</Label>
</children>
</HBox>
</children>
</VBox>
<rowConstraints>
Expand Down
147 changes: 68 additions & 79 deletions helpmehelpapplication/src/main/resources/fxml/profile_org_edit.fxml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.layout.BorderPane?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
Expand All @@ -20,12 +18,11 @@
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>

<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.BorderPane?>
<GridPane prefHeight="900.0" prefWidth="1400.0" style="-fx-background-color: #F5F5F5;" xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ntnu.systemutvikling.team6.controller.profileCharity.profileOrgEditController">

<columnConstraints>
<ColumnConstraints percentWidth="100.0" />
<ColumnConstraints />
</columnConstraints>

<rowConstraints>
Expand All @@ -34,15 +31,15 @@
</rowConstraints>

<!-- NAVBAR -->
<StackPane prefHeight="86.0" minHeight="86.0" maxHeight="86.0" style="-fx-background-color: #379894;">
<StackPane maxHeight="86.0" minHeight="86.0" prefHeight="86.0" style="-fx-background-color: #379894;">
<children>
<!-- Pull in the navbar from components with its own controller -->
<fx:include fx:id="navbar" source="components/navbar.fxml"/>
<fx:include fx:id="navbar" source="components/navbar.fxml" />
</children>
</StackPane>

<!-- MAIN CONTENT -->
<BorderPane VBox.vgrow="ALWAYS" style="-fx-background-color: #F5F5F5;">
<BorderPane style="-fx-background-color: #F5F5F5;" GridPane.rowIndex="1" VBox.vgrow="ALWAYS">

<!-- SIDEBAR -->
<left>
Expand All @@ -55,7 +52,7 @@
<VBox alignment="CENTER" spacing="16">
<children>
<Circle fill="#D9D9D9" radius="88" />
<Label text="Organization&#10;Name" textAlignment="CENTER" textFill="#333333">
<Label fx:id="charityNameLabel" text="Organization&#10;Name" textAlignment="CENTER" textFill="#333333">
<font>
<Font size="18" />
</font>
Expand Down Expand Up @@ -99,80 +96,72 @@

<Button onAction="#handleLogout" style="-fx-background-color: transparent; -fx-font-size: 20px; -fx-alignment: CENTER_LEFT; -fx-text-fill: #333333;" text="Log Out" />
</children>
</VBox>
</left>
</BorderPane>
</VBox>
</left>

<!-- PAGE AREA -->
<ScrollPane fitToWidth="true" hbarPolicy="NEVER" style="-fx-background-color: transparent;" GridPane.columnIndex="1">
<content>
<VBox spacing="30" style="-fx-background-color: #F5F5F5;">
<padding>
<Insets bottom="40" left="50" right="34" top="40" />
</padding>

<children>
<!-- PAGE TITLE -->
<VBox spacing="4">
<children>
<Label text="Edit Organisation" textFill="#111111">
<font><Font name="System Bold" size="32" /></font>
</Label>
<Label text="Update your organisation's public description." textFill="#8B8B8B">
<font><Font size="24" /></font>
</Label>
</children>
</VBox>
<center>
<ScrollPane fitToWidth="true" hbarPolicy="NEVER" style="-fx-background-color: transparent;">
<content>
<VBox spacing="30" style="-fx-background-color: #F5F5F5;">
<padding>
<Insets bottom="40" left="50" right="34" top="40" />
</padding>

<!-- HEADER CARD (read-only) -->
<VBox spacing="8">
<children>
<Label text="Organisation Name" textFill="#444444">
<font><Font name="System Regular" size="13" /></font>
</Label>
<StackPane>
<children>
<Rectangle arcHeight="12" arcWidth="12" fill="#EEEEEE" height="60" width="780" />
<Label fx:id="charityNameLabel" text="REDD BARNA NORGE" textFill="#888888"
style="-fx-padding: 0 0 0 18;">
<font><Font name="System Regular" size="20" /></font>
</Label>
</children>
</StackPane>
<Label text="Organisation name can only be changed in Settings." textFill="#AAAAAA">
<font><Font size="11" /></font>
</Label>
</children>
</VBox>
<children>
<!-- PAGE TITLE -->
<VBox spacing="4">
<children>
<Label text="Edit Organisation" textFill="#111111">
<font><Font name="System Bold" size="32" /></font>
</Label>
<Label text="Update your organisation's public description." textFill="#8B8B8B">
<font><Font size="24" /></font>
</Label>
</children>
</VBox>

<VBox spacing="8">
<children>
<Label text="Description" textFill="#444444">
<font><Font name="System Regular" size="13" /></font>
</Label>
<TextArea fx:id="descriptionField"
prefHeight="180"
promptText="Write a description of your organisation..."
style="-fx-background-color: #FFFFFF;
-fx-border-color: #DDDDDD;
-fx-border-radius: 10;
-fx-background-radius: 10;
-fx-font-size: 14px;
-fx-padding: 10;"
wrapText="true" />
<Button onAction="#handleSaveDescription"
text="Save Description"
style="-fx-padding: 8 20 8 20;">
<cursor><Cursor fx:constant="HAND" /></cursor>
</Button>
</children>
</VBox>
<!-- HEADER CARD (read-only) -->
<VBox spacing="8">
<children>
<Label text="Organisation Name" textFill="#444444">
<font><Font name="System Regular" size="13" /></font>
</Label>
<StackPane>
<children>
<Rectangle arcHeight="12" arcWidth="12" fill="#EEEEEE" height="60" width="780" />
<Label fx:id="charityNameLabel2" style="-fx-padding: 0 0 0 18;" text="REDD BARNA NORGE" textFill="#888888">
<font><Font name="System Regular" size="20" /></font>
</Label>
</children>
</StackPane>
<Label text="Organisation name can only be changed in Settings." textFill="#AAAAAA">
<font><Font size="11" /></font>
</Label>
</children>
</VBox>

</children>
</VBox>
</content>
</ScrollPane>
<VBox spacing="8">
<children>
<Label text="Description" textFill="#444444">
<font><Font name="System Regular" size="13" /></font>
</Label>
<TextArea fx:id="descriptionField" prefHeight="180" promptText="Write a description of your organisation..." style="-fx-background-color: #FFFFFF; -fx-border-color: #DDDDDD; -fx-border-radius: 10; -fx-background-radius: 10; -fx-font-size: 14px; -fx-padding: 10;" wrapText="true" />
<Button onAction="#handleSaveDescription" style="-fx-padding: 8 20 8 20;" text="Save Description">
<cursor><Cursor fx:constant="HAND" /></cursor>
</Button>
</children>
</VBox>

</children>
</VBox>
</content>
</ScrollPane>
</center>
</BorderPane>
<rowConstraints>
<RowConstraints />
<RowConstraints />
<RowConstraints />
</rowConstraints>
</GridPane>
</GridPane>

0 comments on commit b4b1b13

Please sign in to comment.