Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
5983727b
Commit
5983727b
authored
6 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Add cancellation detection
parent
24575d22
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!86
Merge school-apps
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
schoolapps/timetable/templates/timetable/substitution.html
+23
-4
23 additions, 4 deletions
schoolapps/timetable/templates/timetable/substitution.html
schoolapps/untisconnect/sub.py
+15
-1
15 additions, 1 deletion
schoolapps/untisconnect/sub.py
with
38 additions
and
5 deletions
schoolapps/timetable/templates/timetable/substitution.html
+
23
−
4
View file @
5983727b
...
...
@@ -87,7 +87,11 @@
</thead>
<tbody>
{% for sub in subs %}
<tr>
<tr
{%
if
sub.type =
=
1
or
sub.type =
=
2
%}
class=
"green-text"
{%
endif
%}
>
<td>
<strong>
{{ sub.lesson }}.
</strong>
</td>
...
...
@@ -97,7 +101,9 @@
{% endfor %}
</td>
<td>
{% if sub.teacher_new and sub.teacher_old %}
{% if sub.type == 1 %}
<s>
{{ sub.teacher_old.shortcode }}
</s>
{% elif sub.teacher_new and sub.teacher_old %}
<s>
{{ sub.teacher_old.shortcode }}
</s>
→
<strong>
{{ sub.teacher_new.shortcode }}
</strong>
{% elif sub.teacher_new and not sub.teacher_old %}
...
...
@@ -107,7 +113,9 @@
{% endif %}
</td>
<td>
{% if sub.subject_new and sub.subject_old %}
{% if sub.type == 1 or sub.type == 2 %}
<s>
{{ sub.subject_old.shortcode }}
</s>
{% elif sub.subject_new and sub.subject_old %}
<s>
{{ sub.subject_old.shortcode }}
</s>
→
<strong>
{{ sub.subject_new.shortcode }}
</strong>
{% elif sub.subject_new and not sub.subject_old %}
...
...
@@ -117,7 +125,8 @@
{% endif %}
</td>
<td>
{% if sub.room_new and sub.room_old %}
{% if sub.type == 1 or sub.type == 2 %}
{% elif sub.room_new and sub.room_old %}
<s>
{{ sub.room_old.shortcode }}
</s>
→
<strong>
{{ sub.room_new.shortcode }}
</strong>
...
...
@@ -134,6 +143,16 @@
<td>
<em>
{{ sub.text|default:"" }}
</em>
</td>
<td>
{% if sub.type == 1 %}
<span
class=
"badge green"
>
Schüler frei
</span>
{% elif sub.type == 2 %}
<span
class=
"badge green"
>
Lehrer frei
</span>
{% endif %}
</td>
<td>
<small>
{{ sub.id }} {{ sub.lesson_id }}
</small>
</td>
...
...
This diff is collapsed.
Click to expand it.
schoolapps/untisconnect/sub.py
+
15
−
1
View file @
5983727b
...
...
@@ -17,6 +17,20 @@ def date_to_untis_date(date):
return
date
.
strftime
(
DATE_FORMAT
)
TYPE_SUBSTITUTION
=
0
TYPE_CANCELLATION
=
1
TYPE_TEACHER_CANCELLATION
=
2
def
parse_type_of_untis_flags
(
flags
):
type_
=
TYPE_SUBSTITUTION
if
"
E
"
in
flags
:
type_
=
TYPE_CANCELLATION
elif
"
F
"
in
flags
:
type_
=
TYPE_TEACHER_CANCELLATION
return
type_
class
Substitution
(
object
):
def
__init__
(
self
):
self
.
filled
=
False
...
...
@@ -48,7 +62,7 @@ class Substitution(object):
self
.
lesson_id
=
db_obj
.
lesson_idsubst
self
.
date
=
untis_date_to_date
(
db_obj
.
date
)
self
.
lesson
=
db_obj
.
lesson
self
.
type
=
list
(
db_obj
.
flags
)
self
.
type
=
parse_type_of_untis_flags
(
db_obj
.
flags
)
self
.
text
=
db_obj
.
text
# Lesson
...
...
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