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
39369d38
Commit
39369d38
authored
6 years ago
by
Frank Poetzsch-Heffter
Browse files
Options
Downloads
Patches
Plain Diff
provide Lessons in settings
parent
a7ba8662
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/aub/forms.py
+4
-32
4 additions, 32 deletions
schoolapps/aub/forms.py
schoolapps/schoolapps/settings.py
+2
-0
2 additions, 0 deletions
schoolapps/schoolapps/settings.py
with
6 additions
and
32 deletions
schoolapps/aub/forms.py
+
4
−
32
View file @
39369d38
...
...
@@ -3,6 +3,8 @@ from django.core.exceptions import ValidationError
from
django.utils
import
timezone
from
datetime
import
datetime
from
material
import
Layout
,
Row
,
Fieldset
from
schoolapps
import
settings
class
FilterAUBForm
(
forms
.
Form
):
timerangechoices
=
[(
'
today
'
,
'
Heute
'
),(
'
thisWeek
'
,
'
Diese Woche
'
),
(
'
thisMonth
'
,
'
Dieser Monat
'
)]
...
...
@@ -20,13 +22,11 @@ class FilterAUBForm(forms.Form):
cleaned_data
=
super
().
clean
()
class
ApplyForAUBForm
(
forms
.
Form
):
lessons
=
[(
''
,
''
),
(
'
8:00
'
,
'
1.
'
),
(
'
8:45
'
,
'
2.
'
),
(
'
9:45
'
,
'
3.
'
),
(
'
10:35
'
,
'
4.
'
),
(
'
11:35
'
,
'
5.
'
),
(
'
12:25
'
,
'
6.
'
),
(
'
13:15
'
,
'
7.
'
),
(
'
14:05
'
,
'
8.
'
),
(
'
14:50
'
,
'
9.
'
)]
from_date
=
forms
.
DateField
(
label
=
'
Datum
'
,
input_formats
=
[
'
%d.%m.%Y
'
])
from_lesson
=
forms
.
ChoiceField
(
label
=
'
Stunde
'
,
choices
=
lessons
,
required
=
False
,
widget
=
forms
.
Select
(
attrs
=
{
'
onchange
'
:
'
set_time(this)
'
}))
from_lesson
=
forms
.
ChoiceField
(
label
=
'
Stunde
'
,
choices
=
settings
.
LESSONS
,
required
=
False
,
widget
=
forms
.
Select
(
attrs
=
{
'
onchange
'
:
'
set_time(this)
'
}))
from_time
=
forms
.
TimeField
(
label
=
'
Zeit
'
,
input_formats
=
[
'
%H:%M
'
],
initial
=
'
8:00
'
,
)
to_date
=
forms
.
DateField
(
label
=
'
Datum
'
,
input_formats
=
[
'
%d.%m.%Y
'
])
to_lesson
=
forms
.
ChoiceField
(
label
=
'
Stunde
'
,
choices
=
lessons
,
required
=
False
,
widget
=
forms
.
Select
(
attrs
=
{
'
onchange
'
:
'
set_time(this)
'
}))
to_lesson
=
forms
.
ChoiceField
(
label
=
'
Stunde
'
,
choices
=
settings
.
LESSONS
,
required
=
False
,
widget
=
forms
.
Select
(
attrs
=
{
'
onchange
'
:
'
set_time(this)
'
}))
to_time
=
forms
.
TimeField
(
label
=
'
Zeit
'
,
input_formats
=
[
'
%H:%M
'
],
initial
=
'
15:35
'
)
description
=
forms
.
CharField
(
label
=
'
Bitte begründen Sie Ihren Antrag.
'
)
...
...
@@ -62,34 +62,6 @@ class ApplyForAUBForm(forms.Form):
raise
ValidationError
(
'
Das Von-Datum liegt hinter dem Bis-Datum.
'
)
return
True
# def clean_from_date(self):
# data = self.cleaned_data['from_date']
# # if data < timezone.datetime.date(timezone.now()):
# # raise ValidationError('Die Befreiung kann nur zukünftig durchgeführt werden (Datumsfehler).')
# return data
#
# def clean_to_date(self):
# data = self.cleaned_data['to_date']
# # if data < timezone.datetime.date(timezone.now()):
# # raise ValidationError('Die Befreiung kann nur zukünftig durchgeführt werden.')
# return data
#
# def clean_from_time(self):
# data = self.cleaned_data['from_time']
# # print('Data:', type(data), 'Now:', type(timezone.datetime.time(timezone.now())))
#
# # if data < timezone.datetime.time(timezone.now()):
# # raise ValidationError('Die Befreiung kann nur zukünftig durchgeführt werden (Zeitfehler).')
#
# return data
#
# def clean_to_time(self):
# data = self.cleaned_data['to_time']
#
# # if data < timezone.datetime.time(timezone.now()):
# # raise ValidationError('Die Befreiung kann nur zukünftig durchgeführt werden.')
# return data
def
clean_description
(
self
):
data
=
self
.
cleaned_data
[
'
description
'
]
self
.
clean_from_to_date
()
...
...
This diff is collapsed.
Click to expand it.
schoolapps/schoolapps/settings.py
+
2
−
0
View file @
39369d38
...
...
@@ -160,6 +160,8 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# TIMETABLE
TIMETABLE_WIDTH
=
5
TIMETABLE_HEIGHT
=
10
LESSONS
=
[(
'
8:00
'
,
'
1.
'
),
(
'
8:45
'
,
'
2.
'
),
(
'
9:45
'
,
'
3.
'
),
(
'
10:35
'
,
'
4.
'
),
(
'
11:35
'
,
'
5.
'
),
(
'
12:25
'
,
'
6.
'
),
(
'
13:15
'
,
'
7.
'
),
(
'
14:05
'
,
'
8.
'
),
(
'
14:50
'
,
'
9.
'
)]
########
# LDAP #
...
...
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