| @@ -1,76 +1,86 @@ | ||
| 1 | -<div class="wrap" ng-controller="wpStatelessProcessing" ng-init="init()"> | |
| 1 | +<div class="wrap"> | |
| 2 | 2 | |
| 3 | -<noscript> | |
| 4 | - <p><em><?php _e('You must enable Javascript in order to use this feature!', ud_get_stateless_media()->domain); ?></em></p> | |
| 5 | -</noscript> | |
| 3 | + <div id="errors" class="stateless-admin-notice admin-error"> | |
| 4 | + <strong><?php _e('Errors encountered. Try reloading the page.', ud_get_stateless_media()->domain); ?></strong> | |
| 5 | + <ul></ul> | |
| 6 | + </div> | |
| 6 | 7 | |
| 7 | -<div ng-show="errors.length" class="stateless-admin-notice admin-error"> | |
| 8 | - <strong><?php _e('Errors encountered. Try reloading the page.', ud_get_stateless_media()->domain); ?></strong> | |
| 9 | - <ul> | |
| 10 | - <li ng-repeat="error in errors">{{error}}</li> | |
| 11 | - </ul> | |
| 12 | -</div> | |
| 8 | + <div class="metabox-holder processes-holder"> | |
| 9 | + <p class="processing-hint"><strong><?php _e('Hint', ud_get_stateless_media()->domain) ?>:</strong> <?php _e('You can close this page once processing is started.', ud_get_stateless_media()->domain) ?></p> | |
| 10 | + | |
| 11 | + <div class="postbox-container"> | |
| 12 | + <?php foreach ($processes as $process) : ?> | |
| 13 | 13 | |
| 14 | -<div ng-show="processes.isLoading"><?php _e('Loading available processes...', ud_get_stateless_media()->domain); ?></div> | |
| 14 | + <div class="postbox" data-id="<?php echo preg_replace('/[^a-zA-Z0-9]/', '', $process->id); ?>"> | |
| 15 | 15 | |
| 16 | -<div class="metabox-holder" ng-show="processes.classes.length"> | |
| 17 | - <p class="processing-hint"><strong><?php _e('Hint', ud_get_stateless_media()->domain) ?>:</strong> <?php _e('You can close this page once processing is started.', ud_get_stateless_media()->domain) ?></p> | |
| 18 | - <div class="postbox-container"> | |
| 16 | + <div class="postbox-header"> | |
| 17 | + <h2 class="hndle"> | |
| 18 | + <div class="title-holder"><?php echo $process->name; ?></div> | |
| 19 | 19 | |
| 20 | - <div class="postbox" ng-repeat="process in processes.classes"> | |
| 21 | - <div class="postbox-header"> | |
| 22 | - <h2 class="hndle"> | |
| 23 | - <div class="title-holder" ng-bind-html="process.name"> | |
| 20 | + <span> | |
| 21 | + <span title="<?php _e('Processing in progress...', ud_get_stateless_media()->domain) ?>" class="loading dashicons dashicons-update"></span> | |
| 22 | + | |
| 23 | + <?php if ($process->helper) : ?> | |
| 24 | + <a href="javascript:;" data-position='{"edge":"left","align":"center"}' data-title="<?php echo $process->helper['title']; ?>" data-text="<?php echo $process->helper['content']; ?>" class="pointer dashicons dashicons-info"></a> | |
| 25 | + <?php endif; ?> | |
| 26 | + </span> | |
| 27 | + </h2> | |
| 24 | 28 | </div> |
| 25 | - <span> | |
| 26 | - <span title="<?php _e('Processing in progress...', ud_get_stateless_media()->domain) ?>" ng-show="process.is_running" class="loading dashicons dashicons-update"></span> | |
| 27 | - <a ng-show="process.helper" href="javascript:;" data-position='{"edge":"left","align":"center"}' data-title="{{process.helper.title}}" data-text="{{process.helper.content}}" class="pointer dashicons dashicons-info"></a> | |
| 28 | - </span> | |
| 29 | - </h2> | |
| 30 | - </div> | |
| 31 | - <div class="inside"> | |
| 32 | - <ul> | |
| 33 | - <li><strong><?php _e('Total Items', ud_get_stateless_media()->domain) ?>:</strong> <span>{{process.total_items}}</span></li> | |
| 34 | - </ul> | |
| 35 | - <div class="options" ng-show="process.allow_limit"> | |
| 36 | - <label><?php _e('Enable Limit', ud_get_stateless_media()->domain) ?> <input type="checkbox" ng-model="process.limit_enabled" ng-disabled="process.is_running" ng-change="process.limit = 0" /></label> | |
| 37 | - <label ng-style="{visibility: process.limit_enabled || process.limit > 0 ? 'visible' : 'hidden'}"> | |
| 38 | - <input ng-disabled="!process.limit_enabled || process.is_running" type="number" ng-model="process.limit" style="width:80px" /> | |
| 39 | - </label> | |
| 40 | - </div> | |
| 41 | - <div class="options" ng-show="process.allow_sorting"> | |
| 42 | - <label> | |
| 43 | - <?php _e('Start from', ud_get_stateless_media()->domain) ?> | |
| 44 | - <select ng-model="process.order" ng-disabled="process.is_running"> | |
| 45 | - <option value="desc"><?php _e('newest', ud_get_stateless_media()->domain) ?></option> | |
| 46 | - <option value="asc"><?php _e('oldest', ud_get_stateless_media()->domain) ?></option> | |
| 47 | - </select> | |
| 48 | - </label> | |
| 49 | - </div> | |
| 50 | - <div class="progress" ng-show="process.is_running"> | |
| 51 | - <div class="bar-wrapper"> | |
| 52 | - <div class="legend"> | |
| 53 | - <strong class="total"><?php _e('Total', ud_get_stateless_media()->domain) ?>: {{process.getProgressTotal()}}</strong> | |
| 54 | - <strong class="queued"><?php _e('Queued', ud_get_stateless_media()->domain) ?>: {{process.getQueuedTotal()}}</strong> | |
| 55 | - <strong class="processed"><?php _e('Processed', ud_get_stateless_media()->domain) ?>: {{process.processed_items}}</strong> | |
| 29 | + | |
| 30 | + <div class="inside"> | |
| 31 | + <ul> | |
| 32 | + <li><strong><?php _e('Total Items', ud_get_stateless_media()->domain) ?>:</strong> <span><?php echo $process->total_items; ?></span></li> | |
| 33 | + </ul> | |
| 34 | + | |
| 35 | + <?php if ($process->allow_limit) : ?> | |
| 36 | + <div class="options"> | |
| 37 | + <label><?php _e('Enable Limit', ud_get_stateless_media()->domain) ?> <input type="checkbox" class="limit_enabled"/></label> | |
| 38 | + | |
| 39 | + <label class="limit_field"> | |
| 40 | + <input type="number" style="width:80px" /> | |
| 41 | + </label> | |
| 42 | + </div> | |
| 43 | + <?php endif; ?> | |
| 44 | + | |
| 45 | + <?php if ($process->allow_sorting) : ?> | |
| 46 | + <div class="options"> | |
| 47 | + <label> | |
| 48 | + <?php _e('Start from', ud_get_stateless_media()->domain) ?> | |
| 49 | + <select class="order_value"> | |
| 50 | + <option value="desc" selected><?php _e('newest', ud_get_stateless_media()->domain) ?></option> | |
| 51 | + <option value="asc"><?php _e('oldest', ud_get_stateless_media()->domain) ?></option> | |
| 52 | + </select> | |
| 53 | + </label> | |
| 54 | + </div> | |
| 55 | + <?php endif; ?> | |
| 56 | + | |
| 57 | + <div class="progress"> | |
| 58 | + <div class="bar-wrapper"> | |
| 59 | + <div class="legend"> | |
| 60 | + <strong class="total"><?php _e('Total', ud_get_stateless_media()->domain) ?>: <span></span></strong> | |
| 61 | + <strong class="queued"><?php _e('Queued', ud_get_stateless_media()->domain) ?>: <span></span></strong> | |
| 62 | + <strong class="processed"><?php _e('Processed', ud_get_stateless_media()->domain) ?>: <span></span></strong> | |
| 63 | + </div> | |
| 64 | + | |
| 65 | + <div class="bar total"> | |
| 66 | + <div class="bar queued"> | |
| 67 | + <div class="bar processed"> </div> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 56 | 71 | </div> |
| 57 | - <div class="bar total" ng-style="{'background-color': process.getProgressTotal() == process.getProcessedTotal() ? '#02ae7a' : false}"> | |
| 58 | - <div class="bar queued" ng-style="{width: percentage(process.getQueuedTotal(), process.getProgressTotal()),'background-color': process.getProgressTotal() == process.getProcessedTotal() ? '#02ae7a' : false}"> | |
| 59 | - <div class="bar processed" ng-style="{width: percentage(process.getProcessedTotal(), process.getQueuedTotal()), 'background-color': process.getProgressTotal() == process.getProcessedTotal() ? '#02ae7a' : false}"> </div> | |
| 60 | - </div> | |
| 72 | + | |
| 73 | + <div class="progress-notice"></div> | |
| 74 | + | |
| 75 | + <div class="actions"> | |
| 76 | + <button type="button" class="button button-primary disabled"><?php _e('Run', ud_get_stateless_media()->domain) ?></button> | |
| 77 | + <button type="button" class="button button-secondary disabled"><?php _e('Stop', ud_get_stateless_media()->domain) ?></button> | |
| 61 | 78 | </div> |
| 79 | + | |
| 62 | 80 | </div> |
| 63 | 81 | </div> |
| 64 | - <div class="progress-notice" ng-show="process.notice.length && process.is_running"> | |
| 65 | - <p ng-repeat="notice in process.notice" ng-bind-html="notice"></p> | |
| 66 | - </div> | |
| 67 | - <div class="actions"> | |
| 68 | - <button type="button" class="button button-primary" ng-class="{disabled: !process.canRun()}" ng-click="!process.canRun() || process.run()"><?php _e('Run', ud_get_stateless_media()->domain) ?></button> | |
| 69 | - <button type="button" class="button button-secondary" ng-class="{disabled: !process.canStop()}" ng-click="!process.canStop() || process.stop()"><?php _e('Stop', ud_get_stateless_media()->domain) ?></button> | |
| 70 | - </div> | |
| 71 | - </div> | |
| 82 | + <?php endforeach; ?> | |
| 72 | 83 | </div> |
| 73 | 84 | </div> |
| 85 | + | |
| 74 | 86 | </div> |
| 75 | - | |
| 76 | -</div> | |