diff --git a/biscuit/apps/chronos/menus.py b/biscuit/apps/chronos/menus.py index 49c9fb5d5dcaf77bc98b6d320b9ed0ac42a9a1ab..4ac8cff53502f8a79cf776065846e3c76ef3904c 100644 --- a/biscuit/apps/chronos/menus.py +++ b/biscuit/apps/chronos/menus.py @@ -12,11 +12,6 @@ MENUS = { 'name': _('Timetable'), 'url': 'timetable', 'validators': ['menu_generator.validators.is_authenticated'] - }, - { - 'name': _('List of lessons'), - 'url': 'lessons_list', - 'validators': ['menu_generator.validators.is_authenticated'] } ] } diff --git a/biscuit/apps/chronos/templates/chronos/lessons_list.html b/biscuit/apps/chronos/templates/chronos/lessons_list.html deleted file mode 100644 index b51a9c51874b84c8d9c4f9a93bbb7791f57a4bd8..0000000000000000000000000000000000000000 --- a/biscuit/apps/chronos/templates/chronos/lessons_list.html +++ /dev/null @@ -1,42 +0,0 @@ -{# -*- engine:django -*- #} -{% extends "core/base.html" %} -{% load bootstrap4 font_awesome i18n week_helpers %} - -{% block page_title %} - {% blocktrans %}List of lessons{% endblocktrans %}, - {{ week|week_start }} - {{ week|week_end }} -{% endblock %} - -{% block content %} - <form method="get"> - {% csrf_token %} - <ul id="timetable_select_form"> - {{ select_form.as_ul }} - </ul> - <input type="submit" value="Select" /> - </form> - - {% for weekday, lesson_periods_day in lesson_periods %} - <h3>{{ weekday }}</h3> - <table class="table table-striped table-bordered table-hover table-responsive-xl"> - <thead> - <tr> - <th>{% blocktrans %}Period{% endblocktrans %}</th> - <th>{% blocktrans %}Groups{% endblocktans %}</th> - <th>{% blocktrans %}Subject{% endblocktrans %}</th> - <th>{% blocktrans %}Teachers{% endblocktrans %}</th> - </tr> - </thead> - <tbody> - {% for period in lesson_periods_day %} - <tr> - <td>{{ period.period.period }}</td> - <td>{{ period.lesson.subject.name }}</td> - <td>{{ period.lesson.groups|join:', ' }}</td> - <td>{{ period.lesson.teachers|join:', ' }}</td> - </tr> - {% endfor %} - </tbody> - </table> - {% endfor %} -{% endblock %} diff --git a/biscuit/apps/chronos/urls.py b/biscuit/apps/chronos/urls.py index 0f2b804c6eb924b72759a90edd90b22a196bc3bc..fb05d07e00ebd88e0b65580d333d33fce952f568 100644 --- a/biscuit/apps/chronos/urls.py +++ b/biscuit/apps/chronos/urls.py @@ -5,5 +5,4 @@ from . import views urlpatterns = [ path('timetable', views.timetable, name='timetable'), - path('lessons', views.timetable, {'template': 'lessons_list'}, name='lessons_list'), ] diff --git a/biscuit/apps/chronos/views.py b/biscuit/apps/chronos/views.py index acbf0d3477852b4ec536824180ddce8fef102fe6..0e6d69daa5bc9443302874588ec4c33ed3472ea2 100644 --- a/biscuit/apps/chronos/views.py +++ b/biscuit/apps/chronos/views.py @@ -16,7 +16,7 @@ from .util import current_week @login_required -def timetable(request: HttpRequest, template: str = 'tt_week') -> HttpResponse: +def timetable(request: HttpRequest) -> HttpResponse: context = {} lesson_periods = LessonPeriod.objects.all() @@ -32,7 +32,7 @@ def timetable(request: HttpRequest, template: str = 'tt_week') -> HttpResponse: if 'room' in request.GET and request.GET['room']: lesson_periods = lesson_periods.filter( room__pk=int(request.GET['room'])) - elif template == 'tt_week': + else: # Redirect to a selected view if no filter provided if request.user.person: if request.user.person.primary_group: @@ -77,4 +77,4 @@ def timetable(request: HttpRequest, template: str = 'tt_week') -> HttpResponse: context['current_week'] = current_week() context['select_form'] = select_form - return render(request, 'chronos/%s.html' % template, context) + return render(request, 'chronos/tt_week.html', context)