Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Chronos
Merge requests
!34
Include print view for substitutions
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Include print view for substitutions
60-include-substitutions-print-view
into
master
Overview
19
Commits
4
Pipelines
0
Changes
1
Merged
Jonathan Weth
requested to merge
60-include-substitutions-print-view
into
master
5 years ago
Overview
19
Commits
4
Pipelines
0
Changes
1
Expand
Close
#60 (closed)
0
0
Merge request reports
Viewing commit
d0121346
Prev
Next
Show latest version
1 file
+
1
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
d0121346
Add not-striped class
· d0121346
Jonathan Weth
authored
5 years ago
aleksis/apps/chronos/templates/chronos/substitutions_print.html
+
81
−
94
Options
{# -*- engine:django -*- #}
{% extends 'core/base.html' %}
{% load common %}
{% extends 'core/base_print.html' %}
{% block content %}
<script
type=
"text/javascript"
>
var
dest
=
Urls
.
substitutions
();
</script>
{% load i18n static %}
<style>
table
.substitutions
td
,
table
.substitutions
th
{
padding
:
0
2px
;
}
{% block extra_head %}
<link
rel=
"stylesheet"
href=
"{% static 'css/chronos/timetable.css' %}"
>
{% endblock %}
span
.badge.new
{
font-size
:
0.9rem
;
line-height
:
20px
;
height
:
20px
;
margin
:
2px
;
letter-spacing
:
0.3pt
;
}
</style>
{% block browser_title %}{% blocktrans %}Print: Substitutions{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans %}Substitutions{% endblocktrans %}{% endblock %}
{% for c in days %}
<h4>
Substitutions {{ c.date|date" }}
</h4>
{% block content %}
{% for day, c in days.items %}
<h4>
{% trans "Substitutions" %} {{ c.day|date:"l" }} {{ c.day }}
</h4>
{% include "timetable/hintsinsubprint.html" %}
{#
{% include "timetable/hintsinsubprint.html" %}
#}
<div
style=
"margin-bottom: 20px"
>
{% if c.header_info.is_box_needed %}
{% for row in c.header_info.rows %}
<div
class=
"row no-margin"
>
<div
class=
"col s3 no-padding"
>
<strong>
{{ row.0 }}
</strong>
</div>
<div
class=
"col s9 no-padding"
>
{{ row.1 }}
</div>
</div>
{% endfor %}
{% endif %}
</div>
{#
<div
style=
"margin-bottom: 20px"
>
#}
{#
{% if c.header_info.is_box_needed %}
#}
{#
{% for row in c.header_info.rows %}
#}
{#
<div
class=
"row no-margin"
>
#}
{#
<div
class=
"col s3 no-padding"
>
#}
{#
<strong>
{{ row.0 }}
</strong>
#}
{#
</div>
#}
{#
<div
class=
"col s9 no-padding"
>
#}
{#
{{ row.1 }}
#}
{#
</div>
#}
{#
</div>
#}
{#
{% endfor %}
#}
{#
{% endif %}
#}
{#
</div>
#}
<table
class=
"substitutions"
>
<thead>
<tr>
<th><i
class=
"material-icons"
>
people
</i></th>
<th><i
class=
"material-icons"
>
access_time
</i></th>
<th>
{% blocktrans %}Teachers{% endblocktrans %}
</th>
<th>
{% blocktrans %}Subject{% endblocktrans %}
</th>
<th>
{% blocktrans %}Room{% endblocktrans %}
</th>
<th>
{% blocktrans %}Hint{% endblocktrans %}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% if not c.sub_table %}
<td
colspan=
"7"
>
<p
class=
"flow-text center"
>
{% blocktrans %}No existing substitutions{% endblocktrans %}
</p>
</td>
{% endif %}
{% set color_background = 1 %}
{% set last_classes = "" %}
<thead>
<tr>
<th><i
class=
"material-icons"
>
people
</i></th>
<th><i
class=
"material-icons"
>
access_time
</i></th>
<th>
{% blocktrans %}Teachers{% endblocktrans %}
</th>
<th>
{% blocktrans %}Subject{% endblocktrans %}
</th>
<th>
{% blocktrans %}Room{% endblocktrans %}
</th>
<th>
{% blocktrans %}Notes{% endblocktrans %}
</th>
<th></th>
</tr>
</thead>
{% for sub in c.sub_table %}
{% if not c.substitutions %}
<tbody>
<tr
class=
"striped"
>
<td
colspan=
"7"
>
<p
class=
"flow-text center"
>
{% blocktrans %}No substitutions available.{% endblocktrans %}
</p>
</td>
</tr>
</tbody>
{% endif %}
{# Color groups of classes in grey/white #}
{% if last_classes != sub.classes %}
{% if color_background %}{% set color_background = 0 %}
{% else %}{% set color_background = 1 %}
{% endif %}
<tbody>
{% for sub in c.substitutions %}
<tr
class=
"{% if sub.type_ == "
cancellation
"
%}
green-text
{%
else
%}
black-text
{%
endif
%}
"
>
<td>
{% include "chronos/partials/groups.html" with groups=sub.lesson_period.lesson.groups.all %}
</td>
<td>
<strong>
{{ sub.lesson_period.period.period }}.
</strong>
</td>
<td>
{% include "chronos/partials/subs/teachers.html" %}
</td>
<td>
{% include "chronos/partials/subs/subject.html" %}
</td>
<td>
{% include "chronos/partials/subs/room.html" %}
</td>
<td>
{% if sub.cancelled %}
{# TODO: Support other cases#}
<span
class=
"badge new green"
>
{% trans "Cancelled" %}
</span>
{% endif %}
{% set last_classes = sub.classes %}
{#
<em>
{{ sub.text|default:"" }}
</em>
#}
</td>
</tr>
<tr
class=
"{{ sub.color }}-text {% if color_background %}striped{% endif %}"
>
<td>
{{ sub.classes }}
</td>
<td>
<strong>
{{ sub.lesson }}
</strong>
</td>
<td>
{% include "timetable/subs/teacher.html" %}
</td>
<td>
{% include "timetable/subs/subject.html" %}
</td>
<td>
{% include "timetable/subs/room.html" %}
</td>
<td>
{% if sub.badge %}
<span
class=
"badge new green"
>
{{ sub.badge }}
</span>
{% endif %}
<em>
{{ sub.text|default:"" }}
</em>
</td>
</tr>
{% endfor %}
</tbody>
{% ifchanged sub.lesson_period.lesson.groups %}
</tbody>
<tbody
class=
"{% cycle "
not-striped
"
"
striped
"
%}"
>
{% endifchanged %}
{% endfor %}
</tbody>
</table>
{% endfor %}
{% endfor %}
{% endblock %}
Loading