Merge pull request 'Hallo' (#21) from Max into master

Reviewed-on: #21
This commit is contained in:
Samuel Wolff 2024-01-23 15:34:15 +01:00
commit 0300b96bf4
11 changed files with 251 additions and 6 deletions

View File

@ -8,7 +8,7 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -140,7 +140,7 @@ public class BestelluebersichtMitarbeiter {
*/
public void onAbmelden(ActionEvent event) {
VerwaltungApplication.abmelden();
//VerwaltungApplication.abmelden();
}
public void onZurueck(ActionEvent actionEvent) {

View File

@ -0,0 +1,38 @@
package de.subway_surfers.vpr_app;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.paint.Color;
public class ErsteLoginViewController {
@FXML
private Label text;
@FXML
private TextField passwort;
@FXML
private TextField bpasswort;
@FXML
private Label fehlertext;
private String benutzername;
public void initialize(){
benutzername = "Test";
text.setText("Willkommen, "+benutzername+"\n\nUm Sie und Ihre Kinder zu schützen, bitten wir Sie darum Ihr Einmalpasswort zu ändern.");
}
public void onAbmelden(ActionEvent actionEvent) {
VerwaltungApplication.abmelden();
}
public void onbestaetigen(ActionEvent actionEvent) {
if(passwort.getText().equals(bpasswort.getText())){
}
else{
fehlertext.setText("Die Eingaben müssen identisch sein");
fehlertext.setTextFill(Color.color(1, 0, 0));
}
}
}

View File

@ -0,0 +1,17 @@
package de.subway_surfers.vpr_app;
import javafx.event.ActionEvent;
public class EssensverwaltungElternController {
public void onFilter(ActionEvent actionEvent) {}
public void pfeilLinks(ActionEvent actionEvent) {}
public void pfeilRechts(ActionEvent actionEvent) {}
public void onAbmelden(ActionEvent actionEvent) {}
public void onZurueck(ActionEvent actionEvent) {}
}

View File

@ -0,0 +1,61 @@
package de.subway_surfers.vpr_app;
import Logik.Tagesplan;
import RestAPISchnittstelle.RestApiClient;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.scene.text.TextAlignment;
import java.text.DateFormat;
import java.util.Date;
public class HauptmenueElternController {
@FXML
private GridPane wochenplan;
private String date;
private String day;
private String month;
private String year;
public void initialize(){
wochenuebersichtFuellen();
}
public void wochenuebersichtFuellen(){
String dateanzeige;
DateFormat dateFormat = DateFormat.getDateInstance();
date = dateFormat.format(new Date());
date = date.replace('.', '-');
day = date.split("-")[0];
month = date.split("-")[1];
year = date.split("-")[2];
date = String.format("%s-%s-%s", year, month, day);
dateanzeige = String.format("%s.%s.%s",day,month,year);
Tagesplan t = new RestApiClient().getGerichteOnTag(date);
for(int i=0;i<5;i++){
Label tag = new Label();
wochenplan.add(tag, i, 0);
tag.setText(dateanzeige);
for(int j=0; j<t.getGerichte().size();j++){
Label name = new Label();
name.setWrapText(true);
wochenplan.add(name, i, j+1);
name.setText(t.getGerichte().get(j).getName());
name.setPrefHeight(75);
name.setTextAlignment(TextAlignment.CENTER);
}
day = String.valueOf(Integer.parseInt(day)+1);
date = String.format("%s-%s-%s", year, month, day);
dateanzeige = String.format("%s.%s.%s",day,month,year);
t = new RestApiClient().getGerichteOnTag(date);
}
}
public void onAbmelden(ActionEvent actionEvent) {}
public void onBestellungPlanen(ActionEvent actionEvent) {}
public void onBestellhistorieAnzeigen(ActionEvent actionEvent) {}
}

View File

@ -63,7 +63,7 @@ public class HauptmenueMitarbeiterView {
}
public void onAbmelden(ActionEvent actionEvent) {
VerwaltungApplication.abmelden();
//VerwaltungApplication.abmelden();
}
public void onAccountAnlegenClick(ActionEvent actionEvent) {

View File

@ -21,7 +21,7 @@ public class VerwaltungApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(VerwaltungApplication.class.getResource("login-view.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(VerwaltungApplication.class.getResource("essensverwaltung_eltern-view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setWidth(960);

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Erstellt von Max Heer-->
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane prefHeight="400.0" prefWidth="600.0" stylesheets="@layout.css" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.subway_surfers.vpr_app.ErsteLoginViewController">
<top>
<BorderPane styleClass="kopfzeile">
<right>
<Button onAction="#onAbmelden" text="Abmelden" />
</right>
</BorderPane>
</top>
<bottom>
<BorderPane styleClass="button-untenrechts">
<right>
<Button defaultButton="true" onAction="#onbestaetigen" styleClass=".button" text="Bestätigen" />
</right>
</BorderPane>
</bottom>
<left>
<AnchorPane BorderPane.alignment="CENTER">
<children>
<Label fx:id="text" layoutX="27.0" layoutY="34.0" text="Label" />
<Label layoutX="27.0" layoutY="127.0" text="Passwort:" />
<Label layoutX="27.0" layoutY="178.0" text="Passwort bestätigen:" />
<TextField fx:id="passwort" layoutX="175.0" layoutY="122.0" />
<TextField fx:id="bpasswort" layoutX="175.0" layoutY="173.0" />
<Label layoutX="27.0" layoutY="216.0" fx:id="fehlertext"/>
</children></AnchorPane>
</left>
</BorderPane>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Erstellt von Max Heer-->
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="de.subway_surfers.vpr_app.EssensverwaltungElternController"
prefHeight="400.0" prefWidth="600.0"
stylesheets="@layout.css">
<top>
<BorderPane styleClass="kopfzeile">
<right>
<Button text="Abmelden" onAction="#onAbmelden"/>
</right>
<left>
<Button text="Zurück" onAction="#onZurueck"/>
</left>
</BorderPane>
</top>
<center>
<BorderPane>
<top>
<BorderPane>
<left>
<HBox styleClass="test" spacing="10">
<Button text="Filter" onAction="#onFilter"/>
<Label text="Bestellung Planen für: "/>
<ComboBox fx:id="kindAuswahl"/>
</HBox>
</left>
<right>
<HBox styleClass="test" spacing="10">
<Button styleClass="pfeil, links" onAction="#pfeilLinks"/>
<Label fx:id="dateLabel"/>
<Button styleClass="pfeil" onAction="#pfeilRechts"/>
</HBox>
</right>
</BorderPane>
</top>
<center>
<AnchorPane>
<GridPane fx:id="tagesplan" AnchorPane.bottomAnchor="20" AnchorPane.rightAnchor="20" AnchorPane.leftAnchor="20" AnchorPane.topAnchor="20" >
</GridPane>
</AnchorPane>
</center>
</BorderPane>
</center>
<bottom>
<BorderPane styleClass="button-untenrechts">
<right>
<Button text="Bestätigen" defaultButton="true" styleClass=".button"/>
</right>
</BorderPane>
</bottom>
</BorderPane>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Erstellt von Sven Alteköster-->
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="de.subway_surfers.vpr_app.HauptmenueElternController"
prefHeight="400.0" prefWidth="600.0"
stylesheets="@layout.css">
<top>
<BorderPane styleClass="kopfzeile">
<right>
<Button text="Abmelden" onAction="#onAbmelden"/>
</right>
</BorderPane>
</top>
<center>
<BorderPane styleClass="main">
<left>
<VBox styleClass="hauptmenue_buttons_links">
<Button text="Bestellung Planen" onAction="#onBestellungPlanen"/>
<Button text="Bestellhistorie anzeigen" onAction="#onBestellhistorieAnzeigen"/>
</VBox>
</left>
<right>
<GridPane fx:id="wochenplan" styleClass="hauptmenue_wochenuebersicht"/>
</right>
</BorderPane>
</center>
</BorderPane>

View File

@ -31,8 +31,7 @@
</VBox>
</left>
<right>
<GridPane fx:id="wochenplan" styleClass="hauptmenue_wochenuebersicht">
</GridPane>
<GridPane fx:id="wochenplan" styleClass="hauptmenue_wochenuebersicht"/>
</right>
</BorderPane>
</center>