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
29f9b254
Commit
29f9b254
authored
7 years ago
by
marco
Browse files
Options
Downloads
Patches
Plain Diff
UI fix and improve /protocol/list
/close 156
parent
66ead555
Branches
Branches containing commit
No related tags found
1 merge request
!10
Resolve "Protokolle Übersichtseite umbauen"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
views/tables.py
+15
-24
15 additions, 24 deletions
views/tables.py
with
15 additions
and
24 deletions
views/tables.py
+
15
−
24
View file @
29f9b254
...
@@ -31,11 +31,9 @@ class Table:
...
@@ -31,11 +31,9 @@ class Table:
if
confirm
:
if
confirm
:
confirmation
=
"
onclick=
\"
return confirm(
'
{}
'
);
\"
"
.
format
(
confirm
)
confirmation
=
"
onclick=
\"
return confirm(
'
{}
'
);
\"
"
.
format
(
confirm
)
return
Markup
(
return
Markup
(
'''
<div class=
"
btn-group btn-group-xs
"
>
'''
<a href=
"
{target}
"
class=
"
btn btn-{style}
"
{confirmation}>
<a href=
"
{target}
"
class=
"
btn btn-{style}
"
{confirmation}>
<span class=
"
glyphicon glyphicon-{icon}
"
></span>
<span class=
"
glyphicon glyphicon-{icon}
"
></span>
</a>
</a>
'''
.
format
(
target
=
target
,
style
=
style
,
confirmation
=
confirmation
,
icon
=
icon
))
</div>
'''
.
format
(
target
=
target
,
style
=
style
,
confirmation
=
confirmation
,
icon
=
icon
))
@staticmethod
@staticmethod
def
mail
(
target
):
def
mail
(
target
):
...
@@ -72,24 +70,19 @@ class ProtocolsTable(Table):
...
@@ -72,24 +70,19 @@ class ProtocolsTable(Table):
def
headers
(
self
):
def
headers
(
self
):
user
=
current_user
()
user
=
current_user
()
result
=
[
"
Sitzung
"
,
"
Sitzung
"
,
"
Datum
"
]
result
=
[
"
Sitzung
"
,
"
Sitzung
"
,
"
Datum
"
]
state_part
=
[
"
Status
"
]
state_part
=
[
"
Status
"
,
"
Status
"
,
""
]
search_part
=
[
"
Suchergebnis
"
]
search_part
=
[
"
Suchergebnis
"
,
""
]
login_part
=
[
""
]
if
self
.
search_results
is
None
:
if
self
.
search_results
is
None
:
result
.
extend
(
state_part
)
result
.
extend
(
state_part
)
else
:
else
:
result
.
extend
(
search_part
)
result
.
extend
(
search_part
)
if
check_login
():
result
.
extend
(
login_part
)
return
result
return
result
def
classes
(
self
):
def
classes
(
self
):
state_or_search_class
=
"
hidden-xs
"
if
self
.
search_results
is
None
else
None
if
self
.
search_results
is
None
:
result
=
[
"
hidden-sm hidden-md hidden-lg
"
,
"
hidden-xs
"
,
"
hidden-xs
"
,
None
]
result
=
[
"
hidden-sm hidden-md hidden-lg
"
,
"
hidden-xs
"
,
"
hidden-xs
"
,
"
hidden-sm hidden-md hidden-lg
"
,
"
hidden-xs
"
,
""
]
#result.append(state_or_search_class)
else
:
login_part
=
[
"
hidden-xs
"
]
result
=
[
"
hidden-sm hidden-md hidden-lg
"
,
"
hidden-xs
"
,
"
hidden-xs
"
,
""
,
"
hidden-xs
"
,
"
hidden-xs
"
]
if
check_login
():
result
.
extend
(
login_part
)
return
result
return
result
def
row
(
self
,
protocol
):
def
row
(
self
,
protocol
):
...
@@ -101,23 +94,21 @@ class ProtocolsTable(Table):
...
@@ -101,23 +94,21 @@ class ProtocolsTable(Table):
date_filter
(
protocol
.
date
),
date_filter
(
protocol
.
date
),
]
]
if
self
.
search_results
is
None
:
if
self
.
search_results
is
None
:
state
=
"
pencil
"
#"Geplant"
result
.
append
(
Markup
(
'
<span class=
"
glyphicon glyphicon-{state}
"
></span>
'
.
format
(
state
=
protocol
.
get_state_glyph
())))
if
protocol
.
is_done
():
result
.
append
(
Markup
(
'
<span class=
"
glyphicon glyphicon-{glyph}
"
></span> {state}
'
.
format
(
state
=
protocol
.
get_state_name
(),
glyph
=
protocol
.
get_state_glyph
())))
state
=
"
unchecked
"
#"Fertig"
if
protocol
.
public
:
state
=
"
check
"
#"Veröffentlicht"
result
.
append
(
Markup
(
'
<span class=
"
glyphicon glyphicon-{state}
"
>
'
.
format
(
state
=
state
)))
elif
protocol
in
self
.
search_results
:
elif
protocol
in
self
.
search_results
:
result
.
append
(
Markup
(
self
.
search_results
[
protocol
]))
result
.
append
(
Markup
(
self
.
search_results
[
protocol
]))
result
.
append
(
Markup
(
'
<span class=
"
glyphicon glyphicon-{state}
"
></span>
'
.
format
(
state
=
protocol
.
get_state_glyph
())))
login_part1
=
""
login_part1
=
""
login_part2
=
""
login_part2
=
""
if
state
!=
"
pencil
"
:
if
protocol
.
has_public_view_right
(
user
):
document
=
protocol
.
get_compiled_document
()
user_right
=
protocol
.
has_private_view_right
(
user
)
document
=
protocol
.
get_compiled_document
(
user_right
)
if
document
is
not
None
:
if
document
is
not
None
:
login_part1
=
Table
.
button
(
login_part1
=
Table
.
button
(
url_for
(
"
download_document
"
,
document_id
=
document
.
id
),
url_for
(
"
download_document
"
,
document_id
=
document
.
id
),
icon
=
"
download
"
,
style
=
""
)
icon
=
"
download
"
,
style
=
"
success
"
)
if
protocol
.
protocoltype
.
has_admin_right
(
user
):
if
protocol
.
protocoltype
.
has_admin_right
(
user
):
login_part2
=
Table
.
button
(
login_part2
=
Table
.
button
(
...
...
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