Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
abc5c119
Commit
abc5c119
authored
Jun 04, 2017
by
Administrator
Browse files
Fix existance-check of documents on index
parent
2133d2cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
models/database.py
View file @
abc5c119
...
@@ -281,10 +281,11 @@ class Protocol(DatabaseModel):
...
@@ -281,10 +281,11 @@ class Protocol(DatabaseModel):
if
not
todo
.
is_done
()
if
not
todo
.
is_done
()
]
]
def
has_compiled_document
(
self
):
def
has_compiled_document
(
self
,
private
=
None
):
candidates
=
[
candidates
=
[
document
for
document
in
self
.
documents
document
for
document
in
self
.
documents
if
document
.
is_compiled
if
document
.
is_compiled
and
(
private
is
None
or
document
.
is_private
==
private
)
]
]
return
len
(
candidates
)
>
0
return
len
(
candidates
)
>
0
...
...
templates/index.html
View file @
abc5c119
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
{% if protocol.protocoltype.has_modify_right(current_user()) %}
{% if protocol.protocoltype.has_modify_right(current_user()) %}
<a
class=
"btn btn-default"
href=
"{{url_for("
update_protocol
",
protocol_id=
protocol.id)}}"
>
Protokoll editieren
</a>
<a
class=
"btn btn-default"
href=
"{{url_for("
update_protocol
",
protocol_id=
protocol.id)}}"
>
Protokoll editieren
</a>
{% endif %}
{% endif %}
{% if protocol.has_compiled_document() %}
{% if protocol.has_compiled_document(
private=show_private
) %}
<a
class=
"btn btn-success"
href=
"{{url_for("
download_document
",
document_id=
protocol.get_compiled_document(private=show_private).id)}}"
>
Download
</a>
<a
class=
"btn btn-success"
href=
"{{url_for("
download_document
",
document_id=
protocol.get_compiled_document(private=show_private).id)}}"
>
Download
</a>
{% endif %}
{% endif %}
</div>
</div>
...
...
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