diff --git a/ckan/public/base/javascript/modules/confirm-delete.js b/ckan/public/base/javascript/modules/confirm-action.js similarity index 90% rename from ckan/public/base/javascript/modules/confirm-delete.js rename to ckan/public/base/javascript/modules/confirm-action.js index c12d4d524f1..2187cf6e62b 100644 --- a/ckan/public/base/javascript/modules/confirm-delete.js +++ b/ckan/public/base/javascript/modules/confirm-action.js @@ -1,11 +1,11 @@ -this.ckan.module('confirm-delete', function (jQuery, _) { +this.ckan.module('confirm-action', function (jQuery, _) { return { /* An object of module options */ options: { /* Locale options can be overidden with data-module-i18n attribute */ i18n: { heading: _('Please Confirm Action'), - content: _('Are you sure you want to delete this item?'), + content: _('Are you sure you want to perform this action?'), confirm: _('Confirm'), cancel: _('Cancel') }, @@ -35,7 +35,7 @@ this.ckan.module('confirm-delete', function (jQuery, _) { }, /* Presents the user with a confirm dialogue to ensure that they wish to - * delete the current item. + * continue with the current action. * * Examples * @@ -50,11 +50,11 @@ this.ckan.module('confirm-delete', function (jQuery, _) { this.modal.modal('show'); }, - /* Performs the delete action for the current item. + /* Performs the action for the current item. * * Returns nothing. */ - performDelete: function () { + performAction: function () { // create a form and submit it to confirm the deletion var form = jQuery('
', { action: this.el.attr('href'), @@ -91,7 +91,7 @@ this.ckan.module('confirm-delete', function (jQuery, _) { /* Event handler for the success event */ _onConfirmSuccess: function (event) { - this.performDelete(); + this.performAction(); }, /* Event handler for the cancel event */ diff --git a/ckan/public/base/test/index.html b/ckan/public/base/test/index.html index b59622b7fe6..f55e67a249c 100644 --- a/ckan/public/base/test/index.html +++ b/ckan/public/base/test/index.html @@ -46,7 +46,7 @@ - + @@ -59,7 +59,7 @@ - + diff --git a/ckan/public/base/test/spec/modules/confirm-delete.spec.js b/ckan/public/base/test/spec/modules/confirm-action.spec.js similarity index 89% rename from ckan/public/base/test/spec/modules/confirm-delete.spec.js rename to ckan/public/base/test/spec/modules/confirm-action.spec.js index 04eddffe57b..0185afd8fc8 100644 --- a/ckan/public/base/test/spec/modules/confirm-delete.spec.js +++ b/ckan/public/base/test/spec/modules/confirm-action.spec.js @@ -1,6 +1,6 @@ /*globals describe beforeEach afterEach it assert sinon ckan jQuery */ -describe('ckan.module.ConfirmDeleteModule()', function () { - var ConfirmDeleteModule = ckan.module.registry['confirm-delete']; +describe('ckan.module.ConfirmActionModule()', function () { + var ConfirmActionModule = ckan.module.registry['confirm-action']; beforeEach(function () { jQuery.fn.modal = sinon.spy(); @@ -8,7 +8,7 @@ describe('ckan.module.ConfirmDeleteModule()', function () { this.el = document.createElement('button'); this.sandbox = ckan.sandbox(); this.sandbox.body = this.fixture; - this.module = new ConfirmDeleteModule(this.el, {}, this.sandbox); + this.module = new ConfirmActionModule(this.el, {}, this.sandbox); }); afterEach(function () { @@ -38,8 +38,8 @@ describe('ckan.module.ConfirmDeleteModule()', function () { }); }); - describe('.performDelete()', function () { - it('should submit the delete action'); + describe('.performAction()', function () { + it('should submit the action'); }); describe('.createModal()', function () { @@ -101,8 +101,8 @@ describe('ckan.module.ConfirmDeleteModule()', function () { }); describe('._onConfirmSuccess()', function () { - it('should perform the delete action', function () { - var target = sinon.stub(this.module, 'performDelete'); + it('should perform the action', function () { + var target = sinon.stub(this.module, 'performAction'); this.module._onConfirmSuccess(jQuery.Event('click')); assert.called(target); }); diff --git a/ckan/templates/group/snippets/group_form.html b/ckan/templates/group/snippets/group_form.html index 0421c87c9e8..328be6e3289 100644 --- a/ckan/templates/group/snippets/group_form.html +++ b/ckan/templates/group/snippets/group_form.html @@ -73,7 +73,7 @@ {% block delete_button %} {% if h.check_access('group_delete', {'id': data.id}) %} {% set locale = h.dump_json({'content': _('Are you sure you want to delete this Group?')}) %} - {% block delete_button_text %}{{ _('Delete') }}{% endblock %} + {% block delete_button_text %}{{ _('Delete') }}{% endblock %} {% endif %} {% endblock %} diff --git a/ckan/templates/package/snippets/package_form.html b/ckan/templates/package/snippets/package_form.html index 2d9aa3b6263..bfbe0138e5b 100644 --- a/ckan/templates/package/snippets/package_form.html +++ b/ckan/templates/package/snippets/package_form.html @@ -35,7 +35,7 @@ {% block delete_button %} {% if h.check_access('package_delete', {'id': data.id}) %} {% set locale = h.dump_json({'content': _('Are you sure you want to delete this dataset?')}) %} - {% block delete_button_text %}{{ _('Delete') }}{% endblock %} + {% block delete_button_text %}{{ _('Delete') }}{% endblock %} {% endif %} {% endblock %} {% block cancel_button %} diff --git a/ckan/templates/package/snippets/resource_form.html b/ckan/templates/package/snippets/resource_form.html index 6ebf7aae3a5..44656320136 100644 --- a/ckan/templates/package/snippets/resource_form.html +++ b/ckan/templates/package/snippets/resource_form.html @@ -68,7 +68,7 @@ {% if data.id %} {% if h.check_access('resource_delete', {'id': data.id}) %} {% set locale = h.dump_json({'content': _('Are you sure you want to delete this resource?')}) %} - {% block delete_button_text %}{{ _('Delete') }}{% endblock %} + {% block delete_button_text %}{{ _('Delete') }}{% endblock %} {% endif %} {% endif %} {% endblock %} diff --git a/ckan/templates/related/snippets/related_form.html b/ckan/templates/related/snippets/related_form.html index 14835f5c3f5..2b156b33343 100644 --- a/ckan/templates/related/snippets/related_form.html +++ b/ckan/templates/related/snippets/related_form.html @@ -26,7 +26,7 @@ {% block delete_button %} {% if h.check_access('related_delete', {'id': data.id}) %} {% set locale = h.dump_json({'content': _('Are you sure you want to delete this related item?')}) %} - {% block delete_button_text %}{{ _('Delete') }}{% endblock %} + {% block delete_button_text %}{{ _('Delete') }}{% endblock %} {% endif %} {% endblock %} {{ h.nav_link(_('Cancel'), controller='related', action='list', id=c.id, class_='btn') }} diff --git a/ckan/templates/snippets/scripts.html b/ckan/templates/snippets/scripts.html index 33af750f40a..5cdb4a10311 100644 --- a/ckan/templates/snippets/scripts.html +++ b/ckan/templates/snippets/scripts.html @@ -24,7 +24,7 @@ - +