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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
protokollsystem
proto3
Commits
abc5c119
Commit
abc5c119
authored
8 years ago
by
Administrator
Browse files
Options
Downloads
Patches
Plain Diff
Fix existance-check of documents on index
parent
2133d2cf
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/database.py
+2
-1
2 additions, 1 deletion
models/database.py
templates/index.html
+1
-1
1 addition, 1 deletion
templates/index.html
with
3 additions
and
2 deletions
models/database.py
+
2
−
1
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
...
...
This diff is collapsed.
Click to expand it.
templates/index.html
+
1
−
1
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>
...
...
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