Added Submitbutton
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import Button from "@/components/Button";
|
||||
import { baseURL } from "@/components/Constants";
|
||||
import {useRouter} from "next/router";
|
||||
|
||||
export default function SubmitButton() {
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
right: 70,
|
||||
bottom: 20,
|
||||
borderBottomRightRadius: 10,
|
||||
}}
|
||||
>
|
||||
<Button onClick={() => router.push("/submit")} text={"Abgeben"} color={"#77932b"} width={100} height={40} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import {baseURL} from "@/components/Constants";
|
||||
import Button from "@/components/Button";
|
||||
|
||||
export default function SubmitWarning(p){
|
||||
|
||||
async function submit() {
|
||||
let url = baseURL + "/module?sessionid=" + localStorage.getItem("sessionid");
|
||||
|
||||
let json1 = {
|
||||
"id": 0,
|
||||
"userid": localStorage.getItem("userid"),
|
||||
"semesterid": localStorage.getItem("currentsid"),
|
||||
"name": localStorage.getItem("currentmodulename"),
|
||||
"activated": 0
|
||||
}
|
||||
|
||||
await fetch(url, {
|
||||
method: "PUT",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify(json1)
|
||||
})
|
||||
|
||||
p.onClick();
|
||||
p.onClick();
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box-shadow" style={{
|
||||
position: "absolute",
|
||||
top: 300,
|
||||
left: 0,
|
||||
right: 0,
|
||||
borderRadius: 5,
|
||||
textAlign: "center",
|
||||
fontSize: 20,
|
||||
margin: "auto",
|
||||
width: 600
|
||||
|
||||
}}>
|
||||
<p style={{paddingTop: 20, paddingBottom: 5}}>Möchten Sie wirklich abgeben?</p>
|
||||
<p>Danach können Sie keine Änderungen mehr vornehmen!</p>
|
||||
<div style={{
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
justifyContent: "center",
|
||||
paddingTop: 40,
|
||||
paddingBottom: 20
|
||||
}}>
|
||||
<Button onClick={() => submit()} text={"Bestätigen"} color={"#77932b"} width={100} height={40} />
|
||||
<div style={{width: 20}}></div>
|
||||
<Button onClick={() => p.onClick()} text={"Abbrechen"} color={"red"} width={100} height={40} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import InputForm from "@/components/InputForm";
|
||||
import {useRouter} from "next/router";
|
||||
import Logout from "@/components/Logout";
|
||||
import {useEffect} from "react";
|
||||
|
||||
export default function CreateSemester()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ import Back from "@/components/Back";
|
||||
import BasicDateCalendar from "@/components/CalendarSideBar";
|
||||
import {useRouter} from "next/router";
|
||||
import HelpButton from "@/components/HelpButton";
|
||||
import SubmitButton from "@/components/SubmitButton";
|
||||
|
||||
|
||||
export default function planning(p)
|
||||
@@ -18,6 +19,7 @@ export default function planning(p)
|
||||
<HelpButton/>
|
||||
<Background/>
|
||||
<CalenderView/>
|
||||
<SubmitButton />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,13 +1,9 @@
|
||||
import Button from "@/components/Button";
|
||||
import React, {useEffect, useState} from "react";
|
||||
import SemesterTile from "@/components/SemesterTile";
|
||||
import InputForm from "@/components/InputForm";
|
||||
import {useRouter} from "next/router";
|
||||
import PopUp from "@/components/PopUp";
|
||||
import Background from "@/components/Background";
|
||||
import Logout from "@/components/Logout";
|
||||
import {baseURL} from "@/components/Constants"
|
||||
import Back from "@/components/Back";
|
||||
import HelpButton from "@/components/HelpButton";
|
||||
import StatusBar from "@/components/StatusBar";
|
||||
|
||||
@@ -42,6 +38,7 @@ export default function SemesteroverviewLecturer(p) {
|
||||
if (m.target === m.currentTarget) {
|
||||
localStorage.setItem("currentsid", e.semesterid)
|
||||
localStorage.setItem("currentmodulename", e.name)
|
||||
localStorage.setItem("moduleid", e.id)
|
||||
router.push("/planning")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import Logout from "@/components/Logout";
|
||||
import SubmitWarning from "@/components/SubmitWarning";
|
||||
import Back from "@/components/Back";
|
||||
import {useRouter} from "next/router";
|
||||
import Background from "@/components/Background";
|
||||
|
||||
export default function Submit(){
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
return(
|
||||
<div>
|
||||
<Background />
|
||||
<Logout />
|
||||
<SubmitWarning onClick={() => router.back()}/>
|
||||
<Back onClick={() => router.back()}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user