Skip to content

Do not try to show file bytes size if not available #563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading