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
Commits
7fb9660e
Commit
7fb9660e
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/show-dates-in-column-headings-in-timetable-view' into 'master'
Show dates in column headings in weekly timetable view Closes
#68
See merge request
!43
parents
30e640c9
067bcbb3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!43
Show dates in column headings in weekly timetable view
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/chronos/templates/chronos/timetable.html
+10
-7
10 additions, 7 deletions
aleksis/apps/chronos/templates/chronos/timetable.html
aleksis/apps/chronos/views.py
+15
-6
15 additions, 6 deletions
aleksis/apps/chronos/views.py
with
25 additions
and
13 deletions
aleksis/apps/chronos/templates/chronos/timetable.html
+
10
−
7
View file @
7fb9660e
...
@@ -124,13 +124,14 @@
...
@@ -124,13 +124,14 @@
</div>
</div>
{# Show short weekdays on tablets #}
{# Show short weekdays on tablets #}
{% for
day
in weekdays_short
.items
%}
{% for
i, weekday, date
in weekdays_short %}
<div
class=
"col s2 hide-on-large-only"
>
<div
class=
"col s2 hide-on-large-only"
>
<div
class=
"card timetable-title-card"
>
<div
class=
"card timetable-title-card"
>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<span
class=
"card-title"
>
<span
class=
"card-title"
>
{{ day
.1
}}
{{
week
day }}
</span>
</span>
{{ date }}
{# {% if day.1 %}#}
{# {% if day.1 %}#}
{#
<span
class=
"badge new blue center-align holiday-badge"
>
{{ day.1.0 }}
</span>
#}
{#
<span
class=
"badge new blue center-align holiday-badge"
>
{{ day.1.0 }}
</span>
#}
{# {% endif %}#}
{# {% endif %}#}
...
@@ -140,13 +141,14 @@
...
@@ -140,13 +141,14 @@
{% endfor %}
{% endfor %}
{# Show long weekdays elsewere #}
{# Show long weekdays elsewere #}
{% for
day
in weekdays
.items
%}
{% for
i, weekday, date
in weekdays %}
<div
class=
"col s2 hide-on-med-only"
>
<div
class=
"col s2 hide-on-med-only"
>
<div
class=
"card timetable-title-card"
>
<div
class=
"card timetable-title-card"
>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<span
class=
"card-title"
>
<span
class=
"card-title"
>
{{ day
.1
}}
{{
week
day }}
</span>
</span>
{{ date }}
{# {% if day.1 %}#}
{# {% if day.1 %}#}
{#
<span
class=
"badge new blue center-align holiday-badge"
>
{{ day.1.0 }}
</span>
#}
{#
<span
class=
"badge new blue center-align holiday-badge"
>
{{ day.1.0 }}
</span>
#}
{# {% endif %}#}
{# {% endif %}#}
...
@@ -176,12 +178,13 @@
...
@@ -176,12 +178,13 @@
{# show 5 seperate ones on mobiles #}
{# show 5 seperate ones on mobiles #}
<div
class=
"timetable-plan hide-on-med-and-up"
>
<div
class=
"timetable-plan hide-on-med-and-up"
>
{% for
day
in weekdays
.items
%}
{% for
i, weekday, date
in weekdays %}
<div
class=
"card timetable-mobile-title-card"
>
<div
class=
"card timetable-mobile-title-card"
>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<span
class=
"card-title"
>
<span
class=
"card-title"
>
{{ day
.1
}}
{{
week
day }}
</span>
</span>
{{ date }}
{# {% if day.1 %}#}
{# {% if day.1 %}#}
{#
<span
class=
"badge new blue center-align holiday-badge"
>
{{ day.1.0 }}
</span>
#}
{#
<span
class=
"badge new blue center-align holiday-badge"
>
{{ day.1.0 }}
</span>
#}
{# {% endif %}#}
{# {% endif %}#}
...
@@ -195,7 +198,7 @@
...
@@ -195,7 +198,7 @@
</div>
</div>
{% for weekday, lessons in lesson_periods_period.items %}
{% for weekday, lessons in lesson_periods_period.items %}
{% if forloop.counter0
|add:"1" == day.0
%}
{% if forloop.counter0
== i
%}
<div
class=
"col s8"
>
<div
class=
"col s8"
>
{# A lesson #}
{# A lesson #}
{% include "chronos/partials/lesson.html" with lessons=lessons %}
{% include "chronos/partials/lesson.html" with lessons=lessons %}
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/chronos/views.py
+
15
−
6
View file @
7fb9660e
...
@@ -151,12 +151,21 @@ def timetable(
...
@@ -151,12 +151,21 @@ def timetable(
context
[
"
lesson_periods
"
]
=
OrderedDict
(
sorted
(
per_period
.
items
()))
context
[
"
lesson_periods
"
]
=
OrderedDict
(
sorted
(
per_period
.
items
()))
context
[
"
periods
"
]
=
TimePeriod
.
get_times_dict
()
context
[
"
periods
"
]
=
TimePeriod
.
get_times_dict
()
context
[
"
weekdays
"
]
=
dict
(
TimePeriod
.
WEEKDAY_CHOICES
[
TimePeriod
.
weekday_min
:
TimePeriod
.
weekday_max
+
1
]
# Build lists with weekdays and corresponding dates (long and short variant)
)
context
[
"
weekdays
"
]
=
[
context
[
"
weekdays_short
"
]
=
dict
(
(
key
,
weekday
,
wanted_week
[
key
])
TimePeriod
.
WEEKDAY_CHOICES_SHORT
[
TimePeriod
.
weekday_min
:
TimePeriod
.
weekday_max
+
1
]
for
key
,
weekday
in
TimePeriod
.
WEEKDAY_CHOICES
[
)
TimePeriod
.
weekday_min
:
TimePeriod
.
weekday_max
+
1
]
]
context
[
"
weekdays_short
"
]
=
[
(
key
,
weekday
,
wanted_week
[
key
])
for
key
,
weekday
in
TimePeriod
.
WEEKDAY_CHOICES_SHORT
[
TimePeriod
.
weekday_min
:
TimePeriod
.
weekday_max
+
1
]
]
context
[
"
weeks
"
]
=
get_weeks_for_year
(
year
=
wanted_week
.
year
)
context
[
"
weeks
"
]
=
get_weeks_for_year
(
year
=
wanted_week
.
year
)
context
[
"
week
"
]
=
wanted_week
context
[
"
week
"
]
=
wanted_week
context
[
"
type
"
]
=
type_
context
[
"
type
"
]
=
type_
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment