form-fields
11 months ago
modules
11 months ago
module-editor.blade.php
11 months ago
module-picker.blade.php
11 months ago
module-templates.blade.php
11 months ago
overview.blade.php
11 months ago
module-editor.blade.php
48 lines
| 1 | @php /** @var \IAWP\Env $env */ @endphp |
| 2 | @php /** @var \IAWP\Overview\Modules\Module $module */ @endphp |
| 3 | |
| 4 | <div class="iawp-module module-editor <?php echo $module !== null && $module->is_full_width() ? 'full-width' : ''; ?>" |
| 5 | data-controller="module-editor" |
| 6 | data-module-editor-module-id-value="<?php echo esc_attr($module->id()); ?>" |
| 7 | data-module-editor-reports-value="<?php echo esc_attr(json_encode($module->get_report_details())); ?>"> |
| 8 | <header class="module-header"> |
| 9 | <div class="module-icon"><?php |
| 10 | echo iawp_blade()->run('icons.overview.' . $module->module_type()); ?> |
| 11 | </div> |
| 12 | <div class="module-title-container"> |
| 13 | <h2><?php echo esc_html($module->module_name()); ?></h2> |
| 14 | </div> |
| 15 | <button class="iawp-button module-editing-buttons change-module-type" data-action="module-editor#changeModuleType"><?php esc_html_e('Change Module Type', 'independent-analytics'); ?></button> |
| 16 | <button class="iawp-button module-editing-buttons cancel-module-edit" data-module-editor-target="cancelButton" data-action="module-editor#cancel"><?php esc_html_e('Cancel', 'independent-analytics'); ?></button> |
| 17 | </header> |
| 18 | |
| 19 | <div class="module-contents"> |
| 20 | <div> |
| 21 | <form class="iawp-module-editor-form" data-action="module-editor#save"> |
| 22 | <input type="hidden" name="module_type" value="<?php echo esc_attr($module->module_type()); ?>"> |
| 23 | <div> |
| 24 | <label><?php esc_html_e('Name', 'independent-analytics'); ?></label> |
| 25 | <input type="text" |
| 26 | name="name" |
| 27 | value="<?php echo esc_attr($module->is_saved() ? $module->name() : $module->module_name()); ?>" |
| 28 | autofocus |
| 29 | required |
| 30 | data-1p-ignore |
| 31 | > |
| 32 | </div> |
| 33 | |
| 34 | <?php echo $module->get_form_fields_html(); ?> |
| 35 | |
| 36 | <footer> |
| 37 | <button type="submit" |
| 38 | class="module-save-button iawp-button purple" |
| 39 | data-module-editor-target="saveButton" |
| 40 | data-loading-text="<?php esc_html_e('Saving...'); ?>" |
| 41 | > |
| 42 | <?php echo $module->is_saved() ? esc_html__('Save', 'independent-analytics') : esc_html__('Add Module', 'independent-analytics'); ?> |
| 43 | </button> |
| 44 | </footer> |
| 45 | </form> |
| 46 | </div> |
| 47 | </div> |
| 48 | </div> |