Skip to content

Commit

Permalink
Hide download ZIP file button if no files are present
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinVanhove committed Apr 24, 2020
1 parent 0f904d5 commit 0a2bcfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ <h1 class="icon icon-form">
<div class="col">
<button name="action" value="CSV" class="button bicolor icon icon-download">{% trans 'Download CSV' %}</button>
</div>
{% if contains_files %}
<div class="col">
<button name="action" value="ZIP" class="button bicolor icon icon-download">{% trans 'Download ZIP' %}</button>
</div>
{% endif %}
</div>
</div>
</form>
Expand Down
1 change: 1 addition & 0 deletions wagtailstreamforms/views/submission_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def get_context_data(self, **kwargs):
"has_delete_permission": self.permission_helper.user_can_delete_obj(
self.request.user, self.object
),
"contains_files": FormSubmissionFile.objects.filter(submission__form=self.object).count() > 0
}
)

Expand Down

0 comments on commit 0a2bcfd

Please sign in to comment.