diff --git a/schoolapps/aub/templates/aub/apply_for.html b/schoolapps/aub/templates/aub/apply_for.html index 1baa3d55e8ada3cbd50390acaf902816b794edf0..f67cfa723463bd0c2933e66d41ab805f0f794ff7 100755 --- a/schoolapps/aub/templates/aub/apply_for.html +++ b/schoolapps/aub/templates/aub/apply_for.html @@ -3,18 +3,51 @@ <main> + <script> + function setTime(lesson_field) { + // fill timefield based on lesson value + if (lesson_field.id === 'id_from_lesson') { + $('[id=id_from_time]').val(lesson_field.value); + } else { + // calculate lessons end time + // string methods easier than date function muddle + var h = lesson_field.value.split(':')[0]; + var m = lesson_field.value.split(':')[1]; + if (m < 15) { + m = parseInt(m) + 45; + } else { + m = parseInt(m) - 15; + h = parseInt(h) + 1; + } + m = m.toString(); + h = h.toString(); + if (m.length === 1) { + m = '0' + m + } + var newTime = h + ':' + m; + $('[id=id_to_time]').val(newTime); + } + } + </script> + <h4>Antrag auf Unterrichtsbefreiung</h4> - <form method = "POST" > + <form method="POST"> {% csrf_token %} -{# Von#} -{# <input type="text" label="Von" input_formats=['%d.%m.%Y'] value="{{ from_dt }}" name="from_date" >#} + {# Von#} + {# <input type="text" label="Von" input_formats=['%d.%m.%Y'] value="{{ from_dt }}" name="from_date" >#} {% form form=form %} {% endform %} <button type="submit" class="waves-effect waves-light btn green"> <i class="material-icons left">send</i> Antrag stellen </button> </form> + <script> + $("#id_from_date").change(function () { + $("#id_to_date").val($("#id_from_date").val()); + $("#id_to_date").change(); + }) + </script> </main> {% include 'partials/footer.html' %} diff --git a/schoolapps/aub/views.py b/schoolapps/aub/views.py index d3d2e7c34a220d6f8238aa18ad2cd78bb53ca7ed..ba1a759e7cd7b711d3da9ee0a2058375d98c798e 100755 --- a/schoolapps/aub/views.py +++ b/schoolapps/aub/views.py @@ -142,7 +142,7 @@ def check1(request): link=request.build_absolute_uri(reverse('aub_details', args=[aub.id])) ) - aub_list = Aub.objects.filter(status=0).order_by('created_at') + aub_list = Aub.objects.filter(status=0).order_by('from_date') aubs = AUBFilter(request.GET, queryset=aub_list) return render(request, 'aub/check.html', {'filter': aubs}) @@ -186,7 +186,7 @@ def check2(request): link=request.build_absolute_uri(reverse('aub_details', args=[aub.id])) ) - aub_list = Aub.objects.filter(status=1).order_by('created_at') + aub_list = Aub.objects.filter(status=1).order_by('from_date') aubs = AUBFilter(request.GET, queryset=aub_list) return render(request, 'aub/check.html', {'filter': aubs}) diff --git a/schoolapps/dashboard/views.py b/schoolapps/dashboard/views.py index f7ca6d31c51436ae160515e966b44f5b28e3f3e9..d98d001079bf4fa97244c9c696520b79e5252a85 100755 --- a/schoolapps/dashboard/views.py +++ b/schoolapps/dashboard/views.py @@ -1,6 +1,7 @@ from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.urls import reverse +from django.http import HttpResponseNotFound from .models import Activity, register_notification # from .apps import DashboardConfig from mailer import send_mail_with_template @@ -53,4 +54,4 @@ def test_notification(request): def error_404(request, exception): - return render(request, 'common/404.html') + return render(request, 'common/404.html') \ No newline at end of file diff --git a/schoolapps/debug/migrations/0003_auto_20190818_0910.py b/schoolapps/debug/migrations/0003_auto_20190818_0910.py new file mode 100644 index 0000000000000000000000000000000000000000..a21678f276bb0834100127ef13f870aba02802da --- /dev/null +++ b/schoolapps/debug/migrations/0003_auto_20190818_0910.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.1 on 2019-08-18 07:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('debug', '0002_auto_20190523_1627'), + ] + + operations = [ + migrations.AlterField( + model_name='debuglog', + name='filename', + field=models.FilePathField(blank=True, match='.*.log', path='/home/p-h/git/school-apps/schoolapps/latex', verbose_name='Dateiname zur Logdatei (falls nicht Log-Text)'), + ), + ] diff --git a/schoolapps/debug/migrations/0004_auto_20190916_1450.py b/schoolapps/debug/migrations/0004_auto_20190916_1450.py new file mode 100644 index 0000000000000000000000000000000000000000..f0905c799ba5552647595bfa2e8a4cc7d7b44c9c --- /dev/null +++ b/schoolapps/debug/migrations/0004_auto_20190916_1450.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.4 on 2019-09-16 12:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('debug', '0003_auto_20190818_0910'), + ] + + operations = [ + migrations.AlterField( + model_name='debuglog', + name='filename', + field=models.FilePathField(blank=True, match='.*.log', path='/data/Silas/Daten/school-apps/schoolapps/latex', verbose_name='Dateiname zur Logdatei (falls nicht Log-Text)'), + ), + ] diff --git a/schoolapps/faq/urls.py b/schoolapps/faq/urls.py index 4c69deccba7ed34b4609d7cf1dbba9d99fb9c7fe..7af26253076537486ba5325d87208989e0662eb2 100644 --- a/schoolapps/faq/urls.py +++ b/schoolapps/faq/urls.py @@ -4,4 +4,4 @@ from . import views urlpatterns = [ path('', views.faq, name='faq'), path('ask', views.ask, name='ask-faq') -] \ No newline at end of file +] diff --git a/schoolapps/faq/views.py b/schoolapps/faq/views.py index 3d443dbe07f93957553ad99bf26ae641e3e34bce..9ac63d6600d499f24a420f8a3fdec4ffc5627848 100644 --- a/schoolapps/faq/views.py +++ b/schoolapps/faq/views.py @@ -1,4 +1,5 @@ -from django.shortcuts import render +from django.shortcuts import render, redirect +from django.contrib.auth.decorators import login_required from faq.models import FAQSection, FAQQuestion, Question from faq.forms import FAQForm @@ -20,6 +21,7 @@ def faq(request): } return render(request, 'faq/faq.html', context) +@login_required def ask(request): if request.method == 'POST': form = FAQForm(request.POST) @@ -40,4 +42,4 @@ def ask(request): else: form = FAQForm() - return render(request, "faq/ask.html", {"form": form}) \ No newline at end of file + return render(request, "faq/ask.html", {"form": form}) diff --git a/schoolapps/menu/views.py b/schoolapps/menu/views.py index fc2bfe2452b2ce86bd5da0b82d18aecfb82c298b..ba9effb629313a25564e1ca9f478656c376db87c 100644 --- a/schoolapps/menu/views.py +++ b/schoolapps/menu/views.py @@ -1,5 +1,6 @@ import datetime import os +import time from django.contrib.auth.decorators import login_required, permission_required from django.http import FileResponse @@ -66,6 +67,9 @@ def show_current(request): if days_to_add < 0: days_to_add = days_to_add + 7 + if days_to_add == 6 or days_to_add == 7: + calendar_week += 1 + # Create datetime with next friday and time 14:10 friday = current_date + datetime.timedelta(days=days_to_add) friday_14_10 = timezone.datetime(friday.year, friday.month, friday.day, 14, 10) diff --git a/schoolapps/schoolapps/urls.py b/schoolapps/schoolapps/urls.py index ae826621f5717ddd8499e26e1dee4da287139f5d..1c4e20badfd39f292679eb5c1f021faaade7e4d1 100755 --- a/schoolapps/schoolapps/urls.py +++ b/schoolapps/schoolapps/urls.py @@ -21,6 +21,7 @@ from django.contrib.staticfiles.views import serve from django.urls import path from django.conf.urls.static import static from django.conf import settings +from django.views import defaults from schoolapps.settings import BASE_DIR @@ -32,6 +33,11 @@ def manifest(request): def serviceworker(request): return serve(request, "common/pwabuilder-sw.js") +handler404 = 'dashboard.views.error_404' + +def custom_page_not_found(request): + return defaults.page_not_found(request, None, "common/404.html") + urlpatterns = [ ############# @@ -79,9 +85,13 @@ urlpatterns = [ path("pwabuilder-sw.js", serviceworker), path('martor/', include('martor.urls')), + + ####### + # 404 # + ####### + path('404/', custom_page_not_found, name='404'), ] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -# handler404 = 'dashboard.views.error_404' diff --git a/schoolapps/static/common/helper.js b/schoolapps/static/common/helper.js index 3de288ebc62ae01269819d72e6ca46ccb7978192..235e9e61f6c87828a7e7e182cd8c98ced9d81a87 100644 --- a/schoolapps/static/common/helper.js +++ b/schoolapps/static/common/helper.js @@ -25,38 +25,15 @@ function getNowFormatted() { } -function setTime(lesson_field) { - // fill timefield based on lesson value - if (lesson_field.id === 'id_from_lesson') { - $('[id=id_from_time]').val(lesson_field.value); - } else { - // calculate lessons end time - // string methods easier than date function muddle - var h = lesson_field.value.split(':')[0]; - var m = lesson_field.value.split(':')[1]; - if (m < 15) { - m = parseInt(m) + 45; - } else { - m = parseInt(m) - 15; - h = parseInt(h) + 1; - } - m = m.toString() - h = h.toString() - if (m.length === 1) { - m = '0' + m - } - var newTime = h + ':' + m; - $('[id=id_to_time]').val(newTime); - } -} - function selectActiveLink() { var currlocation = $('meta[name="active-loaction"]'); var url_name = currlocation.attr("content"); //console.log(url_name); - $("#" + url_name).addClass("active"); - $("#" + url_name).parent().parent().parent().addClass("active"); + var selector = ".url-" + url_name; + console.log(selector); + $(selector).addClass("active"); + $(selector).parent().parent().parent().addClass("active"); } $(document).ready(function () { @@ -82,7 +59,7 @@ $(document).ready(function () { // Buttons today: 'Heute', - clear: 'Löschen', + cancel: 'Abbrechen', done: 'OK', }, @@ -95,9 +72,11 @@ $(document).ready(function () { $('.timepicker').timepicker({ twelveHour: false, autoClose: true, - cancelText: 'Abbrechen', - clearText: 'Löschen', - doneText: 'OK' + i18n: { + cancel: 'Abbrechen', + clear: 'Löschen', + done: 'OK' + }, }); // Initialize tooltip [MAT] diff --git a/schoolapps/static/common/style.css b/schoolapps/static/common/style.css index 660d196edebe80f097208f70ed528620d4a1916a..2502164d9053eb39598041d0533ddd6ddfe5a2b6 100755 --- a/schoolapps/static/common/style.css +++ b/schoolapps/static/common/style.css @@ -526,6 +526,9 @@ i.collapsible-trigger { .sidenav a:not(.collapsible-header) { padding: 0 16px; } +ul.sidenav li.logo > a:hover{ + background: None!important; +} .waves-effect.waves-primary .waves-ripple { /* The alpha value allows the text and background color diff --git a/schoolapps/templates/common/404.html b/schoolapps/templates/common/404.html index 5c619890078236f8989f8df78dac7faead109da6..cafec1ca5f3bb9c2ea5ebd1e81fc4bb6e20e4ec6 100755 --- a/schoolapps/templates/common/404.html +++ b/schoolapps/templates/common/404.html @@ -1,14 +1,135 @@ -{% include 'partials/header.html' %} +{#<!DOCTYPE html>#} +{#<html lang="de">#} +{#<head>#} +{# <meta charset="utf-8">#} +{# <meta http-equiv="X-UA-Compatible" content="IE=edge">#} +{# <meta name="viewport" content="width=device-width,initial-scale=1">#} +{# <meta name="description" content="Selbst programmierte Anwendungen für den Schullaltag am Katharineum zu Lübeck">#} +{# <title>SchoolApps – Katharineum zu Lübeck</title>#} +{##} +{# <!-- Android -->#} +{# <meta name="theme-color" content="#da1f3d">#} +{# <meta name="mobile-web-app-capable" content="yes">#} +{##} +{# <!-- iOS -->#} +{# <meta name="apple-mobile-web-app-title" content="SchoolApps">#} +{# <meta name="apple-mobile-web-app-capable" content="yes">#} +{# <meta name="apple-mobile-web-app-status-bar-style" content="default">#} +{##} +{# <!-- Windows -->#} +{# <meta name="msapplication-navbutton-color" content="#da1f3d">#} +{# <meta name="msapplication-TileColor" content="#da1f3d">#} +{# <meta name="msapplication-TileImage" content="ms-icon-144x144.png">#} +{# <meta name="msapplication-config" content="browserconfig.xml">#} +{##} +{# <!-- Pinned Sites -->#} +{# <meta name="application-name" content="SchoolApps">#} +{# <meta name="msapplication-tooltip" content="SchoolApps">#} +{# <meta name="msapplication-starturl" content="/">#} +{##} +{# <!-- Tap highlighting -->#} +{# <meta name="msapplication-tap-highlight" content="no">#} +{##} +{# <!-- UC Mobile Browser -->#} +{# <meta name="full-screen" content="yes">#} +{# <meta name="browsermode" content="application">#} +{##} +{##} +{# <!-- Main Link Tags -->#} +{# <link href="/static/icons/favicon_16.png" rel="icon" type="image/png" sizes="16x16">#} +{# <link href="/static/icons/favicon_32.png" rel="icon" type="image/png" sizes="32x32">#} +{# <link href="/static/icons/favicon_48.pngg" rel="icon" type="image/png" sizes="48x48">#} +{##} +{# <!-- iOS -->#} +{# <!-- non-retina iPad iOS 7 -->#} +{# <link rel="apple-touch-icon" href="/static/icons/apple_76.png" sizes="76x76">#} +{# <!-- retina iPhone vor iOS 7 -->#} +{# <link rel="apple-touch-icon" href="/static/icons/apple_114.png" sizes="114x114">#} +{# <!-- retina iPad iOS 7 -->#} +{# <link rel="apple-touch-icon" href="/static/icons/apple_152.png" sizes="152x152">#} +{# <!-- retina iPad iOS 7 für iPhone 6 Plus -->#} +{# <link rel="apple-touch-icon" href="/static/icons/apple_180.png" sizes="180x180">#} +{##} +{##} +{# <!-- Pinned Tab -->#} +{##} +{##} +{# <!-- Android -->#} +{# <link href="/static/icons/android_192.png" rel="icon" sizes="192x192">#} +{##} +{# <!-- Others -->#} +{##} +{##} +{##} +{# <!-- Favicon -->#} +{# <link rel="shortcut icon" type="image/x-icon" href="/static/common/favicon.ico">#} +{# <link rel="manifest" href="/static/common/manifest.json">#} +{##} +{# <!--------->#} +{# <!-- CSS -->#} +{# <!--------->#} +{# <link href="/static/css/materialdesignicons-webfont/material-icons.css" rel="stylesheet">#} +{# <link rel="stylesheet" type="text/css" media="screen"#} +{# href="/static/css/materialize.min.css">#} +{# <link rel="stylesheet" type="text/css" href="/static/common/style.css">#} +{# <script src="/static/js/jquery/jquery-3.3.1.slim.min.js"></script>#} +{##} +{##} +{# <!-- location (for "active" in sidenav -->#} +{# <meta name="active-loaction" content="404">#} +{##} +{##} +{#</head>#} +{#<body>#} +{##} +{#<header>#} +{# <!-- Menu button (sidenav) -->#} +{# <div class="container">#} +{# <a href="#" data-target="slide-out" class="top-nav sidenav-trigger hide-on-large-only">#} +{# <i class="material-icons">menu</i>#} +{# </a>#} +{# </div>#} +{##} +{# <!-- Nav bar (logged in as, logout) -->#} +{# <nav class="primary-color">#} +{# <a class="brand-logo" href="/">SchoolApps</a>#} +{# </nav>#} +{##} +{# <div id="print-header" class="row">#} +{# <div class="col s6 logo">#} +{# <img src="/static/common/logo.png">#} +{# </div>#} +{# <div class="col s6 right-align">#} +{# <a href="/"><strong>SchoolApps</strong></a><br>#} +{# Katharineum zu Lübeck#} +{# </div>#} +{# </div>#} +{##} +{# <!-- Main nav (sidenav) -->#} +{# <ul id="slide-out" class="sidenav sidenav-fixed">#} +{# <li class="logo">#} +{# <a id="logo-container" href="/" class="brand-logo">#} +{# <img src="/static/common/logo.png" alt="Logo des Katharineums">#} +{# </a>#} +{# </li>#} +{# </ul>#} +{#</header>#} +{% include "partials/header.html" %} <main> <h3>Leider existiert diese Seite nicht. (Fehler 404)</h3> <p class="flow-text"> - Beim Aufrufen dieser Seite ist ein Fehler aufgetreten. Vermutlich existiert sie nicht. Wenn Sie der Meinung - sind, dass diese Seiten eigentlich existieren müsste, wenden Sie sich bitte an den <a - href="mailto:support@katharineum.de">Support</a>. + Beim Aufrufen dieser Seite ist ein Fehler aufgetreten. Wahrscheinlich existiert die gewünschte Seite unter der Adresse "<code id="url"></code>" nicht. + + Solltest du der Meinung sein, dass diese Seite eigentlich existieren müsste, wende dich bitte an die + <a href="mailto:support@katharineum.de">Computer-AG</a>. </p> </main> +<script> + document.getElementById("url").innerHTML = window.location.pathname; +</script> + {% include 'partials/footer.html' %} diff --git a/schoolapps/templates/partials/footer.html b/schoolapps/templates/partials/footer.html index 18e65f2b3818e7ee8045083f94f2147325752451..8b6ba4d64af60f40cb11c5fe9adce70bbd716dbd 100755 --- a/schoolapps/templates/partials/footer.html +++ b/schoolapps/templates/partials/footer.html @@ -5,7 +5,6 @@ <div class="container"> <div class="row no-margin footer-row-large"> <div class="col l6 s12 no-pad-left height-inherit"> -{# <h5 class="white-text">SchoolApps</h5>#} <p class="white-text valign-bot no-margin"> Version 1.0.1-dev "Aebli" · Licensed under <a class="blue-text text-lighten-4" @@ -13,12 +12,13 @@ </p> </div> <div class="col xl15 l6 offset-xl01 s12 no-pad-right"> -{# <h5 class="white-text left">Weitere Webdienste</h5>#} <ul class="no-margin right"> <a class="blue-text text-lighten-4 btn-flat no-pad-left" href="https://katharineum-zu-luebeck.de"><i class="material-icons footer-icon left">home</i> Homepage</a> <a class="blue-text text-lighten-4 btn-flat" href="https://forum.katharineum.de"><i - class="material-icons footer-icon left">cloud</i> Forum</a> + class="material-icons footer-icon left">account_balance</i> Forum</a> + <a class="blue-text text-lighten-4 btn-flat" href="https://nimbus.katharineum.de"><i + class="material-icons footer-icon left">cloud</i> Nimbus</a> <a class="blue-text text-lighten-4 btn-flat no-pad-right" href="https://webmail.katharineum.de"><i class="material-icons footer-icon left">email</i> Webmail</a> </ul> @@ -26,7 +26,7 @@ </div> <div class="row no-margin footer-row-small"> <span class="white-text no-margin make-it-higher"> - Version 1.0.1-dev "Aebli" · + Version 1.0.2-dev "Aebli" · Licensed under <a class="blue-text text-lighten-4" href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">GNU GPL 3.0</a> </span> @@ -34,7 +34,9 @@ <a class="blue-text text-lighten-4 btn-flat no-pad-left" href="https://katharineum-zu-luebeck.de"><i class="material-icons footer-icon left">home</i> Homepage</a> <a class="blue-text text-lighten-4 btn-flat" href="https://forum.katharineum.de"><i - class="material-icons footer-icon left">cloud</i> Forum</a> + class="material-icons footer-icon left">account_balance</i> Forum</a> + <a class="blue-text text-lighten-4 btn-flat" href="https://nimbus.katharineum.de"><i + class="material-icons footer-icon left">cloud</i> Nimbus</a> <a class="blue-text text-lighten-4 btn-flat no-pad-right" href="https://webmail.katharineum.de"><i class="material-icons footer-icon left">email</i> Webmail</a> </ul> @@ -42,11 +44,6 @@ </div> <div class="footer-copyright"> <div class="container"> -{# <span class="left">#} -{# SchoolApps · Version 1.0.1-dev "Aebli" <br>#} -{# © 2018–{% now "Y" %} Computer-AG, Katharineum zu Lübeck ·#} -{# Licensed under <a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">GNU GPL 3.0</a>#} -{# </span>#} <span class="left">© 2018–{% now "Y" %} Computer-AG, Katharineum zu Lübeck</span> <span class="right"> <span id="doit"></span> @@ -60,7 +57,7 @@ </footer> <!----------------> -<!-- JavaScript (jquery v. 3.3.1.slim)--> +<!-- JavaScript (jquery v. 3.4.1.slim)--> <!----------------> <script src="{% static 'common/manup.min.js' %}"></script> <script src="{% static "common/pwabuilder-sw-register.js" %}"></script> diff --git a/schoolapps/templates/partials/header.html b/schoolapps/templates/partials/header.html index eca48aa477bd3a80911623551c051e13e0339e1f..ce6572bcfe5054e9929082c27036e143de795be9 100755 --- a/schoolapps/templates/partials/header.html +++ b/schoolapps/templates/partials/header.html @@ -41,7 +41,7 @@ <!-- Main Link Tags --> <link href="{% static "icons/favicon_16.png" %}" rel="icon" type="image/png" sizes="16x16"> <link href="{% static "icons/favicon_32.png" %}" rel="icon" type="image/png" sizes="32x32"> - <link href="{% static "icons/favicon_48.png" %}g" rel="icon" type="image/png" sizes="48x48"> + <link href="{% static "icons/favicon_48.png" %}" rel="icon" type="image/png" sizes="48x48"> <!-- iOS --> <!-- non-retina iPad iOS 7 --> @@ -131,7 +131,7 @@ </li> {% if user.is_authenticated %} - <li id="dashboard"> + <li class="url-dashboard"> <a href="{% url 'dashboard' %}"> <i class="material-icons">home</i> Dashboard </a> @@ -151,28 +151,28 @@ <div class="collapsible-body"> <ul> {% if perms.aub.apply_for_aub %} - <li id="aub_index"> + <li class="url-aub_index url-aub_details url-ab_edit url-aub_apply_for urlaub_applied_for"> <a href="{% url 'aub_index' %}"><i class="material-icons">business_center</i> Unterrichtsbefreiungen </a> </li> {% endif %} {% if perms.aub.check1_aub %} - <li id="aub_check1"> + <li class="url-aub_check1"> <a href="{% url 'aub_check1' %}"><i class="material-icons">done</i> Anträge genehmigen 1 </a> </li> {% endif %} {% if perms.aub.check2_aub %} - <li id="aub_check2"> + <li class="url-aub_check2"> <a href="{% url 'aub_check2' %}"><i class="material-icons">done_all</i> Anträge genehmigen 2 </a> </li> {% endif %} {% if perms.aub.view_archive %} - <li id="aub_archive"> + <li class="url-aub_archive"> <a href="{% url 'aub_archive' %}"><i class="material-icons">archive</i> Archiv </a> @@ -194,7 +194,7 @@ </a> <div class="collapsible-body"> <ul> - <li id="timetable_my_plan"> + <li class="url-timetable_my_plan"> <a href="{% url 'timetable_my_plan' %}" style="padding-right: 10px;"> <i class="material-icons">person</i> Mein Plan <span class="badge new primary-color sidenav-badge">SMART PLAN</span> @@ -205,25 +205,25 @@ {# <i class="material-icons">grid_on</i> Alle Pläne#} {# </a>#} {# </li>#} - <li id="timetable_quicklaunch"> + <li class="url-timetable_quicklaunch url-timetable_smart_plan url-timetable_regular_plan url-timetable_smart_plan_week"> <a href="{% url 'timetable_quicklaunch' %}"> <i class="material-icons">grid_on</i> Alle Pläne </a> </li> - <li id="timetable_substitutions_date"> + <li class="url-timetable_substitutions_date url-timetable_substitutions"> <a href="{% url 'timetable_substitutions' %}"> <i class="material-icons">update</i> Vertretungsplan </a> </li> {% if perms.timetable.view_hint %} - <li id="timetable_hints"> + <li class="url-timetable_hints url-timetable_add_hint url-timetable_edit_hint url-timetable_delete_hint"> <a href="{% url 'timetable_hints' %}"> <i class="material-icons">announcement</i> Hinweismanagement </a> </li> {% endif %} {% if perms.debug.can_view_debug_log %} - <li id="debug_logs"> + <li class="url-debug_logs url-debug"> <a href="{% url 'debug_logs' %}"> <i class="material-icons">error</i> Debuggingtool </a> @@ -246,7 +246,7 @@ {% if perms.menu.add_menu %} - <li id="menu_index"> + <li class="url-menu_index url-menu_upload url-menu_index_msg"> <a href="{% url 'menu_index' %}"> <i class="material-icons">restaurant_menu</i> Speiseplan hochladen </a> @@ -261,17 +261,17 @@ <a class="collapsible-header waves-effect waves-primary"><i class="material-icons">help</i> Support</a> <div class="collapsible-body"> <ul> - <li id="rebus"> + <li class="url-rebus"> <a href="{% url 'rebus' %}"> <i class="material-icons">bug_report</i> Fehler melden </a> </li> - <li id="feedback"> + <li class="url-feedback"> <a href="{% url 'feedback' %}"> <i class="material-icons">feedback</i> Feedback </a> </li> - <li id="faq"> + <li class="url-faq"> <a href="{% url 'faq' %}"> <i class="material-icons">question_answer</i>FAQ </a> @@ -282,7 +282,7 @@ {% endif %} {% if not user.is_authenticated %} - <li id="faq"> + <li class="url-faq"> <a href="{% url 'faq' %}"> <i class="material-icons">question_answer</i>FAQ </a> @@ -328,7 +328,7 @@ </li> {% else %} - <li id="login"> + <li class="url-login"> <a href="{% url 'login' %}"> <i class="material-icons">lock_open</i> Anmelden </a> diff --git a/schoolapps/timetable/migrations/0010_auto_20190818_0910.py b/schoolapps/timetable/migrations/0010_auto_20190818_0910.py new file mode 100644 index 0000000000000000000000000000000000000000..4b387263b8ab0466decbc59b48f215f23a886a11 --- /dev/null +++ b/schoolapps/timetable/migrations/0010_auto_20190818_0910.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.1 on 2019-08-18 07:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('timetable', '0009_hint_classes_formatted'), + ] + + operations = [ + migrations.AlterField( + model_name='hintclass', + name='class_id', + field=models.IntegerField(), + ), + ] diff --git a/schoolapps/timetable/templates/timetable/latex/room.tex b/schoolapps/timetable/templates/timetable/latex/room.tex index 71429ce5f4ed006147d872fb5968bbb04d3e8359..d9e638217dd324819ace004b28a7e4dd6df34e80 100644 --- a/schoolapps/timetable/templates/timetable/latex/room.tex +++ b/schoolapps/timetable/templates/timetable/latex/room.tex @@ -1,8 +1,8 @@ {% if not sub.is_event %}{% if sub.sub.type == 3 %} {{ sub.sub.corridor.name }} {% elif sub.sub.type == 1 or sub.sub.type == 2 %} -{% elif sub.sub.roow_new and sub.sub.room_old %} -{% templatetag openbrace %}{{ sub.sub.room_old.shortcode }}} +{% elif sub.sub.room_new and sub.sub.room_old %} +\sout{% templatetag openbrace %}{{ sub.sub.room_old.shortcode }}} $\rightarrow$ {{ sub.sub.room_new.shortcode }} {% elif sub.sub.room_new and not sub.sub.room_old %} diff --git a/schoolapps/timetable/templates/timetable/subs/room.html b/schoolapps/timetable/templates/timetable/subs/room.html index 8dd1822a27470e4d47de1b60987b0164d4926e70..70c1afb0fe9d4b7d5c28e74e0f4bbcc500aea0b5 100644 --- a/schoolapps/timetable/templates/timetable/subs/room.html +++ b/schoolapps/timetable/templates/timetable/subs/room.html @@ -4,7 +4,7 @@ {{ sub.sub.corridor.name }} {% elif sub.sub.type == 1 or sub.sub.type == 2 %} {# Canceled lesson: no room #} - {% elif sub.sub.roow_new and sub.sub.room_old %} + {% elif sub.sub.room_new and sub.sub.room_old %} {# New and old room available #} <span class="tooltipped" data-position="bottom" data-tooltip="{{ sub.sub.room_old.name }} → {{ sub.sub.room_new.name }}"> diff --git a/schoolapps/timetable/templates/timetable/substitution.html b/schoolapps/timetable/templates/timetable/substitution.html index 715735e71815ce846fb165dacbad59c0eb95e685..ca5983743f6bd98297899fa2bba601e1b14e0a6f 100755 --- a/schoolapps/timetable/templates/timetable/substitution.html +++ b/schoolapps/timetable/templates/timetable/substitution.html @@ -52,7 +52,7 @@ <h5 class="hide-on-small-and-down">{{ date|date:"l, j. F Y" }}</h5> - <table class="substitutions striped"> + <table class="substitutions striped responsive-table"> <thead> <tr> <th><i class="material-icons">people</i></th> diff --git a/schoolapps/untisconnect/api.py b/schoolapps/untisconnect/api.py index 42b6fe47ec3b000bc9c7b2eaa6ce88885bbe0312..44ecd32cb11a5833822b197897e28222e2ce87ce 100755 --- a/schoolapps/untisconnect/api.py +++ b/schoolapps/untisconnect/api.py @@ -155,6 +155,8 @@ def format_classes(classes): """ classes_as_dict = {} + classes = sorted(classes, key=lambda class_: class_.name) + for _class in classes: step = _class.name[:-1] part = _class.name[-1:] diff --git a/schoolapps/untisconnect/plan.py b/schoolapps/untisconnect/plan.py index 81e1a13c825349f994e470892058114e75f27e42..6e2e68eb994caba864b7b9c6c629c95d4950cfe0 100644 --- a/schoolapps/untisconnect/plan.py +++ b/schoolapps/untisconnect/plan.py @@ -139,9 +139,10 @@ def get_plan(type, id, smart=False, monday_of_week=None): if subs_for_weekday[time.day - 1].get(lesson.id, None) is not None: for sub in subs_for_weekday[time.day - 1][lesson.id]: # ... check whether the sub has the right old teacher and the right lesson number - if sub["sub"].teacher_old.id == element.teacher.id and \ - sub["sub"].lesson == time.hour and sub["table"].is_event is False: - matching_sub = sub + if sub["sub"].teacher_old is not None and element.teacher is not None: + if sub["sub"].teacher_old.id == element.teacher.id and \ + sub["sub"].lesson == time.hour and sub["table"].is_event is False: + matching_sub = sub # If the lesson matches, add it to the list of already added subs if matching_sub: