Skip to content

Commit

Permalink
Genericized batch actions js for browse pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM committed May 20, 2018
1 parent d267a59 commit d397a70
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion application/asset/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ var Omeka = {
},

manageSelectedActions: function() {
var selectedOptions = $('[value="update-selected"], [value="delete-selected"]');
var selectedOptions = $('#batch-form .batch-inputs [data-select=selected]');
if ($('.batch-edit td input[type="checkbox"]:checked').length > 0) {
selectedOptions.removeAttr('disabled');
} else {
Expand Down
10 changes: 5 additions & 5 deletions application/view/omeka/admin/item-set/browse.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ $sortHeadings = [
<div class="batch-inputs">
<select class="batch-actions-select" aria-label="<?php echo $this->translate('Batch actions'); ?>">
<option value="default"><?php echo $this->translate('Batch actions'); ?></option>
<option value="update-selected" disabled="true"><?php echo $this->translate('Edit selected'); ?></option>
<option value="update-all"><?php echo $this->translate('Edit all'); ?></option>
<option value="delete-selected" disabled="true"><?php echo $this->translate('Delete selected'); ?></option>
<option value="delete-all"><?php echo $this->translate('Delete all'); ?></option>
<option value="update-selected" data-select="selected" disabled="disabled"><?php echo $this->translate('Edit selected'); ?></option>
<option value="update-all" data-select="all"><?php echo $this->translate('Edit all'); ?></option>
<option value="delete-selected" data-select="selected" disabled="disabled"><?php echo $this->translate('Delete selected'); ?></option>
<option value="delete-all" data-select="all"><?php echo $this->translate('Delete all'); ?></option>
</select>
<div class="batch-actions">
<button type="button" class="default active" disabled="true"><?php echo $this->translate('Go'); ?></button>
<button type="button" class="default active" disabled="disabled"><?php echo $this->translate('Go'); ?></button>
<input type="submit" class="update-selected" name="update_selected" value="<?php echo $this->translate('Go'); ?>" formaction="<?php echo $escape($this->url(null, ['action' => 'batch-edit'], true)); ?>">
<input type="submit" class="update-all" name="update_all" value="<?php echo $this->translate('Go'); ?>" formaction="<?php echo $escape($this->url(null, ['action' => 'batch-edit-all'], true)); ?>">
<input type="hidden" name="query" class="batch-query" value="<?php echo $escape(json_encode($this->params()->fromQuery())); ?>">
Expand Down
10 changes: 5 additions & 5 deletions application/view/omeka/admin/item/browse.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ $sortHeadings = [
<div class="batch-inputs">
<select class="batch-actions-select" aria-label="<?php echo $this->translate('Batch actions'); ?>">
<option value="default"><?php echo $this->translate('Batch actions'); ?></option>
<option value="update-selected" disabled="true"><?php echo $this->translate('Edit selected'); ?></option>
<option value="update-all"><?php echo $this->translate('Edit all'); ?></option>
<option value="delete-selected" disabled="true"><?php echo $this->translate('Delete selected'); ?></option>
<option value="delete-all"><?php echo $this->translate('Delete all'); ?></option>
<option value="update-selected" data-select="selected" disabled="disabled"><?php echo $this->translate('Edit selected'); ?></option>
<option value="update-all" data-select="all"><?php echo $this->translate('Edit all'); ?></option>
<option value="delete-selected" data-select="selected" disabled="disabled"><?php echo $this->translate('Delete selected'); ?></option>
<option value="delete-all" data-select="all"><?php echo $this->translate('Delete all'); ?></option>
</select>
<div class="batch-actions">
<button type="button" class="default active" disabled="true"><?php echo $this->translate('Go'); ?></button>
<button type="button" class="default active" disabled="disabled"><?php echo $this->translate('Go'); ?></button>
<input type="submit" class="update-selected" name="update_selected" value="<?php echo $this->translate('Go'); ?>" formaction="<?php echo $escape($this->url(null, ['action' => 'batch-edit'], true)); ?>">
<input type="submit" class="update-all" name="update_all" value="<?php echo $this->translate('Go'); ?>" formaction="<?php echo $escape($this->url(null, ['action' => 'batch-edit-all'], true)); ?>">
<input type="hidden" name="query" class="batch-query" value="<?php echo $escape(json_encode($this->params()->fromQuery())); ?>">
Expand Down
8 changes: 4 additions & 4 deletions application/view/omeka/admin/media/browse.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ $sortHeadings = [
<select class="batch-actions-select" aria-label="<?php echo $this->translate('Batch actions'); ?>">
<option value="default"><?php echo $this->translate('Batch actions'); ?></option>
<?php if ($userIsAllowedBatchUpdate): ?>
<option value="update-selected" disabled="disabled"><?php echo $this->translate('Edit selected'); ?></option>
<option value="update-all"><?php echo $this->translate('Edit all'); ?></option>
<option value="update-selected" data-select="selected" disabled="disabled"><?php echo $this->translate('Edit selected'); ?></option>
<option value="update-all" data-select="all"><?php echo $this->translate('Edit all'); ?></option>
<?php endif; ?>
<?php if ($userIsAllowedBatchDelete): ?>
<option value="delete-selected" disabled="disabled"><?php echo $this->translate('Delete selected'); ?></option>
<option value="delete-all"><?php echo $this->translate('Delete all'); ?></option>
<option value="delete-selected" data-select="selected" disabled="disabled"><?php echo $this->translate('Delete selected'); ?></option>
<option value="delete-all" data-select="all"><?php echo $this->translate('Delete all'); ?></option>
<?php endif; ?>
</select>
<div class="batch-actions">
Expand Down

0 comments on commit d397a70

Please sign in to comment.