-<h3 class="coding-rules-detail-header">
- {{name}}
- <a class="coding-rules-detail-permalink icon-link" target="_blank" href="{{permalink}}"
- data-toggle="tooltip" data-placement="left" title="Rule permalink"></a>
-</h3>
+<header class="page-header">
+ <h3 class="page-title coding-rules-detail-header">
+ <big>{{name}}</big>
+ </h3>
+ <div class="page-actions">
+ <a class="coding-rules-detail-permalink icon-link" target="_blank" href="{{permalink}}"
+ data-toggle="tooltip" data-placement="left" title="Rule permalink"></a>
-<span class="note">{{key}}</span>
+ <a class="js-rule-filter link-no-underline spacer-left" href="#">
+ <i class="icon-filter icon-half-transparent"></i> <i class="icon-dropdown"></i>
+ </a>
+ </div>
+</header>
+
+<p class="note">{{key}}</p>
<ul class="coding-rules-detail-properties">
{{#unless isManual}}
--- /dev/null
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+define([
+ 'coding-rules/rule-filter-view'
+], function (RuleFilterView) {
+
+ var $ = jQuery;
+
+ return {
+ onRuleFilterClick: function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ $('body').click();
+ var that = this,
+ popup = new RuleFilterView({
+ triggerEl: $(e.currentTarget),
+ bottomRight: true,
+ model: this.model
+ });
+ popup.on('select', function (property, value) {
+ var obj = {};
+ obj[property] = '' + value;
+ that.options.app.state.updateFilter(obj);
+ popup.close();
+ });
+ popup.render();
+ }
+ };
+
+});
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
define([
+ 'coding-rules/rule/rule-filter-mixin',
'templates/coding-rules'
-], function () {
+], function (RuleFilterMixin) {
- return Marionette.ItemView.extend({
+ return Marionette.ItemView.extend(RuleFilterMixin).extend({
template: Templates['coding-rules-rule-meta'],
modelEvents: {
events: {
'click @ui.tagsChange': 'changeTags',
'click @ui.tagsEditDone': 'editDone',
- 'click @ui.tagsEditCancel': 'cancelEdit'
+ 'click @ui.tagsEditCancel': 'cancelEdit',
+ 'click .js-rule-filter': 'onRuleFilterClick'
},
onRender: function () {
define([
'components/navigator/workspace-list-item-view',
'coding-rules/rule/profile-activation-view',
- 'coding-rules/rule-filter-view',
+ 'coding-rules/rule/rule-filter-mixin',
'templates/coding-rules'
-], function (WorkspaceListItemView, ProfileActivationView, RuleFilterView) {
+], function (WorkspaceListItemView, ProfileActivationView, RuleFilterMixin) {
var $ = jQuery;
- return WorkspaceListItemView.extend({
+ return WorkspaceListItemView.extend(RuleFilterMixin).extend({
className: 'coding-rule',
template: Templates['coding-rules-workspace-list-item'],
});
},
- onRuleFilterClick: function (e) {
- e.preventDefault();
- e.stopPropagation();
- $('body').click();
- var that = this,
- popup = new RuleFilterView({
- triggerEl: $(e.currentTarget),
- bottomRight: true,
- model: this.model
- });
- popup.on('select', function (property, value) {
- var obj = {};
- obj[property] = '' + value;
- that.options.app.state.updateFilter(obj);
- popup.close();
- });
- popup.render();
- },
-
serializeData: function () {
return _.extend(WorkspaceListItemView.prototype.serializeData.apply(this, arguments), {
tags: _.union(this.model.get('sysTags'), this.model.get('tags')),
* Detail
*/
-.coding-rules-detail-header,
.coding-rules-detail-title {
position: relative;
- line-height: 1.5;
font-size: @bigFontSize;
font-weight: 400;
}
-.coding-rules-detail-header,
.coding-rules-detail-title,
.coding-rules-detail-actions {
margin: 16px 0;
}
-.coding-rules-detail-header {
- margin: 0;
- padding-right: 100px;
- font-size: 18px;
-}
-
.coding-rules-detail-title {
display: inline-block;
}
margin-top: 6px;
}
-.coding-rules-detail-permalink {
- position: absolute;
- top: 0; right: 0;
- font-size: @baseFontSize;
- font-weight: normal;
- text-decoration: none;
- .trans;
-
- &:hover { color: @highlighted; }
-}
-
.coding-rules-detail-context {
margin-bottom: @navigatorPadding;
padding: @navigatorPadding / 2;