filter-column-select.blade.php
11 months ago
interrupt-header.blade.php
11 months ago
report-header.blade.php
2 days ago
sidebar-menu-section.blade.php
2 days ago
sidebar.blade.php
2 days ago
report-header.blade.php
129 lines
| 1 | @php /** @var \IAWP\Report $report */ @endphp |
| 2 | @php /** @var bool $can_edit */ @endphp |
| 3 | |
| 4 | <div id="report-title-bar" class="report-title-bar"><?php |
| 5 | if ($report->is_saved_report()) : ?> |
| 6 | <div data-controller="<?php echo $can_edit ? "rename-report" : ""; ?>" |
| 7 | data-rename-report-id-value="<?php echo esc_attr($report->id()); ?>" |
| 8 | data-rename-report-name-value="<?php echo esc_attr($report->name()); ?>" |
| 9 | class="modal-parent small rename-report"> |
| 10 | <a id="rename-link" class="rename-link <?php echo !$can_edit ? 'no-edit' : ''; ?>" href="#" |
| 11 | data-action="click->rename-report#toggleModal" |
| 12 | data-rename-report-target="modalButton" |
| 13 | title="<?php echo esc_attr($report->name()); ?>"> |
| 14 | <h1 data-name-for-report-id="<?php echo esc_attr($report->id()); ?>" |
| 15 | class="report-title"><?php echo esc_html($report->name()); ?></h1><?php |
| 16 | if ($can_edit) : ?> |
| 17 | <span class="dashicons dashicons-edit"></span><?php |
| 18 | endif; ?> |
| 19 | </a><?php |
| 20 | if ($can_edit) : ?> |
| 21 | <div class="iawp-modal small" data-rename-report-target="modal"> |
| 22 | <div class="modal-inner"> |
| 23 | <div class="title-small"> |
| 24 | <?php esc_html_e('Rename report', 'independent-analytics'); ?> |
| 25 | </div> |
| 26 | <p><?php esc_html_e('Give this report a new name', 'independent-analytics'); ?></p> |
| 27 | <form data-action="rename-report#rename"> |
| 28 | <input type="text" data-rename-report-target="input" |
| 29 | placeholder="Report name" required> |
| 30 | <button data-rename-report-target="renameButton" |
| 31 | class="iawp-button purple"><?php esc_html_e('Update title', 'independent-analytics'); ?> |
| 32 | </button> |
| 33 | </form> |
| 34 | </div> |
| 35 | </div><?php |
| 36 | endif; ?> |
| 37 | </div><?php |
| 38 | else : ?> |
| 39 | <div class="primary-report-title-container"> |
| 40 | <h1 class="report-title"><?php echo esc_html($report->name()); ?></h1> |
| 41 | </div><?php |
| 42 | endif; ?> |
| 43 | <div class="buttons"> |
| 44 | <?php if ($can_edit && $report->is_saved_report()) : ?> |
| 45 | <div data-controller="save-report" data-save-report-id-value="<?php echo esc_html($report->id()); ?>" |
| 46 | class="save-report"> |
| 47 | <p data-save-report-target="warning" style="display: none;" |
| 48 | class="unsaved-warning"><span class="dashicons dashicons-warning"></span> |
| 49 | <span class="text"><?php esc_html_e('You have unsaved changes', 'independent-analytics'); ?></span></p> |
| 50 | <button id="save-report-button" |
| 51 | data-save-report-target="button" |
| 52 | data-action="save-report#save" |
| 53 | class="save-report-button iawp-button"><?php esc_html_e('Save', 'independent-analytics'); ?></button> |
| 54 | </div> |
| 55 | <?php endif; ?> |
| 56 | |
| 57 | <?php if ($can_edit) : ?> |
| 58 | <div data-controller="copy-report" <?php |
| 59 | if($report->is_saved_report()) : ?> |
| 60 | data-copy-report-id-value="<?php echo esc_attr($report->id()); ?>" <?php |
| 61 | else : ?> |
| 62 | data-copy-report-type-value="<?php echo esc_attr($report->type()); ?>" <?php |
| 63 | endif; ?> |
| 64 | class="modal-parent small copy-report" |
| 65 | > |
| 66 | <button id="save-as-report-button" |
| 67 | data-action="click->copy-report#toggleModal" |
| 68 | data-copy-report-target="modalButton" |
| 69 | class="save-as-report-button iawp-button"><?php esc_html_e('Save As', 'independent-analytics'); ?></button> |
| 70 | <div class="iawp-modal small" data-copy-report-target="modal"> |
| 71 | <div class="modal-inner"> |
| 72 | <div class="title-small"> |
| 73 | <?php esc_html_e('Create new report', 'independent-analytics'); ?> |
| 74 | </div> |
| 75 | <p><?php esc_html_e('Enter a name for the new report.', 'independent-analytics'); ?></p> |
| 76 | <form data-action="copy-report#copy"> |
| 77 | <input type="text" data-copy-report-target="input" |
| 78 | placeholder="Report name" required> |
| 79 | <button data-copy-report-target="copyButton" class="iawp-button purple"> |
| 80 | <?php esc_html_e('Save as', 'independent-analytics'); ?> |
| 81 | </button> |
| 82 | </form> |
| 83 | </div> |
| 84 | </div> |
| 85 | </div> |
| 86 | <?php endif; ?> |
| 87 | |
| 88 | <div> |
| 89 | |
| 90 | <button id="favorite-report-button" |
| 91 | class="iawp-button favorite <?php echo $report->is_favorite() ? 'active' : ''; ?>" |
| 92 | data-controller="set-favorite-report" |
| 93 | data-set-favorite-report-id-value="<?php echo esc_attr($report->is_saved_report() ? $report->id() : ''); ?>" |
| 94 | data-set-favorite-report-type-value="<?php echo esc_attr($report->is_saved_report() ? '' : $report->type()); ?>" |
| 95 | data-action="set-favorite-report#toggleFavoriteReport" |
| 96 | data-unfavorited-text="<?php echo esc_attr_e('Use as default report') ?>" |
| 97 | data-favorited-text="<?php echo esc_attr_e('Remove as default report') ?>" |
| 98 | > |
| 99 | <span class="dashicons dashicons-star-filled"></span> |
| 100 | </button> |
| 101 | </div> |
| 102 | |
| 103 | <?php if ($can_edit && $report->is_saved_report()) : ?> |
| 104 | <div data-controller="delete-report" data-delete-report-id-value="<?php echo esc_attr($report->id()); ?>" |
| 105 | class="modal-parent small delete-report"> |
| 106 | <button id="delete-report-button" |
| 107 | data-action="delete-report#toggleModal" |
| 108 | data-delete-report-target="modalButton" class="iawp-button" |
| 109 | title="<?php echo esc_attr__('Delete report', 'independent-analytics') ?>" |
| 110 | > |
| 111 | <span class="dashicons dashicons-trash"></span> |
| 112 | </button> |
| 113 | <div class="iawp-modal small" data-delete-report-target="modal"> |
| 114 | <div class="modal-inner"> |
| 115 | <div class="title-small"> |
| 116 | <?php esc_html_e('Confirm', 'independent-analytics'); ?> |
| 117 | </div> |
| 118 | <p><?php esc_html_e('Are you sure you want to delete this report?', 'independent-analytics'); ?></p> |
| 119 | <button data-action="delete-report#delete" |
| 120 | data-delete-report-target="deleteButton" |
| 121 | class="iawp-button red"><?php esc_html_e('Delete report', 'independent-analytics'); ?> |
| 122 | </button> |
| 123 | </div> |
| 124 | </div> |
| 125 | </div> |
| 126 | <?php endif; ?> |
| 127 | </div> |
| 128 | </div> |
| 129 |