Skip to content
Snippets Groups Projects
Commit 5a5bed0d authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

display five individual timetables for every day instead of one timetable for...

display five individual timetables for every day instead of one timetable for every day on mobile devices
parent 1cee36e9
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@
</script>
<div class="col s2">
<div class="col s2" style="display: initial;">
<a class="waves-effect waves-teal btn-flat btn-flat-medium left" id="date-before">
<i class="material-icons center">navigate_before</i>
</a>
......
......@@ -25,10 +25,12 @@
{# Class or room > Display teacher #}
{% if type == 2 or type == 1 %}
{% if element_container.element.teacher %}
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ element_container.element.teacher }}"><a
href="{% url "timetable_smart_plan" "teacher" element_container.element.teacher.id %}">{{ element_container.element.teacher.shortcode }}</a></span>
<br>
{% endif %}
{% endif %}
{# Badge #}
......@@ -81,12 +83,14 @@
{# Class or room > Display teacher #}
{% if type == 2 or type == 1 %}
{% if element_container.element.teacher %}
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ element_container.element.teacher }}">
<a href="{% url "timetable_smart_plan" "teacher" element_container.element.teacher.id %}">
{{ element_container.element.teacher.shortcode }}
</a>
</span>
{% endif %}
{% endif %}
{# Display subject #}
......
......@@ -118,7 +118,8 @@
</a>
{% endif %}
</div>
<div class="timetable-plan">
{# show full timetable on tablets, laptops and pcs #}
<div class="timetable-plan hide-on-small-and-down">
{# Week days #}
<div class="row">
......@@ -143,7 +144,7 @@
<div class="card timetable-title-card">
<div class="card-content">
<span class="card-title">
{{ long_week_day }}
{{ long_week_day.0 }}
</span>
</div>
</div>
......@@ -181,6 +182,48 @@
</div>
{% endfor %}
</div>
{# show 5 seperate ones on mobiles #}
<div class="timetable-plan hide-on-med-and-up">
{% for long_week_day in long_week_days %}
<div class="card timetable-mobile-title-card">
<div class="card-content">
<span class="card-title">
{{ long_week_day.0 }}
</span>
</div>
</div>
{% for row, time in plan %}
<div class="row">
<div class="col s4">
<div class="card timetable-title-card">
<div class="card-content">
{# Lesson number #}
<span class="card-title left">
{{ time.number_format }}
</span>
{# Time dimension of lesson #}
<div class="right timetable-time grey-text text-darken-2">
<span>{{ time.start|date:"H:i" }}</span><br>
<span>{{ time.end|date:"H:i" }}</span>
</div>
</div>
</div>
</div>
{% for col in row %}
{% if forloop.counter0 == long_week_day.1 %}
<div class="col s8">
{# A lesson #}
{% include "timetable/lesson.html" %}
</div>
{% endif %}
{% endfor %}
</div>
{% endfor %}
{% endfor %}
</div>
</main>
{% include 'partials/footer.html' %}
......@@ -166,7 +166,6 @@ def my_plan(request, year=None, day=None, month=None):
"el": el,
"times": parse_lesson_times(),
"week_day": date.isoweekday() - 1,
"week_days": WEEK_DAYS,
"date": date,
"date_js": int(date.timestamp()) * 1000,
"display_date_only": True
......
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