Fixed so that the download buttons on the report pages are disabled when there is no data.

This commit is contained in:
依瑪貓 2023-03-09 22:29:44 +08:00
parent 7feb6da062
commit 56e972c371

View File

@ -106,10 +106,17 @@ First written: 2023/3/8
<span class="d-none d-md-inline">{{ report.period.desc|title }}</span> <span class="d-none d-md-inline">{{ report.period.desc|title }}</span>
</button> </button>
{% endif %} {% endif %}
<a class="btn btn-primary" role="button" href="{{ report.csv_uri }}"> {% if report.has_data %}
<i class="fa-solid fa-download"></i> <a class="btn btn-primary" role="button" href="{{ report.csv_uri }}">
<span class="d-none d-md-inline">{{ A_("Download") }}</span> <i class="fa-solid fa-download"></i>
</a> <span class="d-none d-md-inline">{{ A_("Download") }}</span>
</a>
{% else %}
<button class="btn btn-secondary" type="button" disabled="disabled">
<i class="fa-solid fa-download"></i>
<span class="d-none d-md-inline">{{ A_("Download") }}</span>
</button>
{% endif %}
{% if use_search %} {% if use_search %}
<form class="btn btn-primary d-flex input-group" action="{{ url_for("accounting.report.search") }}" method="get" role="search" aria-labelledby="accounting-toolbar-search-label"> <form class="btn btn-primary d-flex input-group" action="{{ url_for("accounting.report.search") }}" method="get" role="search" aria-labelledby="accounting-toolbar-search-label">
<input id="accounting-toolbar-search" class="form-control form-control-sm" type="search" name="q" value="{{ request.args.q }}" placeholder=" " required="required"> <input id="accounting-toolbar-search" class="form-control form-control-sm" type="search" name="q" value="{{ request.args.q }}" placeholder=" " required="required">