Skip to content

Commit

Permalink
Do not try to show file bytes size if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmwatson committed Aug 15, 2024
1 parent d219996 commit dbdfe47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
volumes:
- .:/app
environment:
- FLASK_DEBUG_CACHE=true
- FLASK_DEBUG_CACHE=false
- REDIS_URL=redis://redis:6379/0
- SQLALCHEMY_DATABASE_URI=postgresql://pmg:pmg@postgres/pmg?client_encoding=utf8
- ES_SERVER=http://elastic:9200
Expand Down
4 changes: 2 additions & 2 deletions pmg/templates/bills/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ <h2>Bill Text</h2>
{% for version in bill.versions %}
<div role="tabpanel" class="tab-pane {% if loop.first %}active{% endif %}" id="bill-version-{{ version.id }}" data-url="{{ version.file.url }}">
<div class="clearfix">
<a href="{{ version.file.url }}" class="btn btn-default pull-right"><i class="fa fa-file-text"></i> Download ({{ version.file.file_bytes | filesizeformat }})</a>
<a href="{{ version.file.url }}" class="btn btn-default pull-right"><i class="fa fa-file-text"></i> Download{% if (version.file.file_bytes) %} ({{ (version.file.file_bytes | filesizeformat) }}) {% endif %}</a>
<h4>{{ version.title }}</h4>
</div>

{% if version.file.file_mime == "application/pdf" %}
<div class="bill-version-wrapper">
<button class="btn btn-primary load-pdf">Show PDF ({{ version.file.file_bytes | filesizeformat }})</button>
<button class="btn btn-primary load-pdf">Show PDF{% if (version.file.file_bytes) %} ({{ (version.file.file_bytes | filesizeformat) }}){% endif %}</button>
</div>
{% else %}
<p class="alert alert-info"><i>A preview of this file is not available. Please download it instead.</i></p>
Expand Down

0 comments on commit dbdfe47

Please sign in to comment.