Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
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-Alsijil
Commits
cdedd8be
Verified
Commit
cdedd8be
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix layout of select form
parent
ddf52a36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!48
Review use of Materialize
Pipeline
#2480
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/forms.py
+7
-3
7 additions, 3 deletions
aleksis/apps/alsijil/forms.py
with
7 additions
and
3 deletions
aleksis/apps/alsijil/forms.py
+
7
−
3
View file @
cdedd8be
...
...
@@ -8,7 +8,8 @@ from django.utils.translation import gettext_lazy as _
from
django_select2.forms
import
Select2Widget
from
aleksis.apps.chronos.models
import
Room
from
material
import
Row
,
Layout
from
aleksis.core.models
import
Group
,
Person
from
.models
import
LessonDocumentation
,
PersonalNote
,
PersonalNoteFilter
...
...
@@ -32,12 +33,15 @@ class PersonalNoteForm(forms.ModelForm):
self
.
fields
[
"
person_name
"
].
widget
.
attrs
.
update
(
{
"
class
"
:
"
alsijil-lesson-personal-note-name
"
}
)
self
.
fields
[
"
person_name
"
].
widget
=
forms
.
HiddenInput
()
if
self
.
instance
and
getattr
(
self
.
instance
,
"
person
"
,
None
):
self
.
fields
[
"
person_name
"
].
initial
=
str
(
self
.
instance
.
person
)
class
SelectForm
(
forms
.
Form
):
layout
=
Layout
(
Row
(
"
group
"
,
"
teacher
"
))
group
=
forms
.
ModelChoiceField
(
queryset
=
Group
.
objects
.
annotate
(
lessons_count
=
Count
(
"
lessons
"
)).
filter
(
lessons_count__gt
=
0
),
label
=
_
(
"
Group
"
),
...
...
@@ -78,10 +82,10 @@ PersonalNoteFormSet = forms.modelformset_factory(
class
RegisterAbsenceForm
(
forms
.
Form
):
date_start
=
forms
.
DateField
(
label
=
_
(
"
Start date
"
),
widget
=
forms
.
SelectDateWidget
,
initial
=
datetime
.
today
label
=
_
(
"
Start date
"
),
initial
=
datetime
.
today
)
date_end
=
forms
.
DateField
(
label
=
_
(
"
End date
"
),
widget
=
forms
.
SelectDateWidget
,
initial
=
datetime
.
today
label
=
_
(
"
End date
"
),
initial
=
datetime
.
today
)
from_period
=
forms
.
IntegerField
(
label
=
_
(
"
From period
"
),
initial
=
0
,
min_value
=
0
)
person
=
forms
.
ModelChoiceField
(
...
...
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