Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
proto3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
70
Issues
70
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
protokollsystem
proto3
Commits
b2c65361
Commit
b2c65361
authored
Mar 15, 2017
by
Robin Sonnabend
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter protocols by state
parent
2f5c086f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
server.py
server.py
+15
-2
views/forms.py
views/forms.py
+3
-0
No files found.
server.py
View file @
b2c65361
...
...
@@ -24,7 +24,7 @@ from shared import db, date_filter, datetime_filter, date_filter_long, date_filt
from
utils
import
is_past
,
mail_manager
,
url_manager
,
get_first_unused_int
,
set_etherpad_text
,
get_etherpad_text
,
split_terms
,
optional_int_arg
from
decorators
import
db_lookup
,
require_public_view_right
,
require_private_view_right
,
require_modify_right
,
require_admin_right
from
models.database
import
ProtocolType
,
Protocol
,
DefaultTOP
,
TOP
,
Document
,
Todo
,
Decision
,
MeetingReminder
,
Error
,
TodoMail
,
DecisionDocument
,
TodoState
,
Meta
,
DefaultMeta
,
DecisionCategory
from
views.forms
import
LoginForm
,
ProtocolTypeForm
,
DefaultTopForm
,
MeetingReminderForm
,
NewProtocolForm
,
DocumentUploadForm
,
KnownProtocolSourceUploadForm
,
NewProtocolSourceUploadForm
,
ProtocolForm
,
TopForm
,
SearchForm
,
DecisionSearchForm
,
NewProtocolFileUploadForm
,
NewTodoForm
,
TodoForm
,
TodoMailForm
,
DefaultMetaForm
,
MetaForm
,
MergeTodosForm
,
DecisionCategoryForm
from
views.forms
import
LoginForm
,
ProtocolTypeForm
,
DefaultTopForm
,
MeetingReminderForm
,
NewProtocolForm
,
DocumentUploadForm
,
KnownProtocolSourceUploadForm
,
NewProtocolSourceUploadForm
,
ProtocolForm
,
TopForm
,
SearchForm
,
DecisionSearchForm
,
ProtocolSearchForm
,
NewProtocolFileUploadForm
,
NewTodoForm
,
TodoForm
,
TodoMailForm
,
DefaultMetaForm
,
MetaForm
,
MergeTodosForm
,
DecisionCategoryForm
from
views.tables
import
ProtocolsTable
,
ProtocolTypesTable
,
ProtocolTypeTable
,
DefaultTOPsTable
,
MeetingRemindersTable
,
ErrorsTable
,
TodosTable
,
DocumentsTable
,
DecisionsTable
,
TodoTable
,
ErrorTable
,
TodoMailsTable
,
DefaultMetasTable
,
DecisionCategoriesTable
from
legacy
import
import_old_todos
,
import_old_protocols
,
import_old_todomails
...
...
@@ -351,12 +351,19 @@ def list_protocols():
protocoltype_id
=
int
(
request
.
args
.
get
(
"protocoltype_id"
))
except
(
ValueError
,
TypeError
):
pass
open
=
-
1
try
:
open
=
int
(
request
.
args
.
get
(
"open"
))
except
(
ValueError
,
TypeError
):
pass
search_term
=
request
.
args
.
get
(
"search"
)
protocoltypes
=
ProtocolType
.
get_public_protocoltypes
(
user
)
search_form
=
SearchForm
(
protocoltypes
)
search_form
=
Protocol
SearchForm
(
protocoltypes
)
if
protocoltype_id
is
not
None
:
search_form
.
protocoltype_id
.
data
=
protocoltype_id
protocoltype
=
ProtocolType
.
query
.
filter_by
(
id
=
protocoltype_id
).
first
()
if
open
is
not
None
:
search_form
.
open
.
data
=
open
if
search_term
is
not
None
:
search_form
.
search
.
data
=
search_term
protocol_query
=
Protocol
.
query
...
...
@@ -391,6 +398,12 @@ def list_protocols():
protocol
for
protocol
in
protocols
if
protocol
.
protocoltype
.
id
==
protocoltype_id
]
if
open
is
not
None
and
open
!=
-
1
:
protocol_done
=
bool
(
open
)
protocols
=
[
protocol
for
protocol
in
protocols
if
protocol
.
is_done
()
==
protocol_done
]
if
shall_search
:
protocols
=
[
protocol
for
protocol
in
protocols
...
...
views/forms.py
View file @
b2c65361
...
...
@@ -205,6 +205,9 @@ class DecisionSearchForm(SearchForm):
super
().
__init__
(
protocoltypes
=
protocoltypes
,
**
kwargs
)
self
.
decisioncategory_id
.
choices
=
get_category_choices
(
categories
)
class
ProtocolSearchForm
(
SearchForm
):
open
=
SelectField
(
"Offen"
,
choices
=
[(
-
1
,
"Alle"
),
(
0
,
"Geplant"
),
(
1
,
"Fertig"
)],
coerce
=
int
)
class
NewTodoForm
(
FlaskForm
):
protocoltype_id
=
SelectField
(
"Typ"
,
choices
=
[],
coerce
=
int
)
who
=
StringField
(
"Person"
,
validators
=
[
InputRequired
(
"Bitte gib an, wer das Todo erledigen soll."
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment