commit e3c00358411f7e9e52e59e34004b391972080cc5
parent 679388c5c364386f8d23ede1deacb61099b67c5d
Author: Friedel Schön <[email protected]>
Date: Sun, 17 Apr 2022 11:16:17 +0200
formatted html-pages
Diffstat:
12 files changed, 455 insertions(+), 437 deletions(-)
diff --git a/pgmles/__init__.py b/pgmles/__init__.py
@@ -1 +1 @@
-# deze bestand moet er zijn, anders zou Python's leuke module-system niet werken );
-\ No newline at end of file
+# deze bestand moet er zijn, anders zou Python's leuke module-system klagen );
+\ No newline at end of file
diff --git a/pgmles/routes.txt b/pgmles/routes.txt
@@ -1,13 +0,0 @@
-/ -> index.html
-/about -> about.html
-/register -> register.html
-/login -> login.html
-/logout -> /
-/account -> account.html
-/course_overview -> course_overview.html @ teacher/admin
-/course_overview/new_course -> new_course.html / course_overview.html @ teacher/admin
-/course_overview/course_update/:id -> new_course.html / course_overview.html @ teacher/admin
-/course/:id -> / / course.html
-/delete_course/:id -> / @ teacher/admin
-/permissions -> permissions.html @ admin
-/permissions/update/:id -> updatepermissions.html / permissions.html @ admin
diff --git a/pgmles/templates/account.html b/pgmles/templates/account.html
@@ -1,83 +1,83 @@
{% extends "layout.html" %}
{% block content %}
- <div class="content-section">
- <div class="media">
+<div class="content-section">
+ <div class="media">
<img class="rounded-circle account-img" src="{{ image_file }}">
<div class="media-body">
- <h2 class="account-heading">{{ current_user.username }}</h2>
- <p class="text-secondary">{{ current_user.email }}</p>
+ <h2 class="account-heading">{{ current_user.username }}</h2>
+ <p class="text-secondary">{{ current_user.email }}</p>
</div>
- </div>
- <form method="POST" action="" enctype="multipart/form-data">
- {{ form.hidden_tag() }}
- <fieldset class="form-group">
- <legend class="border-bottom mb-4">Informatie</legend>
- <div class="form-group">
- {{ form.username.label(class="form-control-label") }}
+ </div>
+ <form method="POST" action="" enctype="multipart/form-data">
+ {{ form.hidden_tag() }}
+ <fieldset class="form-group">
+ <legend class="border-bottom mb-4">Informatie</legend>
+ <div class="form-group">
+ {{ form.username.label(class="form-control-label") }}
- {% if form.username.errors %}
- {{ form.username(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.username.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.username(class="form-control form-control-lg") }}
- {% endif %}
- </div>
- <div class="form-group">
- {{ form.email.label(class="form-control-label") }}
- {% if form.email.errors %}
- {{ form.email(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.email.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.email(class="form-control form-control-lg") }}
- {% endif %}
+ {% if form.username.errors %}
+ {{ form.username(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.username.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- <div class="form-group">
- {{ form.password.label(class="form-control-label") }}
- {% if form.password.errors %}
- {{ form.password(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.password.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.password(class="form-control form-control-lg") }}
- {% endif %}
+ {% else %}
+ {{ form.username(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
+ <div class="form-group">
+ {{ form.email.label(class="form-control-label") }}
+ {% if form.email.errors %}
+ {{ form.email(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.email.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- <div class="form-group">
- {{ form.confirm_password.label(class="form-control-label") }}
- {% if form.confirm_password.errors %}
- {{ form.confirm_password(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.confirm_password.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.confirm_password(class="form-control form-control-lg") }}
- {% endif %}
+ {% else %}
+ {{ form.email(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
+ <div class="form-group">
+ {{ form.password.label(class="form-control-label") }}
+ {% if form.password.errors %}
+ {{ form.password(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.password.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- <div class="form-group">
- {{ form.picture.label() }}
- {{ form.picture(class="form-control-file") }}
- {% if form.picture.errors %}
- {% for error in form.picture.errors %}
- <span class="text-danger">{{ error }}</span></br>
- {% endfor %}
- {% endif %}
+ {% else %}
+ {{ form.password(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
+ <div class="form-group">
+ {{ form.confirm_password.label(class="form-control-label") }}
+ {% if form.confirm_password.errors %}
+ {{ form.confirm_password(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.confirm_password.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- </fieldset>
+ {% else %}
+ {{ form.confirm_password(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
<div class="form-group">
- {{ form.submit(class="btn btn-outline-info") }}
+ {{ form.picture.label() }}
+ {{ form.picture(class="form-control-file") }}
+ {% if form.picture.errors %}
+ {% for error in form.picture.errors %}
+ <span class="text-danger">{{ error }}</span></br>
+ {% endfor %}
+ {% endif %}
</div>
- </form>
- </div>
-{% endblock content %}
+ </fieldset>
+ <div class="form-group">
+ {{ form.submit(class="btn btn-outline-info") }}
+ </div>
+ </form>
+</div>
+{% endblock content %}
+\ No newline at end of file
diff --git a/pgmles/templates/admin.html b/pgmles/templates/admin.html
@@ -1,27 +1,27 @@
{% extends "layout.html" %}
{% block content %}
- <h1>Rechten bewerken!</h1>
- <div class="content-section">
- <form method="POST" action="">
- {{ form.hidden_tag() }}
- <fieldset class="form-group">
- <legend class="border-bottom mb-4">Zoeken</legend>
- <div class="form-group">
- {{ form.username.label(class="form-control-label") }}
- {% if form.username.errors %}
- {{ form.username(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.username.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.username(class="form-control form-control-lg") }}
- {% endif %}
- </div>
- </fieldset>
+<h1>Rechten bewerken!</h1>
+<div class="content-section">
+ <form method="POST" action="">
+ {{ form.hidden_tag() }}
+ <fieldset class="form-group">
+ <legend class="border-bottom mb-4">Zoeken</legend>
<div class="form-group">
- {{ form.submit(class="btn btn-outline-info") }}
+ {{ form.username.label(class="form-control-label") }}
+ {% if form.username.errors %}
+ {{ form.username(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.username.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
+ {% else %}
+ {{ form.username(class="form-control form-control-lg") }}
+ {% endif %}
</div>
- </div>
-{% endblock content %}
+ </fieldset>
+ <div class="form-group">
+ {{ form.submit(class="btn btn-outline-info") }}
+ </div>
+</div>
+{% endblock content %}
+\ No newline at end of file
diff --git a/pgmles/templates/admin_user.html b/pgmles/templates/admin_user.html
@@ -1,54 +1,57 @@
{% extends "layout.html" %}
{% block content %}
- <div class="media">
- <img class="rounded-circle account-img" src="{{ image_file }}">
- <div class="media-body">
+<div class="media">
+ <img class="rounded-circle account-img" src="{{ image_file }}">
+ <div class="media-body">
<h2 class="account-heading">{{ user.username }}</h2>
<p class="text-secondary">{{ user.email }}</p>
- </div>
</div>
- <form method="POST" action="">
- {{ form.hidden_tag() }}
- <fieldset class="form-group">
- <legend class="border-bottom mb-4">Rechten bewerken!</legend>
- <div class="form-group">
- {{ form.type.label(class="form-control-label") }}
- {% if form.type.errors %}
- {{ form.type(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.type.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.type(class="form-control form-control-lg") }}
- {% endif %}
- </div>
- </fieldset>
+</div>
+<form method="POST" action="">
+ {{ form.hidden_tag() }}
+ <fieldset class="form-group">
+ <legend class="border-bottom mb-4">Rechten bewerken!</legend>
<div class="form-group">
- <button type="button" class="btn btn-danger btn-sm m-1" data-toggle="modal" data-target="#deleteModal">Verwijderen</button>
- <a class="btn btn-danger btn-sm m-1" href="{{ url_for('reset_user', user_id=user.id) }}">Wachtwoord terugzetten</a>
- <br><br>
- {{ form.submit(class="btn btn-outline-info") }}
+ {{ form.type.label(class="form-control-label") }}
+ {% if form.type.errors %}
+ {{ form.type(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.type.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
+ {% else %}
+ {{ form.type(class="form-control form-control-lg") }}
+ {% endif %}
</div>
- </form>
- <!-- Modal -->
- <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
+ </fieldset>
+ <div class="form-group">
+ <button type="button" class="btn btn-danger btn-sm m-1" data-toggle="modal"
+ data-target="#deleteModal">Verwijderen</button>
+ <a class="btn btn-danger btn-sm m-1" href="{{ url_for('reset_user', user_id=user.id) }}">Wachtwoord
+ terugzetten</a>
+ <br><br>
+ {{ form.submit(class="btn btn-outline-info") }}
+ </div>
+</form>
+<!-- Modal -->
+<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel"
+ aria-hidden="true">
<div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="deleteModalLabel">Profiel verwijderen?</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Sluiten</button>
- <form action="{{ url_for('delete_user', user_id=user.id) }}" method="POST">
- <input class="btn btn-danger" type="submit" value="Delete">
- </form>
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title" id="deleteModalLabel">Profiel verwijderen?</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">×</span>
+ </button>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Sluiten</button>
+ <form action="{{ url_for('delete_user', user_id=user.id) }}" method="POST">
+ <input class="btn btn-danger" type="submit" value="Delete">
+ </form>
+ </div>
</div>
- </div>
</div>
- </div>
+</div>
{% endblock content %}
\ No newline at end of file
diff --git a/pgmles/templates/course.html b/pgmles/templates/course.html
@@ -1,35 +1,37 @@
{% extends "layout.html" %}
{% block content %}
- <article class="media content-section">
- <div class="media-body">
- <h2><a class="article-title" href="{{url_for('course', course_id=course.id)}}">
- {{ course.name }}
- {{ '(subscribed)' if course.id in subs }}
+<article class="media content-section">
+ <div class="media-body">
+ <h2><a class="article-title" href="{{url_for('course', course_id=course.id)}}">
+ {{ course.name }}
+ {{ '(subscribed)' if course.id in subs }}
</a></h2>
- <p><i>{{ course.description }}</i></p>
- <p>wordt gegeven door {% for teacher in teachers if teacher.id == course.teacher_id %}{{ teacher.username }},{% endfor %}</p>
- <p>elke {{ ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'][course.weekday] }} {{ course.start }} uur t/m {{ course.end }} uur op locatie: <b>{{ course.location }}</b></p>
- </div>
- <div class="article-metadata">
- {% if current_user.is_authenticated %}
- {% if not subscribed %}
- <form method="POST" action="">
- {{ sub_form.hidden_tag() }}
- <div class="form-group">
- {{ sub_form.submit(class="btn btn-outline-info") }}
- </div>
- </form>
- {% else %}
- <form method="POST" action="">
- {{ unsub_form.hidden_tag() }}
- <div class="form-group">
- {{ unsub_form.submit(class="btn btn-outline-info") }}
- </div>
- </form>
- {%endif%}
- {% else %}
- <p><a href="{{ url_for('login') }}">Inloggen om in te schrijven</a></p>
- {% endif %}
- </div>
- </article>
-{% endblock content %}
+ <p><i>{{ course.description }}</i></p>
+ <p>wordt gegeven door {% for teacher in teachers if teacher.id == course.teacher_id %}{{ teacher.username }},{%
+ endfor %}</p>
+ <p>elke {{ ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'][course.weekday] }}
+ {{ course.start }} uur t/m {{ course.end }} uur op locatie: <b>{{ course.location }}</b></p>
+ </div>
+ <div class="article-metadata">
+ {% if current_user.is_authenticated %}
+ {% if not subscribed %}
+ <form method="POST" action="">
+ {{ sub_form.hidden_tag() }}
+ <div class="form-group">
+ {{ sub_form.submit(class="btn btn-outline-info") }}
+ </div>
+ </form>
+ {% else %}
+ <form method="POST" action="">
+ {{ unsub_form.hidden_tag() }}
+ <div class="form-group">
+ {{ unsub_form.submit(class="btn btn-outline-info") }}
+ </div>
+ </form>
+ {%endif%}
+ {% else %}
+ <p><a href="{{ url_for('login') }}">Inloggen om in te schrijven</a></p>
+ {% endif %}
+ </div>
+</article>
+{% endblock content %}
+\ No newline at end of file
diff --git a/pgmles/templates/course_overview.html b/pgmles/templates/course_overview.html
@@ -6,15 +6,19 @@
{% for course, teacher in courses %}
<article class="media content-section">
<div class="media-body">
- <h2><a class="article-title" href="{{url_for('course', course_id=course.id)}}">{{course.name}} <small>by {{ teacher.username }}</small></a></h2>
+ <h2><a class="article-title" href="{{url_for('course', course_id=course.id)}}">{{course.name}} <small>by {{
+ teacher.username }}</small></a></h2>
<div>
- <a class="btn btn-secondary btn-sm mt-1 mb-1" href="{{ url_for('update_course', course_id = course.id) }}">Bewerkem</a>
- <button type="button" class="btn btn-danger btn-sm m-1" data-toggle="modal" data-target="#deleteModal">Verwijderen</button>
+ <a class="btn btn-secondary btn-sm mt-1 mb-1"
+ href="{{ url_for('update_course', course_id = course.id) }}">Bewerkem</a>
+ <button type="button" class="btn btn-danger btn-sm m-1" data-toggle="modal"
+ data-target="#deleteModal">Verwijderen</button>
</div>
</div>
</article>
- <!-- Modal -->
-<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
+<!-- Modal -->
+<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel"
+ aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -33,4 +37,4 @@
</div>
</div>
{% endfor %}
-{% endblock content %}
+{% endblock content %}
+\ No newline at end of file
diff --git a/pgmles/templates/index.html b/pgmles/templates/index.html
@@ -1,32 +1,32 @@
{% extends "layout.html" %}
{% block content %}
<article class="media content-section">
- <div class="media-body">
- <h2>Dit zijn ons lessen</h2>
- <p>
- U kan makkelijk op de titel van een les klikken om in te schrijven!
- </p>
- </div>
+ <div class="media-body">
+ <h2>Dit zijn ons lessen</h2>
+ <p>
+ U kan makkelijk op de titel van een les klikken om in te schrijven!
+ </p>
+ </div>
</article>
{% for course in courses %}
<article class="media content-section">
- <div class="media-body">
- <h3><a class="article-title" href="{{url_for('course', course_id=course.id)}}">
- {{ course.name }}
- {{ '(subscribed)' if course.id in subs }}
- </a></h3>
- <p><i>{{ course.description }}</i></p>
- <p>
- wordt gegeven door
- {% for teacher in teachers if teacher.id == course.teacher_id %}
- {{ teacher.username }},
- {% endfor %}
- </p>
- <p>
- elke {{ ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'][course.weekday] }}
- {{ course.start }} uur t/m {{ course.end }} uur op locatie: <b>{{ course.location }}</b>
- </p>
- </div>
+ <div class="media-body">
+ <h3><a class="article-title" href="{{url_for('course', course_id=course.id)}}">
+ {{ course.name }}
+ {{ '(subscribed)' if course.id in subs }}
+ </a></h3>
+ <p><i>{{ course.description }}</i></p>
+ <p>
+ wordt gegeven door
+ {% for teacher in teachers if teacher.id == course.teacher_id %}
+ {{ teacher.username }},
+ {% endfor %}
+ </p>
+ <p>
+ elke {{ ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'][course.weekday] }}
+ {{ course.start }} uur t/m {{ course.end }} uur op locatie: <b>{{ course.location }}</b>
+ </p>
+ </div>
</article>
{% endfor %}
{% endblock content %}
\ No newline at end of file
diff --git a/pgmles/templates/layout.html b/pgmles/templates/layout.html
@@ -1,97 +1,110 @@
<!DOCTYPE html>
<html>
+
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
+ integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css') }}">
{% if title %}
- <title>Programmeerles voor ouderen - {{ title }}</title>
+ <title>Programmeerles voor ouderen - {{ title }}</title>
{% else %}
- <title>Programmeerles voor ouderen</title>
+ <title>Programmeerles voor ouderen</title>
{% endif %}
</head>
+
<body>
<header class="site-header">
- <nav class="navbar navbar-expand-md navbar-dark bg-steel fixed-top">
- <div class="container">
- <a class="navbar-brand mr-4" href="/">Programmeerles voor ouderen</a>
- <div class="collapse navbar-collapse" id="navbarToggle">
- <div class="navbar-nav mr-auto">
- <a class="nav-item nav-link" href="/about">Over ons</a>
- </div>
- <!-- Navbar Right Side -->
- <div class="navbar-nav">
- {% if current_user.is_authenticated %}
- <a class="nav-item nav-link" href="{{ url_for('logout') }}">Uitloggen</a>
- {% else %}
- <a class="nav-item nav-link" href="{{ url_for('login') }}">Inloggen</a>
- <a class="nav-item nav-link" href="{{ url_for('register') }}">Registeren</a>
- {% endif %}
+ <nav class="navbar navbar-expand-md navbar-dark bg-steel fixed-top">
+ <div class="container">
+ <a class="navbar-brand mr-4" href="/">Programmeerles voor ouderen</a>
+ <div class="collapse navbar-collapse" id="navbarToggle">
+ <div class="navbar-nav mr-auto">
+ <a class="nav-item nav-link" href="/about">Over ons</a>
+ </div>
+ <!-- Navbar Right Side -->
+ <div class="navbar-nav">
+ {% if current_user.is_authenticated %}
+ <a class="nav-item nav-link" href="{{ url_for('logout') }}">Uitloggen</a>
+ {% else %}
+ <a class="nav-item nav-link" href="{{ url_for('login') }}">Inloggen</a>
+ <a class="nav-item nav-link" href="{{ url_for('register') }}">Registeren</a>
+ {% endif %}
+ </div>
+ </div>
</div>
- </div>
- </div>
- </nav>
+ </nav>
</header>
<main role="main" class="container">
- <div class="row">
- <div class="col-md-8">
- {% with messages = get_flashed_messages(with_categories=true) %}
- {% if messages %}
- {% for category, message in messages %}
+ <div class="row">
+ <div class="col-md-8">
+ {% with messages = get_flashed_messages(with_categories=true) %}
+ {% if messages %}
+ {% for category, message in messages %}
<div class="alert alert-{{ category }}">
- {{ message }}
+ {{ message }}
</div>
- {% endfor %}
- {% endif %}
- {% endwith %}
- {% block content %}{% endblock %}
- </div>
- <div class="col-md-4">
- <div class="content-section">
- <h3>Welkom <b>{{ current_user.username if current_user.is_authenticated else 'gast' }}</b>!</h3>
- {% if current_user.is_authenticated %}
- <p class='text-muted'>
- <ul class="list-group">
- <li class="list-group-item list-group-item-light"><a href="{{ url_for('account') }}">Instellingen</a></li>
- {% if current_user.type == 'teacher' or current_user.type == 'admin' %}
- <li class="list-group-item list-group-item-light"><a href="{{ url_for('course_overview') }}">Lesoverzicht</a></li>
- {% endif %}
- {% if current_user.type == 'admin' %}
- <li class="list-group-item list-group-item-light"><a href="{{ url_for('admin') }}">Profielen bewerken</a></li>
- {% endif %}
- </ul>
- </p>
- {% endif %}
- <table class='calendar'>
- <tr>
- {% for d, day in calendar['weekdays'] %}
- <th class="{{ 'weekend' if d >= 5 }}">{{ day }}</th>
{% endfor %}
- </tr>
- {% for row in calendar['rows'] %}
- <tr>
- {% for d, day, course in row %}
- <td class="{{ 'weekend' if d >= 5 }} {{ 'course' if course and day }}">
- {{ day if day }}
- {% if course %}<span class='hover-day'>{{ course }}</span>{% endif %}
- </td>
- {% endfor %}
- </tr>
- {% endfor %}
- </table>
- </div>
+ {% endif %}
+ {% endwith %}
+ {% block content %}{% endblock %}
+ </div>
+ <div class="col-md-4">
+ <div class="content-section">
+ <h3>Welkom <b>{{ current_user.username if current_user.is_authenticated else 'gast' }}</b>!</h3>
+ {% if current_user.is_authenticated %}
+ <p class='text-muted'>
+ <ul class="list-group">
+ <li class="list-group-item list-group-item-light"><a
+ href="{{ url_for('account') }}">Instellingen</a></li>
+ {% if current_user.type == 'teacher' or current_user.type == 'admin' %}
+ <li class="list-group-item list-group-item-light"><a
+ href="{{ url_for('course_overview') }}">Lesoverzicht</a></li>
+ {% endif %}
+ {% if current_user.type == 'admin' %}
+ <li class="list-group-item list-group-item-light"><a href="{{ url_for('admin') }}">Profielen
+ bewerken</a></li>
+ {% endif %}
+ </ul>
+ </p>
+ {% endif %}
+ <table class='calendar'>
+ <tr>
+ {% for d, day in calendar['weekdays'] %}
+ <th class="{{ 'weekend' if d >= 5 }}">{{ day }}</th>
+ {% endfor %}
+ </tr>
+ {% for row in calendar['rows'] %}
+ <tr>
+ {% for d, day, course in row %}
+ <td class="{{ 'weekend' if d >= 5 }} {{ 'course' if course and day }}">
+ {{ day if day }}
+ {% if course %}<span class='hover-day'>{{ course }}</span>{% endif %}
+ </td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ </div>
</div>
- </div>
</main>
- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
+ <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
+ integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
+ crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
+ integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
+ crossorigin="anonymous"></script>
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
+ integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
+ crossorigin="anonymous"></script>
</body>
-</html>
+
+</html>
+\ No newline at end of file
diff --git a/pgmles/templates/login.html b/pgmles/templates/login.html
@@ -1,52 +1,52 @@
{% extends "layout.html" %}
{% block content %}
- <div class="content-section">
- <form method="POST" action="">
- {{ form.hidden_tag() }}
- <fieldset class="form-group">
- <legend class="border-bottom mb-4">Inloggen</legend>
- <div class="form-group">
- {{ form.email.label(class="form-control-label") }}
- {% if form.email.errors %}
- {{ form.email(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.email.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.email(class="form-control form-control-lg") }}
- {% endif %}
- </div>
- <div class="form-group">
- {{ form.password.label(class="form-control-label") }}
- {% if form.password.errors %}
- {{ form.password(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.password.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.password(class="form-control form-control-lg") }}
- {% endif %}
- </div>
- <div class="form-check">
- {{ form.remember(class="form-check-input") }}
- {{ form.remember.label(class="form-check-label") }}
+<div class="content-section">
+ <form method="POST" action="">
+ {{ form.hidden_tag() }}
+ <fieldset class="form-group">
+ <legend class="border-bottom mb-4">Inloggen</legend>
+ <div class="form-group">
+ {{ form.email.label(class="form-control-label") }}
+ {% if form.email.errors %}
+ {{ form.email(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.email.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- </fieldset>
+ {% else %}
+ {{ form.email(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
<div class="form-group">
- {{ form.submit(class="btn btn-outline-info") }}
+ {{ form.password.label(class="form-control-label") }}
+ {% if form.password.errors %}
+ {{ form.password(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.password.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
+ {% else %}
+ {{ form.password(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
+ <div class="form-check">
+ {{ form.remember(class="form-check-input") }}
+ {{ form.remember.label(class="form-check-label") }}
</div>
- <small class="text-muted ml-2">
- Wachtwoord vergeten? Neem contact met een administrator.
- </small>
- </form>
- </div>
- <div class="border-top pt-3">
- <small class="text-muted">
- Een profiel nodig? <a class="ml-2" href="{{ url_for('register') }}">Nu inschrijven!</a>
+ </fieldset>
+ <div class="form-group">
+ {{ form.submit(class="btn btn-outline-info") }}
+ </div>
+ <small class="text-muted ml-2">
+ Wachtwoord vergeten? Neem contact met een administrator.
</small>
- </div>
-{% endblock content %}
+ </form>
+</div>
+<div class="border-top pt-3">
+ <small class="text-muted">
+ Een profiel nodig? <a class="ml-2" href="{{ url_for('register') }}">Nu inschrijven!</a>
+ </small>
+</div>
+{% endblock content %}
+\ No newline at end of file
diff --git a/pgmles/templates/new_course.html b/pgmles/templates/new_course.html
@@ -8,92 +8,92 @@
<div class="form-group">
{{ form.name.label(class="form-control-label") }}
{% if form.name.errors %}
- {{ form.name(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.name.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
+ {{ form.name(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.name.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
{% else %}
- {{ form.name(class="form-control form-control-lg") }}
+ {{ form.name(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.description.label(class="form-control-label") }}
{% if form.description.errors %}
- {{ form.description(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.description.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
+ {{ form.description(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.description.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
{% else %}
- {{ form.description(class="form-control form-control-lg") }}
+ {{ form.description(class="form-control form-control-lg") }}
{% endif %}
</div>
- <div class="form-group">
+ <div class="form-group">
{{ form.teacher_id.label(class="form-control-label") }}
{% if form.teacher_id.errors %}
{{ form.teacher_id(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
{% for error in form.teacher_id.errors %}
- <span>{{ error }}</span>
+ <span>{{ error }}</span>
{% endfor %}
</div>
{% else %}
{{ form.teacher_id(class="form-control form-control-lg") }}
- {% endif %}
+ {% endif %}
</div>
<div class="form-group">
{{ form.weekday.label(class="form-control-label") }}
{% if form.weekday.errors %}
- {{ form.weekday(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.weekday.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
+ {{ form.weekday(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.weekday.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
{% else %}
- {{ form.weekday(class="form-control form-control-lg") }}
+ {{ form.weekday(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.start.label(class="form-control-label") }}
{% if form.start.errors %}
- {{ form.start(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.start.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
+ {{ form.start(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.start.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
{% else %}
- {{ form.start(class="form-control form-control-lg") }}
+ {{ form.start(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.end.label(class="form-control-label") }}
{% if form.end.errors %}
- {{ form.end(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.end.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
+ {{ form.end(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.end.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
{% else %}
- {{ form.end(class="form-control form-control-lg") }}
+ {{ form.end(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.location.label(class="form-control-label") }}
{% if form.location.errors %}
- {{ form.location(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.location.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
+ {{ form.location(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.location.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
{% else %}
- {{ form.location(class="form-control form-control-lg") }}
+ {{ form.location(class="form-control form-control-lg") }}
{% endif %}
</div>
</fieldset>
@@ -102,4 +102,4 @@
</div>
</form>
</div>
-{% endblock content %}
+{% endblock content %}
+\ No newline at end of file
diff --git a/pgmles/templates/register.html b/pgmles/templates/register.html
@@ -1,70 +1,71 @@
{% extends "layout.html" %}
{% block content %}
- <div class="content-section">
- <form method="POST" action="">
- {{ form.hidden_tag() }}
- <fieldset class="form-group">
- <legend class="border-bottom mb-4">Nog vandaag meedoen!</legend>
- <div class="form-group">
- {{ form.username.label(class="form-control-label") }}
+<div class="content-section">
+ <form method="POST" action="">
+ {{ form.hidden_tag() }}
+ <fieldset class="form-group">
+ <legend class="border-bottom mb-4">Nog vandaag meedoen!</legend>
+ <div class="form-group">
+ {{ form.username.label(class="form-control-label") }}
- {% if form.username.errors %}
- {{ form.username(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.username.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.username(class="form-control form-control-lg") }}
- {% endif %}
- </div>
- <div class="form-group">
- {{ form.email.label(class="form-control-label") }}
- {% if form.email.errors %}
- {{ form.email(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.email.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.email(class="form-control form-control-lg") }}
- {% endif %}
+ {% if form.username.errors %}
+ {{ form.username(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.username.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- <div class="form-group">
- {{ form.password.label(class="form-control-label") }}
- {% if form.password.errors %}
- {{ form.password(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.password.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.password(class="form-control form-control-lg") }}
- {% endif %}
+ {% else %}
+ {{ form.username(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
+ <div class="form-group">
+ {{ form.email.label(class="form-control-label") }}
+ {% if form.email.errors %}
+ {{ form.email(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.email.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- <div class="form-group">
- {{ form.confirm_password.label(class="form-control-label") }}
- {% if form.confirm_password.errors %}
- {{ form.confirm_password(class="form-control form-control-lg is-invalid") }}
- <div class="invalid-feedback">
- {% for error in form.confirm_password.errors %}
- <span>{{ error }}</span>
- {% endfor %}
- </div>
- {% else %}
- {{ form.confirm_password(class="form-control form-control-lg") }}
- {% endif %}
+ {% else %}
+ {{ form.email(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
+ <div class="form-group">
+ {{ form.password.label(class="form-control-label") }}
+ {% if form.password.errors %}
+ {{ form.password(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.password.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
</div>
- </fieldset>
+ {% else %}
+ {{ form.password(class="form-control form-control-lg") }}
+ {% endif %}
+ </div>
<div class="form-group">
- {{ form.submit(class="btn btn-outline-info") }}
+ {{ form.confirm_password.label(class="form-control-label") }}
+ {% if form.confirm_password.errors %}
+ {{ form.confirm_password(class="form-control form-control-lg is-invalid") }}
+ <div class="invalid-feedback">
+ {% for error in form.confirm_password.errors %}
+ <span>{{ error }}</span>
+ {% endfor %}
+ </div>
+ {% else %}
+ {{ form.confirm_password(class="form-control form-control-lg") }}
+ {% endif %}
</div>
- </form>
- </div>
- <div class="border-top pt-3">
- <small class="text-muted">Heb jij al een account? <a class="ml-2" href="{{ url_for('login') }}">Inloggen!</a></small>
- </div>
-{% endblock content %}
+ </fieldset>
+ <div class="form-group">
+ {{ form.submit(class="btn btn-outline-info") }}
+ </div>
+ </form>
+</div>
+<div class="border-top pt-3">
+ <small class="text-muted">Heb jij al een account? <a class="ml-2"
+ href="{{ url_for('login') }}">Inloggen!</a></small>
+</div>
+{% endblock content %}
+\ No newline at end of file