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
7444fc58
Unverified
Commit
7444fc58
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Add times and periods as first column.
parent
0a87e9f0
No related branches found
No related tags found
1 merge request
!1
Add templates for timetable. Advances #1.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
biscuit/apps/chronos/models.py
+8
-0
8 additions, 0 deletions
biscuit/apps/chronos/models.py
biscuit/apps/chronos/templates/chronos/tt_week.html
+37
-1
37 additions, 1 deletion
biscuit/apps/chronos/templates/chronos/tt_week.html
biscuit/apps/chronos/views.py
+2
-1
2 additions, 1 deletion
biscuit/apps/chronos/views.py
with
47 additions
and
2 deletions
biscuit/apps/chronos/models.py
+
8
−
0
View file @
7444fc58
...
...
@@ -24,6 +24,14 @@ class TimePeriod(models.Model):
def
__str__
(
self
):
return
'
%s, %d. period (%s - %s)
'
%
(
self
.
weekday
,
self
.
period
,
self
.
time_start
,
self
.
time_end
)
@classmethod
def
get_times_dict
(
cls
):
periods
=
{}
for
period
in
cls
.
objects
.
all
():
periods
[
period
.
period
]
=
(
period
.
time_start
,
period
.
time_end
)
return
periods
class
Subject
(
models
.
Model
):
abbrev
=
models
.
CharField
(
verbose_name
=
_
(
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/chronos/templates/chronos/tt_week.html
+
37
−
1
View file @
7444fc58
{# -*- engine:django -*- #}
{% extends "core/base.html" %}
{% load bootstrap4 %}
{% load bootstrap4
i18n
%}
{% block page_title %}Timetable{% endblock %}
...
...
@@ -9,6 +9,42 @@
{{ filter_descs }}
</p>
<div
class=
"float-left"
>
<ul
class=
"list-group"
>
<li
class=
"list-group-item active"
>
{% blocktrans %}Times{% endblocktrans %}
</li>
</ul>
<div
class=
"container"
>
{% for num, times in periods.items %}
<div
class=
"row"
>
<div
class=
"col-sm"
>
<div
class=
"card"
style=
"width: 18rem; {% if lesson.colour_fg %} color: {{ lesson.colour_fg }}; {% endif %} {% if lesson.colour_bg %} background-color: {{ lesson.colour_bg }}; {% endif %}"
>
<div
class=
"card-body"
>
<div
class=
"row"
>
<div
class=
"col-sm"
>
<span
class=
"card-title"
>
{{ num }}.
</span>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm"
>
<span
class=
"card-text"
>
{{ times.0}}
</span>
</div>
<div
class=
"col-sm"
>
<span
class=
"card-text"
>
-
</span>
</div>
<div
class=
"col-sm"
>
<span
class=
"card-text"
>
{{ times.1 }}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% for weekday, lesson_periods_day in lesson_periods.items %}
{% include "chronos/tt_day.html" with lesson_periods=lesson_periods_day %}
{% endfor %}
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/chronos/views.py
+
2
−
1
View file @
7444fc58
...
...
@@ -8,7 +8,7 @@ from biscuit.apps.cambro.models import Room
from
biscuit.core.decorators
import
admin_required
from
biscuit.core.models
import
Group
,
Person
from
.models
import
LessonPeriod
from
.models
import
LessonPeriod
,
TimePeriod
@login_required
...
...
@@ -42,5 +42,6 @@ def timetable(request):
context
[
'
lesson_periods
'
]
=
OrderedDict
(
sorted
(
per_day
.
items
()))
context
[
'
filter_descs
'
]
=
'
,
'
.
join
(
filter_descs
)
context
[
'
periods
'
]
=
TimePeriod
.
get_times_dict
()
return
render
(
request
,
'
chronos/tt_week.html
'
,
context
)
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