diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-06-18 15:11:05 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-06-18 15:11:05 +0200 |
commit | 65a4b8481506108c4b81eef3a167f2e437fcabe8 (patch) | |
tree | 91d3ae1b574f497ca13c230cbbd560fa616dd274 | |
parent | c4d331fd3fe87093b05a104d0cc93e22c8f61697 (diff) | |
download | sonarqube-65a4b8481506108c4b81eef3a167f2e437fcabe8.tar.gz sonarqube-65a4b8481506108c4b81eef3a167f2e437fcabe8.zip |
make the action buttons position more consistent
5 files changed, 26 insertions, 21 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js index 835119e9a66..4626acd9d02 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js @@ -18,11 +18,26 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ define([ + './rule/manual-rule-creation-view', './templates' -], function () { +], function (ManualRuleCreationView) { return Marionette.ItemView.extend({ - template: Templates['coding-rules-filters'] + template: Templates['coding-rules-filters'], + + events: { + 'click .js-create-manual-rule': 'createManualRule' + }, + + createManualRule: function () { + new ManualRuleCreationView({ + app: this.options.app + }).render(); + }, + + serializeData: function () { + return _.extend(this._super(), { canWrite: this.options.app.canWrite }); + } }); }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-filters.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-filters.hbs index e307b61b100..fb62c872c25 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-filters.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-filters.hbs @@ -1,3 +1,9 @@ <h1 class="page-title"> {{t 'coding_rules.page'}} </h1> + +{{#if canWrite}} + <div class="pull-right button-group"> + <button class="js-create-manual-rule">{{t 'coding_rules.create_manual_rule'}}</button> + </div> +{{/if}} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs index 7e39482dbbc..6419abd452f 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs @@ -29,10 +29,4 @@ <button class="js-bulk-change">{{t 'bulk_change'}}</button> {{/if}} </div> - - {{#if canWrite}} - <div class="search-navigator-header-buttons button-group"> - <button class="js-create-manual-rule">{{t 'coding_rules.create_manual_rule'}}</button> - </div> - {{/if}} </div> diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js index b194b54fc90..c2be9a4ac42 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js @@ -20,9 +20,8 @@ define([ 'components/navigator/workspace-header-view', './bulk-change-popup-view', - './rule/manual-rule-creation-view', './templates' -], function (WorkspaceHeaderView, BulkChangePopup, ManualRuleCreationView) { +], function (WorkspaceHeaderView, BulkChangePopup) { var $ = jQuery; @@ -33,7 +32,6 @@ define([ return _.extend(WorkspaceHeaderView.prototype.events.apply(this, arguments), { 'click .js-back': 'onBackClick', 'click .js-bulk-change': 'onBulkChangeClick', - 'click .js-create-manual-rule': 'createManualRule', 'click .js-reload': 'reload', 'click .js-new-search': 'newSearch' }); @@ -53,12 +51,6 @@ define([ }).render(); }, - createManualRule: function() { - new ManualRuleCreationView({ - app: this.options.app - }).render(); - }, - reload: function () { this.options.app.controller.fetchList(true); }, diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-profile-details.hbs b/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-profile-details.hbs index 7f1d8c3c993..f1f4a65b5fe 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-profile-details.hbs +++ b/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-profile-details.hbs @@ -71,10 +71,8 @@ <header class="page-header"> <h3 class="page-title">{{t 'quality_profiles.profile_inheritance'}}</h3> {{#if canWrite}} - <div class="page-actions"> - <div class="button-group"> - <button id="quality-profile-change-parent">{{t 'quality_profiles.change_parent'}}</button> - </div> + <div class="button-group big-spacer-left"> + <button id="quality-profile-change-parent">{{t 'quality_profiles.change_parent'}}</button> </div> {{/if}} </header> |