Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
proto3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
protokollsystem
proto3
Commits
4dff3185
Commit
4dff3185
authored
7 years ago
by
markus scheller
Browse files
Options
Downloads
Patches
Plain Diff
Add configuration SelectField for latex_template selection
#170
parent
7ba49fdd
No related branches found
No related tags found
1 merge request
!8
Feature: Typ kann LaTeX-Template wählen
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
views/forms.py
+13
-0
13 additions, 0 deletions
views/forms.py
with
13 additions
and
0 deletions
views/forms.py
+
13
−
0
View file @
4dff3185
...
...
@@ -59,6 +59,17 @@ def get_printer_choices():
choices
.
insert
(
0
,
(
""
,
"
Nicht drucken
"
))
return
choices
def
get_latex_template_choices
():
choices
=
[]
if
config
.
LATEX_TEMPLATES
is
not
None
:
choices
=
[
(
key
,
values
[
'
name
'
])
for
key
,
values
in
config
.
LATEX_TEMPLATES
.
items
()
]
choices
.
insert
(
0
,
(
""
,
"
Standardvorlage
"
))
return
choices
def
get_group_choices
():
user
=
current_user
()
groups
=
sorted
(
user
.
groups
)
...
...
@@ -130,12 +141,14 @@ class ProtocolTypeForm(FlaskForm):
calendar
=
SelectField
(
"
Kalender
"
,
choices
=
[])
restrict_networks
=
BooleanField
(
"
Netzwerke einschränken
"
)
allowed_networks
=
IPNetworkField
(
"
Erlaubte Netzwerke
"
)
latex_template
=
SelectField
(
"
LaTeX Vorlage
"
,
choices
=
[])
def
__init__
(
self
,
**
kwargs
):
super
().
__init__
(
**
kwargs
)
protocoltype
=
kwargs
[
"
obj
"
]
if
"
obj
"
in
kwargs
else
None
self
.
calendar
.
choices
=
get_calendar_choices
(
protocoltype
=
protocoltype
)
self
.
printer
.
choices
=
get_printer_choices
()
self
.
latex_template
.
choices
=
get_latex_template_choices
()
group_choices
=
get_group_choices
()
self
.
publish_group
.
choices
=
group_choices
self
.
modify_group
.
choices
=
group_choices
...
...
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