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
32f6cef7
Commit
32f6cef7
authored
8 years ago
by
Robin Sonnabend
Browse files
Options
Downloads
Patches
Plain Diff
README and correct coercing for todostates
parent
1023b45a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+16
-0
16 additions, 0 deletions
README.md
models/database.py
+7
-2
7 additions, 2 deletions
models/database.py
views/forms.py
+15
-4
15 additions, 4 deletions
views/forms.py
with
38 additions
and
6 deletions
README.md
0 → 100644
+
16
−
0
View file @
32f6cef7
# Protokollsystem 3
System zur Verwaltung von Protokollen und Sitzungen.
*
Planung der Tagesordnung
*
Einladungsmails
*
Kompilieren vom Protokollquelltext
*
PDF-Protokoll mit LaTeX
*
Protokollversand samt Anhang
*
automatisches Hochladen ins Wiki
*
Etherpadanbindung
*
Todoverwaltung mit mehr Zuständen
*
Beschlussverwaltung
*
Rechteverwaltung (interne Abschnitte)
*
Hochladen der Tagesordnung in einen Kalender
*
externe Protokolle ohne Protokollsyntax
This diff is collapsed.
Click to expand it.
models/database.py
+
7
−
2
View file @
32f6cef7
...
...
@@ -5,7 +5,7 @@ import math
from
io
import
StringIO
,
BytesIO
from
enum
import
Enum
from
shared
import
db
,
date_filter
,
escape_tex
,
DATE_KEY
,
START_TIME_KEY
,
END_TIME_KEY
,
AUTHOR_KEY
,
PARTICIPANTS_KEY
,
LOCATION_KEY
from
shared
import
db
,
date_filter
,
date_filter_short
,
escape_tex
,
DATE_KEY
,
START_TIME_KEY
,
END_TIME_KEY
,
AUTHOR_KEY
,
PARTICIPANTS_KEY
,
LOCATION_KEY
from
utils
import
random_string
,
url_manager
,
get_etherpad_url
,
split_terms
from
models.errors
import
DateNotMatchingException
...
...
@@ -411,6 +411,11 @@ class Todo(db.Model):
self
.
id
,
self
.
number
,
self
.
who
,
self
.
description
,
self
.
state
,
self
.
date
)
def
is_done
(
self
):
if
self
.
state
.
needs_date
():
if
self
.
state
==
TodoState
.
after
:
return
datetime
.
now
().
date
()
>=
self
.
date
elif
self
.
state
==
TodoState
.
before
:
return
datetime
.
now
().
date
()
<=
self
.
date
return
self
.
state
.
is_done
()
def
get_id
(
self
):
...
...
@@ -433,7 +438,7 @@ class Todo(db.Model):
def
get_state_plain
(
self
):
result
=
self
.
state
.
get_name
()
if
self
.
state
.
needs_date
():
result
=
"
{} {}
"
.
format
(
result
,
date_filter
(
self
.
state
.
date
))
result
=
"
{} {}
"
.
format
(
result
,
date_filter
_short
(
self
.
date
))
return
result
def
get_state_tex
(
self
):
return
self
.
get_state_plain
()
...
...
This diff is collapsed.
Click to expand it.
views/forms.py
+
15
−
4
View file @
32f6cef7
...
...
@@ -16,7 +16,7 @@ def get_protocoltype_choices(protocoltypes, add_all=True):
def
get_todostate_choices
():
return
[
(
state
.
value
,
state
.
get_name
())
(
state
,
state
.
get_name
())
for
state
in
TodoState
]
...
...
@@ -26,6 +26,12 @@ def get_calendar_choices():
for
calendar
in
CalendarClient
().
get_calendars
()
]
def
coerce_todostate
(
key
):
if
isinstance
(
key
,
str
):
class_part
,
key_part
=
key
.
split
(
"
.
"
)
key
=
TodoState
[
key_part
]
return
key
class
LoginForm
(
FlaskForm
):
username
=
StringField
(
"
Benutzer
"
,
validators
=
[
InputRequired
(
"
Bitte gib deinen Benutzernamen ein.
"
)])
password
=
PasswordField
(
"
Passwort
"
,
validators
=
[
InputRequired
(
"
Bitte gib dein Passwort ein.
"
)])
...
...
@@ -44,7 +50,11 @@ class ProtocolTypeForm(FlaskForm):
use_wiki
=
BooleanField
(
"
Wiki benutzen
"
)
wiki_only_public
=
BooleanField
(
"
Wiki ist öffentlich
"
)
printer
=
SelectField
(
"
Drucker
"
,
choices
=
list
(
zip
(
config
.
PRINTING_PRINTERS
,
config
.
PRINTING_PRINTERS
)))
calendar
=
SelectField
(
"
Kalender
"
,
choices
=
get_calendar_choices
())
calendar
=
SelectField
(
"
Kalender
"
,
choices
=
[])
def
__init__
(
self
,
**
kwargs
):
super
().
__init__
(
self
,
**
kwargs
)
self
.
calendar
.
choices
=
get_calendar_choices
()
class
DefaultTopForm
(
FlaskForm
):
name
=
StringField
(
"
Name
"
,
validators
=
[
InputRequired
(
"
Du musst einen Namen angeben.
"
)])
...
...
@@ -124,10 +134,11 @@ class NewTodoForm(FlaskForm):
class
TodoForm
(
FlaskForm
):
who
=
StringField
(
"
Person
"
)
description
=
StringField
(
"
Aufgabe
"
,
validators
=
[
InputRequired
(
"
Bitte gib an, was erledigt werden soll.
"
)])
state
=
SelectField
(
"
Status
"
,
choices
=
[],
coerce
=
int
,
validators
=
[
CheckTodoDateByState
()])
state
=
SelectField
(
"
Status
"
,
choices
=
[],
coerce
=
coerce_todostate
,
validators
=
[
CheckTodoDateByState
()])
date
=
DateField
(
"
Datum
"
,
format
=
"
%d.%m.%Y
"
,
validators
=
[
Optional
()])
def
__init__
(
self
):
def
__init__
(
self
,
**
kwargs
):
super
().
__init__
(
**
kwargs
)
self
.
state
.
choices
=
get_todostate_choices
()
class
TodoMailForm
(
FlaskForm
):
...
...
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