Fixed so that the download buttons on the report pages are disabled when there is no data.
This commit is contained in:
		| @@ -106,10 +106,17 @@ First written: 2023/3/8 | ||||
|     <span class="d-none d-md-inline">{{ report.period.desc|title }}</span> | ||||
|   </button> | ||||
| {% endif %} | ||||
| <a class="btn btn-primary" role="button" href="{{ report.csv_uri }}"> | ||||
|   <i class="fa-solid fa-download"></i> | ||||
|   <span class="d-none d-md-inline">{{ A_("Download") }}</span> | ||||
| </a> | ||||
| {% if report.has_data %} | ||||
|   <a class="btn btn-primary" role="button" href="{{ report.csv_uri }}"> | ||||
|     <i class="fa-solid fa-download"></i> | ||||
|     <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 %} | ||||
|   <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"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user