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
1049e0a6
Verified
Commit
1049e0a6
authored
5 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Use right data in „all timetables“
parent
4c6b4e38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!31
Biscuit merge. Closes #53.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/apps/chronos/templates/chronos/all.html
+8
-6
8 additions, 6 deletions
aleksis/apps/chronos/templates/chronos/all.html
aleksis/apps/chronos/urls.py
+1
-0
1 addition, 0 deletions
aleksis/apps/chronos/urls.py
aleksis/apps/chronos/views.py
+19
-2
19 additions, 2 deletions
aleksis/apps/chronos/views.py
with
28 additions
and
8 deletions
aleksis/apps/chronos/templates/chronos/all.html
+
8
−
6
View file @
1049e0a6
{% extends 'core/base.html' %}
{% load i18n %}
{% block content %}
<h3>
{% blocktrans %}All timetables{% endblocktrans %}
</h3>
<div
class=
"row"
>
<div
class=
"col s12 m4"
>
<h4>
Lehrkräfte
</h4>
<h4>
{% blocktrans %}Teachers{% endblocktrans %}
</h4>
<ul
class=
"collection"
>
{% for teacher in teachers %}
<li
class=
"collection-item avatar"
>
...
...
@@ -17,14 +19,14 @@
</div>
<div
class=
"col s12 m4"
>
<h4>
Klassen
</h4>
<h4>
{% blocktrans%}Groups{% endblocktrans %}
</h4>
<ul
class=
"collection"
>
{% for
class in classe
s %}
{% for
group in group
s %}
<li
class=
"collection-item avatar"
>
<i
class=
"circle"
>
{{
class
.name }}
</i>
<a
href=
"{% url 'timetable_smart_plan' '
class' class
.id %}"
><strong>
{{
class
.name }}
</strong></a>
<i
class=
"circle"
>
{{
group
.name }}
</i>
<a
href=
"{% url 'timetable_smart_plan' '
group' group
.id %}"
><strong>
{{
group
.name }}
</strong></a>
<p>
{{
class
.text1|default:"" }} – {{ class.text2|default:"" }}
<br>
{{
group
.text1|default:"" }} – {{ class.text2|default:"" }}
<br>
Raum: {{ class.room.name|default:"---" }}
</p>
</li>
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/chronos/urls.py
+
1
−
0
View file @
1049e0a6
...
...
@@ -4,6 +4,7 @@ from . import views
urlpatterns
=
[
path
(
"
timetable
"
,
views
.
timetable
,
name
=
"
timetable
"
),
path
(
"
all_timetables
"
,
views
.
all
,
name
=
"
all_timetables
"
),
path
(
"
timetable/<int:year>/<int:week>
"
,
views
.
timetable
,
name
=
"
timetable_by_week
"
),
path
(
"
lessons
"
,
views
.
lessons_day
,
name
=
"
lessons_day
"
),
path
(
"
lessons/<when>
"
,
views
.
lessons_day
,
name
=
"
lessons_day_by_date
"
),
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/chronos/views.py
+
19
−
2
View file @
1049e0a6
...
...
@@ -3,7 +3,7 @@ from datetime import date, datetime, timedelta
from
typing
import
Optional
from
django.contrib.auth.decorators
import
login_required
from
django.db.models
import
Max
,
Min
from
django.db.models
import
Count
,
Max
,
Min
from
django.http
import
HttpRequest
,
HttpResponse
from
django.shortcuts
import
get_object_or_404
,
redirect
,
render
from
django.urls
import
reverse
...
...
@@ -12,14 +12,31 @@ from django.utils.translation import ugettext as _
from
django_tables2
import
RequestConfig
from
aleksis.core.decorators
import
admin_required
from
aleksis.core.models
import
Person
,
Group
from
aleksis.core.util
import
messages
from
.forms
import
LessonSubstitutionForm
,
SelectForm
from
.models
import
LessonPeriod
,
LessonSubstitution
,
TimePeriod
from
.models
import
LessonPeriod
,
LessonSubstitution
,
TimePeriod
,
Room
from
.tables
import
LessonsTable
,
SubstitutionsTable
from
.util
import
CalendarWeek
@login_required
def
all
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
teachers
=
Person
.
objects
.
annotate
(
lessons_count
=
Count
(
"
lessons_as_teacher
"
)).
filter
(
lessons_count__gt
=
0
)
groups
=
Group
.
objects
.
annotate
(
lessons_count
=
Count
(
"
lessons
"
)).
filter
(
lessons_count__gt
=
0
)
rooms
=
Room
.
objects
.
annotate
(
lessons_count
=
Count
(
"
lesson_periods
"
)).
filter
(
lessons_count__gt
=
0
)
context
[
'
teachers
'
]
=
teachers
context
[
'
groups
'
]
=
groups
context
[
'
rooms
'
]
=
rooms
return
render
(
request
,
'
chronos/all.html
'
,
context
)
@login_required
def
timetable
(
request
:
HttpRequest
,
year
:
Optional
[
int
]
=
None
,
week
:
Optional
[
int
]
=
None
...
...
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