Skip to content
Snippets Groups Projects
Verified Commit f4ac5f44 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Add regular plan

parent 4d60da9e
No related branches found
No related tags found
1 merge request!31Biscuit merge. Closes #53.
......@@ -18,14 +18,13 @@
{% endif %}
{% endif %}
"
{# Add CSS class for sub when it's a sub #}
class="{% if lesson_period.get_substitution %}{% if lesson_period.substitution.table.is_event %}lesson-with-event{% else %}lesson-with-sub{% endif %}{% endif %}"
class="{% if lesson_period.get_substitution and smart %}{% if lesson_period.substitution.table.is_event %}lesson-with-event{% else %}lesson-with-sub{% endif %}{% endif %}"
>
<p>
{% if lesson_period.is_hol %}
{% if lesson_period.is_hol and smart %}
{# Do nothing #}
{% elif lesson_period.get_substitution %}
{% elif lesson_period.get_substitution and smart %}
{% with sub=lesson_period.get_substitution %}
{# SUBSTITUTION #}
{% if type == "room" and lesson_period.room != lesson_period.get_room %}
......
......@@ -67,7 +67,7 @@
<span class="badge new primary-color left smart-plan-badge">SMART PLAN</span>
<a class="waves-effect waves-light btn-flat no-print" style="padding-left: 3px; padding-right: 3px;"
href="#{# url "timetable_regular_plan" raw_type id "regular" #}">
href="{% url "timetable_regular" type pk "regular" %}">
<i class="material-icons left">slideshow</i>
REGELPLAN ANZEIGEN
</a>
......
......@@ -6,6 +6,7 @@ urlpatterns = [
path("timetable/<str:_type>/<int:pk>", views.timetable, name="timetable"),
path("all_timetables", views.all, name="all_timetables"),
path("timetable/<str:_type>/<int:pk>/<int:year>/<int:week>", views.timetable, name="timetable_by_week"),
path("timetable/<str:_type>/<int:pk>/<str:regular>/", views.timetable, name="timetable_regular"),
path("lessons", views.lessons_day, name="lessons_day"),
path("lessons/<when>", views.lessons_day, name="lessons_day_by_date"),
path(
......
......@@ -79,10 +79,12 @@ def all(request: HttpRequest) -> HttpResponse:
@login_required
def timetable(
request: HttpRequest, _type: str, pk: int, year: Optional[int] = None, week: Optional[int] = None
request: HttpRequest, _type: str, pk: int, year: Optional[int] = None, week: Optional[int] = None, regular: Optional[str] = None
) -> HttpResponse:
context = {}
is_smart = regular != "regular"
if _type == "group":
el = get_object_or_404(Group, pk=pk)
elif _type == "teacher":
......@@ -154,7 +156,7 @@ def timetable(
context["type"] = _type
context["pk"] = pk
context["el"] = el
context["smart"] = True
context["smart"] = is_smart
week_prev = wanted_week - 1
week_next = wanted_week + 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment