Added a button to download equipment instruction manuals (closes #833)

This commit is contained in:
Bernd Bestel 2020-11-17 21:01:45 +01:00
parent d2d09cf928
commit 604629ed5e
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
4 changed files with 16 additions and 1 deletions

View File

@ -107,6 +107,7 @@
### Equipment improvements ### Equipment improvements
- The equipment page now will never automatically reload, even when `Auto reload on external changes` is on and a change was detected (because you most probably have that page open longer to read the manual) (thanks @fipwmaqzufheoxq92ebc) - The equipment page now will never automatically reload, even when `Auto reload on external changes` is on and a change was detected (because you most probably have that page open longer to read the manual) (thanks @fipwmaqzufheoxq92ebc)
- There is now a button to download the instruction manual (next to the "expand to fullscreen"-button)
### Calendar improvements/fixes ### Calendar improvements/fixes
- Events are now links to the corresponding page (thanks @zsarnett) - Events are now links to the corresponding page (thanks @zsarnett)

View File

@ -1990,3 +1990,6 @@ msgstr ""
msgid "Sort number" msgid "Sort number"
msgstr "" msgstr ""
msgid "Download file"
msgstr ""

View File

@ -40,7 +40,9 @@ function DisplayEquipment(id)
{ {
var pdfUrl = U('/api/files/equipmentmanuals/' + btoa(equipmentItem.instruction_manual_file_name)); var pdfUrl = U('/api/files/equipmentmanuals/' + btoa(equipmentItem.instruction_manual_file_name));
$("#selected-equipment-instruction-manual").attr("src", pdfUrl); $("#selected-equipment-instruction-manual").attr("src", pdfUrl);
$("#selectedEquipmentInstructionManualDownloadButton").attr("href", pdfUrl);
$("#selected-equipment-instruction-manual").removeClass("d-none"); $("#selected-equipment-instruction-manual").removeClass("d-none");
$("#selectedEquipmentInstructionManualDownloadButton").removeClass("d-none");
$("#selected-equipment-has-no-instruction-manual-hint").addClass("d-none"); $("#selected-equipment-has-no-instruction-manual-hint").addClass("d-none");
$("a[href='#instruction-manual-tab']").tab("show"); $("a[href='#instruction-manual-tab']").tab("show");
@ -49,6 +51,7 @@ function DisplayEquipment(id)
else else
{ {
$("#selected-equipment-instruction-manual").addClass("d-none"); $("#selected-equipment-instruction-manual").addClass("d-none");
$("#selectedEquipmentInstructionManualDownloadButton").addClass("d-none");
$("#selected-equipment-has-no-instruction-manual-hint").removeClass("d-none"); $("#selected-equipment-has-no-instruction-manual-hint").removeClass("d-none");
$("a[href='#description-tab']").tab("show"); $("a[href='#description-tab']").tab("show");

View File

@ -131,12 +131,20 @@
<div class="card-header card-header-fullscreen"> <div class="card-header card-header-fullscreen">
<span class="selected-equipment-name"></span> <span class="selected-equipment-name"></span>
<a id="selectedEquipmentInstructionManualToggleFullscreenButton" <a id="selectedEquipmentInstructionManualToggleFullscreenButton"
class="btn btn-sm btn-outline-secondary py-0 float-right" class="btn btn-sm btn-outline-secondary py-0 float-right mr-1"
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('Expand to fullscreen') }}"> title="{{ $__t('Expand to fullscreen') }}">
<i class="fas fa-expand-arrows-alt"></i> <i class="fas fa-expand-arrows-alt"></i>
</a> </a>
<a id="selectedEquipmentInstructionManualDownloadButton"
class="btn btn-sm btn-outline-secondary py-0 float-right mr-1"
href="#"
target="_blank"
data-toggle="tooltip"
title="{{ $__t('Download file') }}">
<i class="fas fa-file-download"></i>
</a>
</div> </div>
<div class="card-body py-0 px-0"> <div class="card-body py-0 px-0">
<p id="selected-equipment-has-no-instruction-manual-hint" <p id="selected-equipment-has-no-instruction-manual-hint"