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

Apply materialize on daily lessons overview and substitution edit view

For that use new syntax for turnable.html
parent c3f7c272
No related branches found
No related tags found
1 merge request!31Biscuit merge. Closes #53.
...@@ -24,7 +24,7 @@ def _css_class_from_lesson_state( ...@@ -24,7 +24,7 @@ def _css_class_from_lesson_state(
class LessonsTable(tables.Table): class LessonsTable(tables.Table):
class Meta: class Meta:
attrs = {"class": "table table-striped table-bordered table-hover table-responsive-xl"} attrs = {"class": "highlight"}
row_attrs = {"class": _css_class_from_lesson_state} row_attrs = {"class": _css_class_from_lesson_state}
period__period = tables.Column(accessor="period__period") period__period = tables.Column(accessor="period__period")
...@@ -39,7 +39,7 @@ class LessonsTable(tables.Table): ...@@ -39,7 +39,7 @@ class LessonsTable(tables.Table):
class SubstitutionsTable(tables.Table): class SubstitutionsTable(tables.Table):
class Meta: class Meta:
attrs = {"class": "table table-striped table-bordered table-hover table-responsive-xl"} attrs = {"class": "highlight"}
lesson_period = tables.Column(verbose_name=_("Lesson")) lesson_period = tables.Column(verbose_name=_("Lesson"))
lesson__groups = tables.Column( lesson__groups = tables.Column(
......
{# -*- engine:django -*- #} {# -*- engine:django -*- #}
{% extends "core/base.html" %} {% extends "core/base.html" %}
{% load bootstrap4 i18n %} {% load material_form i18n %}
{% block bootstrap4_extra_head %}
{{ block.super }}
{{ edit_substitution_form.media.css }}
{% endblock %}
{% block bootstrap4_extra_script %}
{{ block.super }}
{{ edit_substitution_form.media.js }}
{% endblock %}
{% block bootstrap4_title %}{% blocktrans %}Edit substitution{% endblocktrans %} - {{ block.super }}{% endblock %}
{% block page_title %}{% blocktrans %}Edit substitution{% endblocktrans %}{% endblock %} {% block page_title %}{% blocktrans %}Edit substitution{% endblocktrans %}{% endblock %}
{% block content %} {% block content %}
<div class="d-flex justify-content-between">
<div class="btn-group" role="group" aria-label="Day actions">
{% if substitution %}
{# FIXME Respect year as well #}
<a href="{% url 'delete_substitution' substitution.lesson_period.id substitution.week %}" class="btn btn-danger">
<span class="mdi mdi-delete"></span>
</a>
{% endif %}
</div>
</div>
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
{% bootstrap_form edit_substitution_form %}
<button type="submit" class="btn btn-dark"> {% form form=edit_substitution_form %}{% endform %}
<span class="mdi mdi-content-save"></span>
</button> {% include "core/save_button.html" %}
{% if substitution %}
{# FIXME Respect year as well #}
<a href="{% url 'delete_substitution' substitution.lesson_period.id substitution.week %}"
class="btn red waves-effect waves-light">
<i class="material-icons left">delete</i> {% trans "Delete" %}
</a>
{% endif %}
</form> </form>
{% endblock %} {% endblock %}
{# -*- engine:django -*- #} {# -*- engine:django -*- #}
{% extends "core/turnable.html" %} {% extends "core/base.html" %}
{% load i18n %} {% load i18n %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% block page_title %}{% blocktrans %}Lessons {{ day }}{% endblocktrans %}{% endblock %}
{% block current_content %} {% block content %}
{% include "core/turnable.html" %}
{% render_table lessons_table %} {% render_table lessons_table %}
{% endblock %} {% endblock %}
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