diff --git a/client/app/src/main/java/users/EditUserController.java b/client/app/src/main/java/users/EditUserController.java new file mode 100644 index 0000000..f6d45af --- /dev/null +++ b/client/app/src/main/java/users/EditUserController.java @@ -0,0 +1,56 @@ +package users; + +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.Node; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.control.ToggleButton; +import javafx.scene.paint.Paint; +import javafx.stage.Stage; +import java.util.Objects; + +public class EditUserController { + + public TextField textName; + public TextField textPassword; + public TextField textPasswordSecond; + public ToggleButton checkButtonIsAdmin; + public TextField textLogin; + public TextField textForename; + public Label labelError; + + @FXML + public void saveUser(ActionEvent event) { + labelError.setTextFill(Paint.valueOf("Red")); + if (textLogin.getText().trim().isEmpty()){ + labelError.setText("Bitte Login Namen angeben"); + return; + } + if (textForename.getText().trim().isEmpty()) { + labelError.setText("Bitte Vornamen eingeben!"); + return; + } + if (textName.getText().trim().isEmpty()) { + labelError.setText("Bitte Nachnamen eingeben!"); + return; + } + if (textPassword.getText().trim().isEmpty()) { + labelError.setText("Bitte Passwort eingeben!"); + return; + } + if (!Objects.equals(textPassword.getText(), textPasswordSecond.getText())){ + labelError.setText("Passwörter stimmen nicht überein!"); + return; + } + + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.close(); + } + + @FXML + public void abortBtnClick(ActionEvent event) { + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.close(); + } +} diff --git a/client/app/src/main/resources/users/edit-user.css b/client/app/src/main/resources/users/edit-user.css new file mode 100644 index 0000000..060b8fa --- /dev/null +++ b/client/app/src/main/resources/users/edit-user.css @@ -0,0 +1,59 @@ +* { + -fx-base-background-color: #2B2D42; + -fx-base1-background-color: #525E74; + + -fx-main-border-color: #B0B0B0; + -fx-main-text-color: #ffffff; +} + + +GridPane{ + -fx-background-color: #3E415F; + -fx-padding: 20px; + -fx-font-size: 20px; + -fx-font-family: Segoe UI; + + -fx-border-insets: 1; + -fx-border-color: #B0B0B0; + -fx-border-style: solid; + -fx-border-width: 2; + -fx-effect: dropshadow(three-pass-box, rgba(100, 100, 100, 1), 24, 0.5, 0, 0); +} + +.mainLabel{ + -fx-padding: 10px; + -fx-max-width: 400px; + -fx-min-width: 400px; + -fx-font-weight: bold; + -fx-alignment: top-center; +} + + +Label{ + -fx-text-fill: white; + -fx-max-width: 150px; + -fx-min-width: 150px; +} + +.textField{ + -fx-max-width: 400px; + -fx-min-width: 400px; +} + +.errorMessage{ + -fx-font-weight: bold; + -fx-max-width: 200px; + -fx-text-fill: #ff5555; + -fx-font-size: 16px; + -fx-max-width: 400px; + -fx-min-width: 400px; +} + +Button{ + -fx-max-width: 150px; + -fx-min-width: 150px; +} + +.btnLogin{ + -fx-font-weight: bold; +} \ No newline at end of file diff --git a/client/app/src/main/resources/users/edit-user.fxml b/client/app/src/main/resources/users/edit-user.fxml new file mode 100644 index 0000000..b3a78ce --- /dev/null +++ b/client/app/src/main/resources/users/edit-user.fxml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +