From a6372086dbe9555a3c9fe9fbd13e9b5d3edee25a Mon Sep 17 00:00:00 2001 From: paulmart-n Date: Thu, 14 Dec 2023 18:49:45 +0100 Subject: [PATCH] Launch prep --- init-sql.sh | 2 +- init.py | 1 - routing.py | 128 ++++++++++----------- static/cal.css | 71 ++++++++++++ static/cal.css.map | 2 +- static/cal.scss | 75 ++++++++++++ static/style.css | 221 ++++++++++++++++++++++-------------- static/style.css.map | 1 + templates/dashboard.html | 22 ++++ templates/index.html | 57 ++++------ templates/kurs.html | 24 ++-- templates/login.html | 37 +++--- templates/noten.html | 23 ++-- templates/plan-anon.html | 3 + templates/plan-general.html | 14 +++ templates/plan-user.html | 4 +- templates/rapla.html | 15 +-- templates/semester.html | 16 +-- 18 files changed, 459 insertions(+), 257 deletions(-) create mode 100644 static/style.css.map create mode 100644 templates/dashboard.html diff --git a/init-sql.sh b/init-sql.sh index 9717c89..5eee76c 100755 --- a/init-sql.sh +++ b/init-sql.sh @@ -1,6 +1,6 @@ #!/bin/sh #Erstellt alle benötigten MySQL-Tabellen. -mysql -e "USE paulmrtn_DUALHUB; CREATE TABLE user ( id int NOT NULL, email VARCHAR(255), password VARCHAR(255), name VARCHAR(255), kurs VARCHAR (15), PRIMARY KEY (ID), UNIQUE (ID, EMAIL) );" +mysql -e "USE paulmrtn_DUALHUB; CREATE TABLE user ( id int NOT NULL, email VARCHAR(255), name VARCHAR(255), kurs VARCHAR (15), PRIMARY KEY (ID), UNIQUE (ID, EMAIL) );" mysql -e "USE paulmrtn_DUALHUB; CREATE TABLE dualis ( uid int NOT NULL, token VARCHAR(255), result_list VARCHAR(15), token_created INT, PRIMARY KEY (uid));" mysql -e "USE paulmrtn_DUALHUB; CREATE TABLE meals ( id int NOT NULL, date date, name VARCHAR(200), vegetarian tinyint(1), vegan tinyint(1), schwein tinyint(1), PRIMARY KEY (id));" diff --git a/init.py b/init.py index f6266e3..7481fd5 100644 --- a/init.py +++ b/init.py @@ -43,7 +43,6 @@ class User(UserMixin, db.Model): """ id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(255), unique=True) - password = db.Column(db.String(255)) name = db.Column(db.String(255)) kurs = db.Column(db.String(15)) diff --git a/routing.py b/routing.py index 26fc63d..305f8dc 100644 --- a/routing.py +++ b/routing.py @@ -25,20 +25,30 @@ def index(): return redirect(url_for("login")) -@app.route("/welcome") +@app.route("/dashboard") @login_required def welcome(): """ - Interim Homepage + Dashboard :return HTML: """ + if not current_user.kurs: + return redirect(url_for("getKurs", next=url_for(request.endpoint))) + sel = request.args.get("sel") + if not sel: + sel="theorie" kurs = current_user.kurs name = current_user.name - return render_template('index.html', headermessage='DualHub', message="Hallo, " - + name + " (" + kurs + ")") + if sel == "theorie": + t = "" + p = "hidden" + else: + t = "hidden" + p = "" + return render_template('dashboard.html', kurs=kurs, name=name, theorie=t, praxis=p) -@app.route("/backendpoc/noten") +@app.route("/theorie/noten") @login_required def displayNoten(): """ @@ -46,6 +56,8 @@ def displayNoten(): :return HTML: """ d = Dualis.query.filter_by(uid=current_user.id).first() + if not d.result_list: + return redirect(url_for("getSemester", next=url_for(request.endpoint))) t = d.token sem = d.result_list c = request.cookies.get("cnsc") @@ -53,10 +65,10 @@ def displayNoten(): if timeout: return timeout res = fetchDUALIS.getResults(t, c, sem) - return render_template("noten.html", noten=res, semester=fetchDUALIS.getSem(t, c), sel=sem) + return render_template("noten.html", noten=res, semester=fetchDUALIS.getSem(t, c), sel=sem, s="n", praxis="hidden") -@app.route("/backendpoc/plan", methods=["GET"]) +@app.route("/plan", methods=["GET"]) @login_required def displayRapla(): """ @@ -64,6 +76,8 @@ def displayRapla(): TODO: Persönliche Filter, Notizen, Essensvorlieben etc. berücksichtigen. :return HTML: """ + if not current_user.kurs: + return redirect(url_for("getKurs", next=url_for(request.endpoint))) week = request.args.get("week") if week: week = datetime.datetime.strptime(week, "%Y-%m-%d") @@ -74,10 +88,11 @@ def displayRapla(): samstag = False events = getWeek(week, fetchRAPLA.getIcal(current_user.kurs), samstag) return render_template("plan-user.html", events=events[0], eventdays=events[1], - name=current_user.name, prev=str(events[2])[:10], next=str(events[3])[:10], mon=events[4]) + name=current_user.name, prev=str(events[2])[:10], next=str(events[3])[:10], mon=events[4], + s="p", praxis="hidden") -@app.route("/backendpoc/plan/") +@app.route("/plan/") def displayPlan(kurs): """ Zeigt den Stundenplan ohne Login an. \n @@ -102,14 +117,13 @@ def displayPlan(kurs): if not samstag: samstag = False events = getWeek(week, plan, samstag) - print(events) return render_template("plan-anon.html", events=events[0], eventdays=events[1], kurs=kurs, prev=str(events[2])[:10], next=str(events[3])[:10], mon=events[4]) else: return redirect(url_for("login")) -@app.route("/backendpoc/set-up") +@app.route("/set-up") def redKurs(): """ Setup beginnt mit Kurs. @@ -118,7 +132,7 @@ def redKurs(): return redirect(url_for("getKurs")) -@app.route("/backendpoc/set-up/kurs") +@app.route("/set-up/kurs") @login_required def getKurs(): """ @@ -147,10 +161,10 @@ def getKurs(): else: e = True kurs = "" - return render_template('kurs.html', detected=(kurs, e)) + return render_template('kurs.html', detected=(kurs, e), s="s", theorie="hidden", praxis="hidden") -@app.route("/backendpoc/set-up/semester") +@app.route("/set-up/semester") @login_required def getSemester(): """ @@ -160,10 +174,10 @@ def getSemester(): t = Dualis.query.filter_by(uid=current_user.id).first().token c = request.cookies.get("cnsc") - return render_template("semester.html", semester=fetchDUALIS.getSem(t, c)) + return render_template("semester.html", semester=fetchDUALIS.getSem(t, c), s="s", theorie="hidden", praxis="hidden") -@app.route("/backendpoc/set-up/semester", methods=["POST"]) +@app.route("/set-up/semester", methods=["POST"]) @login_required def setSemester(): """ @@ -179,7 +193,7 @@ def setSemester(): return redirect(n) -@app.route("/backendpoc/set-up/rapla") +@app.route("/set-up/rapla") @login_required def chooseRaplas(): """ @@ -187,10 +201,10 @@ def chooseRaplas(): :return HTML: """ r = getRaplas() - return render_template("rapla.html", raplas=r) + return render_template("rapla.html", raplas=r, s="s", theorie="hidden", praxis="hidden") -@app.route("/backendpoc/set-up/rapla", methods=["POST"]) +@app.route("/set-up/rapla", methods=["POST"]) @login_required def getRapla(): """ @@ -214,16 +228,16 @@ def getRapla(): return redirect(url_for("welcome")) -@app.route("/backendpoc/log-in") +@app.route("/log-in") def login(): """ Login-Maske. :return HTML: """ - return render_template("login.html") + return render_template("login.html", theorie="hidden", praxis="hidden", s="s") -@app.route("/backendpoc/log-in", methods=["POST"]) +@app.route("/log-in", methods=["POST"]) def login_post(): """ Verarbeitet die Eingabe von login(). \n @@ -240,58 +254,42 @@ def login_post(): success = make_response(redirect(url_for("getKurs"))) user = User.query.filter_by(email=email).first() - newcookie = "" - if user: - dualis = Dualis.query.filter_by(uid=user.id).first() - if check_password_hash(user.password, password): - cookie = request.cookies.get("cnsc") - if not dualis.token or not fetchDUALIS.checkLifetime(dualis.token_created) or not cookie: - new_token = fetchDUALIS.checkUser(email, password) - dualis.token = new_token[0] - newcookie = requesthelpers.getCookie(new_token[1].cookies) - dualis.token_created = time.time() - db.session.commit() - else: - t = fetchDUALIS.checkUser(email, password) - if t[0] == -2: - return redirect(url_for("login", code=-2)) - else: - user.password = generate_password_hash(password, method="pbkdf2:sha256") - dualis.token = t[0] - newcookie = requesthelpers.getCookie(t[1].cookies) - dualis.token_created = time.time() - db.session.commit() - login_user(user) - if user.kurs: - if not n: - success = make_response(redirect(url_for("welcome"))) - success.set_cookie("cnsc", value=newcookie, httponly=True, secure=True) - return success - t = fetchDUALIS.checkUser(email, password) if t[0] == -2: return redirect(url_for("login", code=-2)) + if user: + dualis = Dualis.query.filter_by(uid=user.id).first() + dualis.token = t[0] + newcookie = requesthelpers.getCookie(t[1].cookies) + dualis.token_created = time.time() + db.session.commit() + login_user(user) + if user.kurs: + if not dualis.result_list: + success = make_response(redirect(url_for("getSemester"))) + elif not n: + success = make_response(redirect(url_for("welcome"))) + success.set_cookie("cnsc", value=newcookie, httponly=True, secure=True) - hashid = int(hashlib.sha1(email.encode("utf-8")).hexdigest(), 16) % (10 ** 8) - hashpw = generate_password_hash(password, method="pbkdf2:sha256") - pname = email.find(".") + 1 - ename = min(email[pname:].find("."), email[pname:].find("@")) - name = email[pname:pname + ename].capitalize() - new_user = User(email=email, password=hashpw, name=name, id=hashid) - db.session.add(new_user) + else: + hashid = int(hashlib.sha1(email.encode("utf-8")).hexdigest(), 16) % (10 ** 8) + pname = email.find(".") + 1 + ename = min(email[pname:].find("."), email[pname:].find("@")) + name = email[pname:pname + ename].capitalize() + new_user = User(email=email, name=name, id=hashid) + db.session.add(new_user) - cookie = requesthelpers.getCookie(t[1].cookies) + cookie = requesthelpers.getCookie(t[1].cookies) - new_dualis = Dualis(uid=hashid, token=t[0], token_created=int(time.time())) - db.session.add(new_dualis) - db.session.commit() - login_user(new_user) - newcookie = cookie - success.set_cookie("cnsc", value=newcookie, httponly=True, secure=True) + new_dualis = Dualis(uid=hashid, token=t[0], token_created=int(time.time())) + db.session.add(new_dualis) + db.session.commit() + login_user(new_user) + success.set_cookie("cnsc", value=cookie, httponly=True, secure=True) return success -@app.route("/backendpoc/log-out") +@app.route("/log-out") @login_required def logout(): """ diff --git a/static/cal.css b/static/cal.css index 8d975f3..2d7efd0 100644 --- a/static/cal.css +++ b/static/cal.css @@ -168,6 +168,77 @@ body { font-weight: 100; } +.cs1 { + margin-left: 220px; + padding: 20px; +} + +nav ul { + list-style-type: none; + margin: 0; + padding: 0; + width: 200px; + background-color: #333; + position: fixed; + top: 0; + left: 0; + height: 100%; + overflow-y: auto; +} + +nav li { + border-top: none; +} + +nav li.top { + border-style: solid; + border-radius: 5px; + border-color: white; + margin: 10px; + text-align: center; +} + +nav a.top:hover { + background: transparent; +} + +nav li.start a { + border-top: 3px solid white; + margin-top: 20px; + padding-top: 30px; +} + +nav a.top.selected { + color: red; + background-color: black; +} + +nav li.top.selected { + border-color: red; +} + +nav li a.selected { + background-color: white; + color: black; +} + +nav li a { + display: block; + color: white; + padding: 12px 16px; + text-decoration: none; +} + +nav li a:hover { + background-color: red; +} + +nav li .bottom { + position: absolute; + bottom: 0; + width: 100%; +} + .start-0100 { grid-row-start: 1; } diff --git a/static/cal.css.map b/static/cal.css.map index fe18de1..e6696f0 100644 --- a/static/cal.css.map +++ b/static/cal.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["cal.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAMF;EACE;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;;;AAKF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAQF;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAKA;EACA;;;AAEA;EACA;;;AA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A;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA","file":"cal.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["cal.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAMF;EACE;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;;;AAKF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAKF;EACI;EACA;;;AAIJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACF;;;AAGF;EACI;;;AAG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;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAKA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA;;;AAEA;EACA","file":"cal.css"} \ No newline at end of file diff --git a/static/cal.scss b/static/cal.scss index 4a5187f..53c7421 100644 --- a/static/cal.scss +++ b/static/cal.scss @@ -172,6 +172,81 @@ body { font-weight: 100; } +// Navbar + +.cs1 { + margin-left: 220px; + padding: 20px; +} + + +nav ul { + list-style-type: none; + margin: 0; + padding: 0; + width: 200px; + background-color: #333; + position: fixed; + top: 0; + left: 0; + height: 100%; + overflow-y: auto; +} + +nav li { + border-top: none; +} + +nav li.top { + border-style: solid; + border-radius: 5px; + border-color: white; + margin: 10px; + text-align: center; +} + +nav a.top:hover { + background: transparent; +} + +nav li.start a { + border-top: 3px solid white; + margin-top: 20px; + padding-top: 30px; +} + +nav a.top.selected { + color: red; + background-color: black +} + +nav li.top.selected { + border-color: red; +} + +nav li a.selected { + background-color: white; + color: black +} + +nav li a { + display: block; + color: white; + padding: 12px 16px; + text-decoration: none; +} + +nav li a:hover { + background-color: red; +} + +nav li .bottom { + position: absolute; + bottom: 0; + width: 100%; +} + + // Place on Timeline diff --git a/static/style.css b/static/style.css index 63f5ff3..e562daa 100644 --- a/static/style.css +++ b/static/style.css @@ -1,84 +1,137 @@ -body { - background-color: black; - margin: 0; -} - -nav ul { - list-style-type: none; - margin: 0; - padding: 0; - width: 200px; - background-color: #333; - position: fixed; - top: 0; - left: 0; - height: 100%; - overflow-y: auto; -} - -nav li { - border-top: none; -} - -nav li.start a { - border-top: 3px solid white; -} - -nav li a { - display: block; - color: white; - padding: 12px 16px; - text-decoration: none; - margin-top: 5px; -} - -nav li a:hover { - background-color: red; -} - -.cs1 { - margin-left: 220px; - padding: 20px; -} - -.cs { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - margin-left: 220px; - padding: 20px; -} - - -.container { - display: flex; - flex-direction: column; -} - -/* Reihen */ -.row { - display: flex; - justify-content: center; - margin-bottom: 10px; -} - -.box { - width: 200px; - height: 200px; - border: 2px solid red; - margin: 5px; -} - - -.cs1 h1 { - color: white; -} - -.notification-icon { - position: fixed; - top: 10px; - right: 10px; - width:50px; - -} \ No newline at end of file +:root { + --numBoxes: 2; + --numRows: 2; +} + +body { + background-color: black; + font-family: "Asap", "Calibri", "Arial", sans-serif; + font-size: 150%; + margin: 0; + color: white; +} + +nav ul { + list-style-type: none; + margin: 0; + padding: 0; + width: 200px; + background-color: #333; + position: fixed; + top: 0; + left: 0; + height: 100%; + overflow-y: auto; +} + +nav li { + border-top: none; +} + +nav li.top { + border-style: solid; + border-radius: 5px; + border-color: white; + margin: 10px; + text-align: center; +} + +nav a.top:hover { + background: transparent; +} + +nav li.start a { + border-top: 3px solid white; + margin-top: 20px; + padding-top: 30px; +} + +nav a.top.selected { + color: red; +} + +nav li.top.selected { + border-color: red; +} + +nav li a.selected { + background-color: black; + color: white; +} + +nav li a { + display: block; + color: white; + padding: 12px 16px; + text-decoration: none; +} + +nav li a:hover { + background-color: red; +} + +nav li .bottom { + position: absolute; + bottom: 0; + width: 100%; +} + +.cs1 { + margin-left: 220px; + padding: 20px; +} + +.cs { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + padding: 20px; +} + +.container { + display: flex; + flex-direction: column; +} + +/* Reihen */ +.row { + display: flex; + justify-content: space-evenly; + margin-bottom: 10px; +} + +.box { + width: calc(100% / var(--numBoxes)); + height: 300px; + border: 5px solid red; + margin: 5px; + border-radius: 10px; +} + +.cs1 h1 { + margin-left: 0; +} + +.notification-icon { + position: fixed; + top: 10px; + right: 10px; + width: 50px; +} + +input { + width: 150px; + height: 50px; +} + +input[type=url], input[type=email], input[type=password] { + width: 500px; +} + +select { + width: 200px; + height: 50px; +} + +/*# sourceMappingURL=style.css.map */ diff --git a/static/style.css.map b/static/style.css.map new file mode 100644 index 0000000..a84c854 --- /dev/null +++ b/static/style.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["style.scss"],"names":[],"mappings":"AAAA;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAIJ;EACI;EACA;;;AAGJ;AACA;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAIJ;EACI;;;AAGJ;EACI;EACA;EACA;EACH;;;AAKD;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA","file":"style.css"} \ No newline at end of file diff --git a/templates/dashboard.html b/templates/dashboard.html new file mode 100644 index 0000000..00f76ad --- /dev/null +++ b/templates/dashboard.html @@ -0,0 +1,22 @@ +{% extends "index.html" %} + +{% block content %} +
+

Willkommen, {{ name }} ({{ kurs }})!

+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 76b63dd..ba223de 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,47 +1,36 @@ - DUALHUB👀 - - - + DualHub + + - - -Benachrichtigung -
-
-

Willkommen USER

+
+{% block content %} +{% endblock %}
-
- -
- -
-
-
-
- -
-
-
-
-
-
-
-
- diff --git a/templates/kurs.html b/templates/kurs.html index 826533d..8cfe953 100644 --- a/templates/kurs.html +++ b/templates/kurs.html @@ -1,22 +1,18 @@ - - - - - Kurs wählen - - - - +{% extends "index.html" %} +{% block content %} {% if not detected[1] %}

Wir haben {{ detected[0] }} als deinen Kurs ermittelt. Falls er nicht stimmt, kannst du ihn unten auswählen.

-
- + {% if not request.args.get("next") %} + + {% else %} + + {% endif %} +
{% else %}

Dein Kurs konnte leider nicht ermittelt werden. Klicke den Button, um direkt zur Auswahl zu kommen.

{% endif %} -
+
- - \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/templates/login.html b/templates/login.html index 555fa70..7dd1062 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,22 +1,15 @@ - - - - Log In 👀 - - - - - - - -
-
- - - - - -
-
- - +{% extends "index.html" %} +{% block content %} +
+

Einloggen

+
+
+
+ + + + + +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/noten.html b/templates/noten.html index 800ab8f..9208787 100644 --- a/templates/noten.html +++ b/templates/noten.html @@ -1,15 +1,17 @@ - - - - - Noten - - - - +{% extends "index.html" %} +{% block content %} + {% for i in range (semester|length) %} + {% if semester[i][1]==sel %} +

Deine Noten im {{ semester[i][0] }}

+ {% endif %} + {% endfor %} +
+
{% for i in noten %}

{{ i[0] }}: {{ i[1].capitalize() }} (Credits: {{ i[2] }})

{% endfor %} +
+
- - \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/templates/plan-anon.html b/templates/plan-anon.html index d694304..cb7b836 100644 --- a/templates/plan-anon.html +++ b/templates/plan-anon.html @@ -1,4 +1,7 @@ {% extends "plan-general.html"%} +{% block loginout %} +
  • Log-In
  • +{% endblock %} {% block startcontent %}

    Vorlesungsplan {{ kurs }}

    {% endblock %} diff --git a/templates/plan-general.html b/templates/plan-general.html index 5b1581c..c93b7ea 100644 --- a/templates/plan-general.html +++ b/templates/plan-general.html @@ -6,6 +6,19 @@ + +
    {% block startcontent %} {% endblock %} @@ -64,5 +77,6 @@
    {% block endcontent %} {% endblock %} +
    \ No newline at end of file diff --git a/templates/plan-user.html b/templates/plan-user.html index 943efd3..3c83f01 100644 --- a/templates/plan-user.html +++ b/templates/plan-user.html @@ -1,4 +1,7 @@ {% extends "plan-general.html" %} +{% block loginout %} +
  • Log-Out
  • +{% endblock %} {% block startcontent %}

    {{ name }}s Vorlesungsplan

    {% endblock %} @@ -9,5 +12,4 @@ {% endblock %} {% block endcontent %} - {% endblock %} \ No newline at end of file diff --git a/templates/rapla.html b/templates/rapla.html index 0185479..149f98e 100644 --- a/templates/rapla.html +++ b/templates/rapla.html @@ -1,11 +1,5 @@ - - - - RAPLA importieren 👀 - - - - +{% extends "index.html" %} +{% block content %}

    Verfügbare Raplas

    @@ -20,9 +14,8 @@

    Eigenen Rapla hinzufügen

    - +
    - - +{% endblock %} diff --git a/templates/semester.html b/templates/semester.html index b785a3d..32ea0ab 100644 --- a/templates/semester.html +++ b/templates/semester.html @@ -1,14 +1,7 @@ - - - - - Semester wählen - - - - +{% extends "index.html" %} +{% block content %}

    Bitte wähle aus der unten stehenden Liste das Semester, dessen Noten du sehen möchtest.

    -
    +
    - - \ No newline at end of file +{% endblock %} \ No newline at end of file