]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 Feedback applied
authorStas Vilchik <vilchiks@gmail.com>
Mon, 24 Mar 2014 10:51:41 +0000 (16:51 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 24 Mar 2014 10:51:52 +0000 (16:51 +0600)
16 files changed:
sonar-server/src/main/webapp/coffee/coding-rules/app.coffee
sonar-server/src/main/webapp/coffee/coding-rules/mockjax.coffee
sonar-server/src/main/webapp/coffee/coding-rules/router.coffee
sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-bulk-change-dropdown-view.coffee
sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee
sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-quality-profile-view.coffee
sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-view.coffee
sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-item-view.coffee
sonar-server/src/main/webapp/coffee/coding-rules/views/filters/activation-filter-view.coffee [new file with mode: 0644]
sonar-server/src/main/webapp/coffee/coding-rules/views/filters/inheritance-filter-view.coffee
sonar-server/src/main/webapp/less/coding-rules.less
sonar-server/src/main/webapp/templates/coding-rules/coding-rules-bulk-change-dropdown.hbs
sonar-server/src/main/webapp/templates/coding-rules/coding-rules-bulk-change.hbs
sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail-quality-profile.hbs
sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail.hbs
sonar-server/src/main/webapp/templates/coding-rules/coding-rules-list-item.hbs

index cf6400cfdfd83a9cdeb045b4a7ce6e1d9521668a..4a05d84b73538409d52b21196ea4fb0c9758343d 100644 (file)
@@ -39,6 +39,7 @@ requirejs [
   'navigator/filters/date-filter-view',
   'coding-rules/views/filters/quality-profile-filter-view',
   'coding-rules/views/filters/inheritance-filter-view',
+  'coding-rules/views/filters/activation-filter-view',
   'coding-rules/views/filters/characteristic-filter-view',
 
   'coding-rules/mockjax',
@@ -65,6 +66,7 @@ requirejs [
   DateFilterView,
   QualityProfileFilterView,
   InheritanceFilterView
+  ActivationFilterView
   CharacteristicFilterView
 ) ->
 
@@ -147,13 +149,8 @@ requirejs [
       App.fetchList false
 
 
-  App.getActiveQualityProfile = ->
-    value = @activeInFilter.get('value')
-    if value? && value.length == 1 then value[0] else null
-
-
-  App.getInactiveQualityProfile = ->
-    value = @inactiveInFilter.get('value')
+  App.getQualityProfile = ->
+    value = @qualityProfileFilter.get('value')
     if value? && value.length == 1 then value[0] else null
 
 
@@ -239,17 +236,30 @@ requirejs [
       choices: @characteristics
       multiple: false
 
-    @activeInFilter = new BaseFilters.Filter
-      name: t 'coding_rules.filters.in_quality_profile'
-      property: 'in_quality_profile'
+    @qualityProfileFilter = new BaseFilters.Filter
+      name: t 'coding_rules.filters.quality_profile'
+      property: 'quality_profile'
       type: QualityProfileFilterView
       multiple: false
-    @filters.add @activeInFilter
+    @filters.add @qualityProfileFilter
+
 
     @filters.add new BaseFilters.Filter
-      name: t 'coding_rules.filters.key'
-      property: 'key'
-      type: StringFilterView
+      name: t 'coding_rules.filters.activation'
+      property: 'activation'
+      type: ActivationFilterView
+      enabled: false
+      optional: true
+      multiple: false
+      qualityProfileFilter: @qualityProfileFilter
+      choices:
+        'active': t 'coding_rules.filters.activation.active'
+        'inactive': t 'coding_rules.filters.activation.inactive'
+
+    @filters.add new BaseFilters.Filter
+      name: t 'coding_rules.filters.availableSince'
+      property: 'availableSince'
+      type: DateFilterView
       enabled: false
       optional: true
 
@@ -260,6 +270,26 @@ requirejs [
       enabled: false
       optional: true
 
+    @filters.add new BaseFilters.Filter
+      name: t 'coding_rules.filters.inheritance'
+      property: 'inheritance'
+      type: InheritanceFilterView
+      enabled: false
+      optional: true
+      multiple: false
+      qualityProfileFilter: @qualityProfileFilter
+      choices:
+        'not_inhertited': t 'coding_rules.filters.inheritance.not_inherited'
+        'inhertited': t 'coding_rules.filters.inheritance.inherited'
+        'overriden': t 'coding_rules.filters.inheritance.overriden'
+
+    @filters.add new BaseFilters.Filter
+      name: t 'coding_rules.filters.key'
+      property: 'key'
+      type: StringFilterView
+      enabled: false
+      optional: true
+
     @filters.add new BaseFilters.Filter
       name: t 'coding_rules.filters.repository'
       property: 'repositories'
@@ -276,35 +306,6 @@ requirejs [
       optional: true
       choices: @statuses
 
-    @filters.add new BaseFilters.Filter
-      name: t 'coding_rules.filters.availableSince'
-      property: 'availableSince'
-      type: DateFilterView
-      enabled: false
-      optional: true
-
-    @inactiveInFilter = new BaseFilters.Filter
-      name: t 'coding_rules.filters.out_of_quality_profile'
-      property: 'out_of_quality_profile'
-      type: QualityProfileFilterView
-      multiple: false
-      enabled: false
-      optional: true
-    @filters.add @inactiveInFilter
-
-    @filters.add new BaseFilters.Filter
-      name: t 'coding_rules.filters.inheritance'
-      property: 'inheritance'
-      type: InheritanceFilterView
-      enabled: false
-      optional: true
-      multiple: false
-      qualityProfileFilter: @activeInFilter
-      choices:
-        'any': t 'coding_rules.filters.inheritance.any'
-        'not_inhertited': t 'coding_rules.filters.inheritance.not_inherited'
-        'inhertited': t 'coding_rules.filters.inheritance.inherited'
-        'overriden': t 'coding_rules.filters.inheritance.overriden'
 
     @filterBarView = new CodingRulesFilterBarView
       app: @
index a668b743579f8642879d24b5b41ec665ce9398f7..acefc6dd9f108fc7b68b4bd6c992f5256ac31f76 100644 (file)
@@ -117,7 +117,7 @@ define ['jquery.mockjax'], ->
         'coding_rules.change_severity_in': 'Change Severity In'
         'coding_rules.extend_description': 'Extend Description'
         'coding_rules.deactivate_in': 'Deactivate In'
-        'coding_rules.deactivate_quality_profile': 'Deactivate'
+        'coding_rules.deactivate': 'Deactivate'
         'coding_rules.deactivate_in_quality_profile': 'Deactivate In Quality Profile'
         'coding_rules.found': 'Found'
         'coding_rules._inherits': 'inherits'
@@ -137,20 +137,22 @@ define ['jquery.mockjax'], ->
         'coding_rules._rules': 'rules'
         'coding_rules.select_tag': 'Select Tag'
 
+        'coding_rules.filters.activation': 'Activation'
+        'coding_rules.filters.activation.active': 'Active'
+        'coding_rules.filters.activation.inactive': 'Inactive'
+        'coding_rules.filters.activation.help': 'Activation criterion is available when a quality profile is selected'
         'coding_rules.filters.availableSince': 'Available Since'
         'coding_rules.filters.characteristic': 'Characteristic'
         'coding_rules.filters.description': 'Description'
-        'coding_rules.filters.in_quality_profile': 'In Quality Profile'
+        'coding_rules.filters.quality_profile': 'Quality Profile'
         'coding_rules.filters.inheritance': 'Inheritance'
-        'coding_rules.filters.inheritance.inactive': 'Inheritance criteria is available when an inherited quality profile is selected'
-        'coding_rules.filters.inheritance.any': 'Any'
+        'coding_rules.filters.inheritance.inactive': 'Inheritance criterion is available when an inherited quality profile is selected'
         'coding_rules.filters.inheritance.not_inherited': 'Not Inherited'
         'coding_rules.filters.inheritance.inherited': 'Inherited'
         'coding_rules.filters.inheritance.overriden': 'Overriden'
         'coding_rules.filters.key': 'Key'
         'coding_rules.filters.language': 'Language'
         'coding_rules.filters.name': 'Name'
-        'coding_rules.filters.out_of_quality_profile': 'Out of Quality Profile'
         'coding_rules.filters.repository': 'Repository'
         'coding_rules.filters.severity': 'Severity'
         'coding_rules.filters.status': 'Status'
@@ -213,7 +215,8 @@ define ['jquery.mockjax'], ->
         creationDate: '2013-10-15'
         fCreationDate: 'Oct 15, 2013'
         status: 'DEPRECATED'
-        repository: 'squid'
+        repositoryName: 'SonarQube'
+        repositoryKey: 'squid'
         characteristic: 'Reliability'
         subcharacteristic: 'Data related reliability'
         key: 'S1190'
@@ -242,7 +245,7 @@ define ['jquery.mockjax'], ->
 
             public int[][] getMatrix() { /* ... */ }  // Compliant
             </pre>'''
-        extra: '''<p>This note is here <b>only for test purposes</b>.</p>'''
+        extra: '''This note is here <b>only for test purposes</b>.'''
         extraRaw: '''This note is here *only for test purposes*.'''
 
         qualityProfiles: [
@@ -250,27 +253,23 @@ define ['jquery.mockjax'], ->
             name: 'SonarWay'
             key: 'sonarway'
             severity: 'MINOR'
-            canDeactivate: true
-            canUpdate: true
             parameters: [
               { key: 'someParameter', value: 8 }
             ]
+            note:
+              username: 'Admin Admin'
+              html: '''<p>This note is here <b>only for test purposes</b>.</p>'''
+              raw: '''This note is here *only for test purposes*.'''
+              fCreationDate: 'less than a minute'
           },
           {
             name: 'Quality Profile 1'
             key: 'qualityprofile1'
             severity: 'MAJOR'
-            canDeactivate: false
-            canUpdate: false
             parameters: [
               { key: 'someParameter', value: 6 }
             ]
             inherits: 'sonarway'
-            note:
-              username: 'Admin Admin'
-              html: '''<p>This note is here <b>only for test purposes</b>.</p>'''
-              raw: '''This note is here *only for test purposes*.'''
-              fCreationDate: 'less than a minute'
           }
         ]
 
@@ -280,7 +279,7 @@ define ['jquery.mockjax'], ->
   jQuery.mockjax
     url: "#{baseUrl}/api/codingrules/extend_description"
     responseText: JSON.stringify
-      extra: '''<p>This note is here <i>only for test purposes</i>.</p>'''
+      extra: '''This note is here <i>only for test purposes</i>.'''
       extraRaw: '''This note is here *only for test purposes*.'''
 
 
index 7d55132405aa474abbfb7edf59333bcd15757e44..1788ce1799eb7e05c63e240de8592efff23aeb09 100644 (file)
@@ -27,17 +27,7 @@ define [
 
     index: (query) ->
       params = this.parseQuery(query)
-      idObj = _.findWhere(params, { key: 'id' })
-      if (idObj)
-        f = this.app.favoriteFilter
-        @app.canSave = false
-        f.set('id', idObj.value)
-        f.fetch
-          success: =>
-            params = _.extend({}, @parseQuery(f.get('query')), params)
-            @loadResults(params)
-      else
-        @loadResults(params)
+      @loadResults(params)
 
 
     loadResults: (params) ->
index c359d2697c62ad9820d94ce1cc354e659c4ed4c5..3afb06156239b33d6e7f6162277f7dc7259dd068 100644 (file)
@@ -47,7 +47,5 @@ define [
 
 
     serializeData: ->
-      activeQualityProfile: @options.app.getActiveQualityProfile()
-      activeQualityProfileName: @options.app.activeInFilter.view.renderValue()
-      inactiveQualityProfile: @options.app.getInactiveQualityProfile()
-      inactiveQualityProfileName: @options.app.inactiveInFilter.view.renderValue()
\ No newline at end of file
+      qualityProfile: @options.app.getQualityProfile()
+      qualityProfileName: @options.app.qualityProfileFilter.view.renderValue()
\ No newline at end of file
index 2d1ed767a542066ec06bb3ed7e93003af4470bb5..dd341022c71b4c2c44e8ceaf453dc49caf70b2cc 100644 (file)
@@ -86,12 +86,10 @@ define [
       paging: @options.app.codingRules.paging
       qualityProfiles: @options.app.qualityProfiles
 
-      activeQualityProfile: @options.app.getActiveQualityProfile()
-      activeQualityProfileName: @options.app.activeInFilter.view.renderValue()
-      activateOnQualityProfiles: _.reject @options.app.qualityProfiles, (q) => q.key == @options.app.getInactiveQualityProfile()
+      qualityProfile: @options.app.getQualityProfile()
+      qualityProfileName: @options.app.qualityProfileFilter.view.renderValue()
 
-      inactiveQualityProfile: @options.app.getInactiveQualityProfile()
-      inactiveQualityProfileName: @options.app.inactiveInFilter.view.renderValue()
-      deactivateOnQualityProfiles: _.reject @options.app.qualityProfiles, (q) => q.key == @options.app.getActiveQualityProfile()
+      activateOnQualityProfiles: @options.app.qualityProfiles
+      deactivateOnQualityProfiles: _.reject @options.app.qualityProfiles, (q) => q.key == @options.app.getQualityProfile()
 
       severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO']
index 169984ba6b5134ae32fd78bd21abdef089b62398..53709d9de9552016523d738320a11bf1b73d29f6 100644 (file)
@@ -79,12 +79,12 @@ define [
         "<i class='icon-severity-#{state.id.toLowerCase()}'></i> #{state.text}"
 
       @ui.severitySelect.val @model.get 'severity'
-      @ui.severitySelect.select2
-        width: '200px'
-        minimumResultsForSearch: 999
-        formatResult: format
-        formatSelection: format
-        escapeMarkup: (m) -> m
+#      @ui.severitySelect.select2
+#        width: '200px'
+#        minimumResultsForSearch: 999
+#        formatResult: format
+#        formatSelection: format
+#        escapeMarkup: (m) -> m
 
 
     getParent: ->
index aa87be03ee1c59a8d5246e3696f3bcb1134340e3..641748825c9c4502967540013d5af14a898735ef 100644 (file)
@@ -63,9 +63,6 @@ define [
       @ui.extendDescriptionForm.hide()
       @ui.extendDescriptionSpinner.hide()
 
-      qp = @options.app.getActiveQualityProfile()
-      @$('.coding-rules-detail-quality-profile').first().addClass 'active' if qp?
-
 
     changeTags: ->
       @ui.tagsEdit.show()
@@ -109,4 +106,14 @@ define [
 
     activateQualityProfile: ->
       @options.app.codingRulesQualityProfileActivationView.model = @model
-      @options.app.codingRulesQualityProfileActivationView.show()
\ No newline at end of file
+      @options.app.codingRulesQualityProfileActivationView.show()
+
+
+    serializeData: ->
+      contextQualityProfile = @options.app.getQualityProfile()
+      qualityProfile = _.findWhere @model.get('qualityProfiles'), key: contextQualityProfile
+
+      _.extend super,
+        contextQualityProfile: contextQualityProfile
+        contextQualityProfileName: @options.app.qualityProfileFilter.view.renderValue()
+        qualityProfile: qualityProfile
\ No newline at end of file
index a468f9179c23b882e534d33517b0004ba3f4a979..5331efec1e7babbc2138ab6702c230521d78e603 100644 (file)
@@ -31,9 +31,3 @@ define [
           app: @options.app
           model: @model
         @options.app.layout.detailsRegion.show detailView
-
-
-    serializeData: ->
-      _.extend super,
-        qualityProfile: @options.app.getActiveQualityProfile()
-        qualityProfileName: @options.app.activeInFilter.view.renderValue()
diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/filters/activation-filter-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/filters/activation-filter-view.coffee
new file mode 100644 (file)
index 0000000..8a4a11d
--- /dev/null
@@ -0,0 +1,13 @@
+define [
+  'coding-rules/views/filters/inheritance-filter-view'
+], (
+  InheritanceFilterView
+) ->
+
+  class ActivationFilterView extends InheritanceFilterView
+    tooltip: 'coding_rules.filters.activation.help'
+
+
+    onChangeQualityProfile: ->
+      qualityProfile = @qualityProfileFilter.get 'value'
+      if _.isArray(qualityProfile) && qualityProfile.length == 1 then @makeActive() else @makeInactive()
\ No newline at end of file
index ef4bb6454d061d3390d1813266e0df8d02f695e0..8e575c20268f3a67622d45969e9322351b4c9ed8 100644 (file)
@@ -5,6 +5,8 @@ define [
 ) ->
 
   class InheritanceFilterView extends ChoiceFilters.ChoiceFilterView
+    tooltip: 'coding_rules.filters.inheritance.inactive'
+
 
     initialize: ->
       super
@@ -29,12 +31,12 @@ define [
 
 
     makeInactive: ->
-      @model.set inactive: true, title: t 'coding_rules.filters.inheritance.inactive'
+      @model.set inactive: true, title: t @tooltip
       @model.trigger 'change:enabled'
       @choices.each (model) -> model.set 'checked', false
       @detailsView.updateLists()
       @detailsView.updateValue()
-      @$el.addClass('navigator-filter-inactive').prop 'title', t 'coding_rules.filters.inheritance.inactive'
+      @$el.addClass('navigator-filter-inactive').prop 'title', t @tooltip
 
 
     showDetails: ->
@@ -45,6 +47,6 @@ define [
       value = value.split(',') if _.isString(value)
       if @choices && value.length > 0
         @model.set value: value, enabled: true
-        @onChangeQualityProfile
+        @onChangeQualityProfile()
       else
         @clear()
index 19f49511568c632e4b99a9ac6acd4eb428e19a2b..c5971b0e664f43abccc4d863e3b505717c71396e 100644 (file)
   text-transform: uppercase;
 }
 
+.coding-rules-detail-context-actions {
+  margin-bottom: @navigatorPadding;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.coding-rules-detail-context-actions-quality-profile {
+  vertical-align: middle;
+  margin-right: @navigatorPadding;
+  font-weight: bold;
+}
+
+.coding-rules-detail-context-actions-item {
+  display: inline-block;
+  vertical-align: middle;
+  margin-right: @navigatorPadding;
+
+  .limited {
+    max-width: 180px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+
+  .limited-big {
+    width: 480px;
+  }
+}
+
 .coding-rules-detail-properties {
   margin: @navigatorPadding 0;
   font-size: 0;
   margin-left: @navigatorPadding;
 }
 
+.coding-rules-detail-tags-change {
+  cursor: pointer;
+
+  &:hover {
+    span { text-decoration: underline; }
+  }
+}
+
+.coding-rules-detail-tag-edit {
+  line-height: 1;
+}
+
 .coding-rules-detail-description {
   margin: 2 * @navigatorPadding 0;
 }
 
 
 // Quality Profiles
+.coding-rules-detail-quality-profiles-section {
+
+}
+
 .coding-rules-detail-quality-profiles-header {
   margin-top: 3 * @navigatorPadding;
 }
 
 .coding-rules-detail-quality-profile {
   margin-left: 2 * @navigatorPadding;
-
-  &.active {
-
-    .coding-rules-detail-quality-profile-name {
-      background-color: @highlighted;
-      color: #fff;
-    }
-  }
 }
 
 .coding-rules-detail-quality-profile + .coding-rules-detail-quality-profile {
-  margin-top: 2 * @navigatorPadding;
-  padding-top: 2 * @navigatorPadding;
+  margin-top: @navigatorPadding;
+  padding-top: @navigatorPadding;
   border-top: 1px solid @navigatorBorderLightColor;
 }
 
 .coding-rules-detail-quality-profile-name {
+  width: 15%;
   font-weight: bold;
+  white-space: nowrap;
 }
 
-.coding-rules-detail-quality-profile-actions {
-  padding: @navigatorPadding / 2;
+.coding-rules-detail-quality-profile-severity {
+  width: 10%;
 }
 
 .coding-rules-detail-quality-profile-parameters {
-  padding: 0 @navigatorPadding / 2;
 
-  .coding-rules-detail-parameter-name,
-  .coding-rules-detail-parameter-description {
-    vertical-align: middle;
-  }
+}
 
-  .coding-rules-detail-parameter-description input {
-    width: 200px;
-  }
+.coding-rules-detail-quality-profile-actions {
+  width: 25%;
+  text-align: right;
+}
+
+.coding-rules-detail-quality-profile-note {
+  padding-top: 4px;
 }
 
 .coding-rules-detail-quality-profile-inheritance {
-  vertical-align: middle;
-  margin-left: @navigatorPadding;
+  margin-top: 4px;
   font-size: @smallFontSize;
   font-weight: normal;
 
     top: -1px;
     font-size: @iconSmallFontSize;
   }
-  strong { font-weight: bold; }
-}
-
-.coding-rules-detail-quality-profile-note {
-  margin: @navigatorPadding * 2 0;
-  padding: 0 @navigatorPadding / 2;
 }
 
 .coding-rules-detail-quality-profiles-activation {
index a6f543691f41bcb360b8fa310294f0ab7dc1f3d2..7a6c1c98050fbc1f714ab019fe0d3d0970340ce8 100644 (file)
@@ -1,17 +1,15 @@
-<a class="coding-rules-bulk-change-dropdown-link" data-action="activate"
-   {{#if inactiveQualityProfile}}data-param="{{inactiveQualityProfile}}"{{/if}}>
+<a class="coding-rules-bulk-change-dropdown-link" data-action="activate">
   {{t 'coding_rules.activate_in'}}
-  {{#if inactiveQualityProfile}}<strong>{{inactiveQualityProfileName}}</strong>{{/if}}
 </a>
 
 <a class="coding-rules-bulk-change-dropdown-link" data-action="deactivate"
-   {{#if activeQualityProfile}}data-param="{{activeQualityProfile}}"{{/if}}>
+   {{#if qualityProfile}}data-param="{{qualityProfile}}"{{/if}}>
   {{t 'coding_rules.deactivate_in'}}
-  {{#if activeQualityProfile}}<strong>{{activeQualityProfileName}}</strong>{{/if}}
+  {{#if qualityProfile}}<strong>{{qualityProfileName}}</strong>{{/if}}
 </a>
 
-{{#if activeQualityProfile}}
+{{#if qualityProfile}}
   <a class="coding-rules-bulk-change-dropdown-link" data-action="change-severity">
-    {{t 'coding_rules.change_severity_in'}} <strong>{{activeQualityProfileName}}</strong>
+    {{t 'coding_rules.change_severity_in'}} <strong>{{qualityProfileName}}</strong>
   </a>
 {{/if}}
\ No newline at end of file
index 7d7229132d55e18e84d9037d2cff71d6aab43ed3..ff7157676cf5a51b70661aadd396b6b5e9170094 100644 (file)
@@ -37,7 +37,7 @@
     {{/eq}}
 
     {{#eq action 'change-severity'}}
-      {{#if activeQualityProfile}}
+      {{#if qualityProfile}}
         <div class="modal-field">
           <label for="coding-rules-bulk-change-severity">{{t 'coding_rules.change_severity'}}</label>
           <select id="coding-rules-bulk-change-severity">
index 586c37610df65ac8e405ab42933a43300bb5f4d1..b3962380591d2fee9ae2a4319a2070225472134c 100644 (file)
@@ -1,90 +1,54 @@
-<div class="coding-rules-detail-quality-profile-name">
-  {{name}}
-  {{#if parent}}
-    <span class="coding-rules-detail-quality-profile-inheritance">
-        <i class="icon-inheritance"></i> {{parent.name}}
-      </span>
-  {{/if}}
-</div>
-
-<ul class="coding-rules-detail-parameters coding-rules-detail-quality-profile-parameters">
-  <li class="coding-rules-detail-parameter">
-    <h3 class="coding-rules-detail-parameter-name">{{t 'severity'}}</h3>
-    <div class="coding-rules-detail-parameter-description">
-      <select class="coding-rules-detail-quality-profile-severity">
-        {{#each severities}}
-          <option value="{{this}}">{{t 'severity' this}}</option>
-        {{/each}}
-      </select>
+<table class="width100">
+  <tbody>
+  <tr>
+    <td class="coding-rules-detail-quality-profile-name">
+      {{name}}
       {{#if parent}}
-        {{#notEq severity parent.severity}}
-          <span class="coding-rules-detail-parameter-original">
-              {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}}
-            </span>
-        {{/notEq}}
+        <div class="coding-rules-detail-quality-profile-inheritance">
+          <i class="icon-inheritance"></i> {{parent.name}}
+        </div>
       {{/if}}
-    </div>
-  </li>
-  {{#each parameters}}
-    <li class="coding-rules-detail-parameter">
-      <h3 class="coding-rules-detail-parameter-name">{{key}}</h3>
-      <div class="coding-rules-detail-parameter-description">
-        <input type="text" value="{{value}}">
-        {{#if ../parent}}
-          {{#notEq value original}}
-            <span class="coding-rules-detail-parameter-original">
-                {{t 'coding_rules.original'}} {{original}}
-              </span>
-          {{/notEq}}
-        {{/if}}
-      </div>
-    </li>
-  {{/each}}
-</ul>
+    </td>
 
-<div class="button-group coding-rules-detail-quality-profile-actions">
-  <button class="coding-rules-detail-quality-profile-update" disabled>{{t 'update'}}</button>
-  {{#unless note}}
-    <button class="coding-rules-detail-quality-profile-note-add">{{t 'coding_rules.add_note'}}</button>
-  {{/unless}}
-  {{#if parent}}
-    <button class="button-red">{{t 'coding_rules.revert_to_parent_definition'}}</button>
-  {{/if}}
-  <button class="button-red">{{t 'coding_rules.deactivate_quality_profile'}}</button>
-</div>
+    <td class="coding-rules-detail-quality-profile-severity">
+      {{severityIcon severity}} {{t "severity" severity}}
+      {{#if parent}}{{#notEq severity parent.severity}}
+        <div class="coding-rules-detail-quality-profile-inheritance">
+          {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}}
+        </div>
+      {{/notEq}}{{/if}}
+    </td>
 
-{{#if note}}
-  <div class="coding-rules-detail-quality-profile-note">
-    <blockquote class="rule-desc">
-      <cite>
-        <b>{{note.username}}</b> ({{note.fCreationDate}}) &nbsp;|&nbsp;
-        <a class="coding-rules-detail-quality-profile-note-edit link-action">{{t 'edit'}}</a>&nbsp;
-        <a class="coding-rules-detail-quality-profile-note-delete link-action">{{t 'delete'}}</a>
-      </cite>
-      {{{note.html}}}
-    </blockquote>
-  </div>
-{{/if}}
+    <td class="coding-rules-detail-quality-profile-parameters">
+      {{#each parameters}}
+        {{key}}: {{value}}
+        {{#if ../parent}}{{#notEq value original}}
+          <div class="coding-rules-detail-quality-profile-inheritance">
+            {{t 'coding_rules.original'}} {{original}}
+          </div>
+        {{/notEq}}{{/if}}
+      {{/each}}
+    </td>
 
-<div class="coding-rules-detail-quality-profile-note-form admin">
-  <table class="width100 table">
-    <tbody>
-    <tr>
-      <td class="width100" colspan="2">
-        <textarea class="coding-rules-detail-quality-profile-note-text" rows="4" style="width: 100%;">{{#if note}}{{note.raw}}{{/if}}</textarea>
-      </td>
-    </tr>
-    <tr>
-      <td>
-        <button class="coding-rules-detail-quality-profile-note-submit">
-          {{#if note}}{{t 'update'}}{{else}}{{t 'coding_rules.add_note'}}{{/if}}
+    <td class="coding-rules-detail-quality-profile-actions">
+      <div class="button-group">
+        <button class="coding-rules-detail-quality-profile-update">{{t 'change'}}</button>
+        {{#if parent}}
+          <button class="coding-rules-detail-quality-profile-revert button-red">
+            {{t 'coding_rules.revert_to_parent_definition'}}
+          </button>
+        {{/if}}
+        <button class="coding-rules-detail-quality-profile-deactivate button-red">
+          {{t 'coding_rules.deactivate'}}
         </button>
-        <a class="coding-rules-detail-quality-profile-note-cancel action">{{t 'cancel'}}</a>
-      </td>
-      <td class="right">
-        <%= render :partial => 'markdown/tips' -%>
-      </td>
+      </div>
+    </td>
+  </tr>
+
+  {{#if note}}
+    <tr>
+      <td colspan="4" class="coding-rules-detail-quality-profile-note">{{{note.html}}}</td>
     </tr>
-    </tbody>
-  </table>
-</div>
\ No newline at end of file
+  {{/if}}
+  </tbody>
+</table>
\ No newline at end of file
index 7234ab5a16cf4750e08c1e91c942a73a6092a344..05b9d52bcb6030e0bc746861eb3ee57d1484985f 100644 (file)
@@ -1,3 +1,54 @@
+{{#if contextQualityProfile}}
+  <div class="coding-rules-detail-context-actions admin">
+    <table class="width100">
+      <tbody>
+      <tr>
+        <td>
+          <span class="coding-rules-detail-context-actions-quality-profile">{{contextQualityProfileName}}</span>
+          {{#if qualityProfile}}
+            {{#with qualityProfile}}
+              <span class="coding-rules-detail-context-actions-item">
+                {{severityIcon severity}} {{t "severity" severity}}
+              </span>
+
+              {{#each parameters}}
+                <span class="coding-rules-detail-context-actions-item">
+                  <span class="limited">{{key}}</span><span class="limited">:</span>
+                  <span class="limited">{{value}}</span>
+                </span>
+              {{/each}}
+
+              {{#if note}}<span class="coding-rules-detail-context-actions-item">{{{note.html}}}</span>{{/if}}
+            {{/with}}
+          {{/if}}
+        </td>
+
+        <td class="coding-rules-detail-quality-profile-actions">
+          <div class="button-group">
+            {{#if qualityProfile}}
+              <button class="coding-rules-detail-quality-profile-update">{{t 'change'}}</button>
+              {{#if parent}}
+                <button class="coding-rules-detail-quality-profile-revert button-red">
+                  {{t 'coding_rules.revert_to_parent_definition'}}
+                </button>
+              {{/if}}
+              <button class="coding-rules-detail-quality-profile-deactivate button-red">
+                {{t 'coding_rules.deactivate'}}
+              </button>
+            {{else}}
+              <button class="coding-rules-detail-quality-profile-activate">
+                {{t 'coding_rules.activate'}}
+              </button>
+            {{/if}}
+          </div>
+        </td>
+
+      </tr>
+      </tbody>
+    </table>
+  </div>
+{{/if}}
+
 <h3 class="coding-rules-detail-header">{{name}}</h3>
 
 <ul class="coding-rules-detail-properties">
       <span class="coding-rules-detail-status">{{status}}</span>
     </li>
   {{/notEq}}
-  <li class="coding-rules-detail-property coding-rules-detail-tag-list">
+  <li class="coding-rules-detail-property coding-rules-detail-tag-list coding-rules-detail-tags-change">
     <i class="icon-tags"></i>
-    {{join tags ', '}}
-    <a class="link-action coding-rules-detail-tags-change">{{t 'change'}}</a>
+    <span>{{join tags ', '}}</span>
   </li>
   <li class="coding-rules-detail-property coding-rules-detail-tag-edit">
     <input class="coding-rules-detail-tag-input" type="text" value="{{join tags ','}}">
-    <a class="link-action coding-rules-detail-tag-edit-done">{{t 'done'}}</a>
+
+    <div class="button-group">
+      <button class="coding-rules-detail-tag-edit-done">{{t 'done'}}</button>
+    </div>
   </li>
   <li class="coding-rules-detail-property">{{characteristic}}&nbsp;>&nbsp;{{subcharacteristic}}</li>
   <li class="coding-rules-detail-property">{{t 'coding_rules.available_since'}} {{fCreationDate}}</li>
-  <li class="coding-rules-detail-property">{{t 'coding_rules.repository'}} {{repository}}</li>
+  <li class="coding-rules-detail-property">{{t 'coding_rules.repository'}} {{repositoryName}} ({{repositoryKey}})</li>
   <li class="coding-rules-detail-property">{{t 'coding_rules.key'}} {{key}}</li>
 </ul>
 
@@ -29,7 +82,8 @@
 
 <div class="coding-rules-detail-description coding-rules-detail-description-extra">
   <div id="coding-rules-detail-description-extra">
-    {{#if extra}}<div class="rule-desc marginbottom10">{{{extra}}}</div>{{/if}}
+    {{#if extra}}
+      <div class="rule-desc marginbottom10">{{{extra}}}</div>{{/if}}
     <div class="button-group">
       <button id="coding-rules-detail-extend-description">{{t 'coding_rules.extend_description'}}</button>
     </div>
@@ -40,7 +94,8 @@
       <tbody>
       <tr>
         <td class="width100" colspan="2">
-          <textarea id="coding-rules-detail-extend-description-text" rows="4" style="width: 100%;">{{extraRaw}}</textarea>
+          <textarea id="coding-rules-detail-extend-description-text" rows="4"
+                    style="width: 100%;">{{extraRaw}}</textarea>
         </td>
       </tr>
       <tr>
     {{#each parameters}}
       <li class="coding-rules-detail-parameter">
         <h3 class="coding-rules-detail-parameter-name">{{key}}</h3>
+
         <div class="coding-rules-detail-parameter-description">
           {{description}}
 
 {{/if}}
 
 
-<h3 class="coding-rules-detail-title">{{t 'coding_rules.quality_profiles'}}</h3>
-<div class="button-group coding-rules-detail-quality-profiles-activation">
-  <button id="coding-rules-quality-profile-activate">{{t 'coding_rules.activate_in_quality_profile'}}</button>
-</div>
-<div id="coding-rules-detail-quality-profiles"></div>
\ No newline at end of file
+<div class="coding-rules-detail-quality-profiles-section">
+  <h3 class="coding-rules-detail-title">{{t 'coding_rules.quality_profiles'}}</h3>
+
+  <div class="button-group coding-rules-detail-quality-profiles-activation">
+    <button id="coding-rules-quality-profile-activate">{{t 'coding_rules.activate_in_quality_profile'}}</button>
+  </div>
+  <div id="coding-rules-detail-quality-profiles"></div>
+</div>
\ No newline at end of file
index 8dd7be70fca0af2884247435e18b0ed46c15858c..d44d28895da6d48c49539c33a03f6ce141c3f258 100644 (file)
@@ -1,10 +1,5 @@
 <div class="line line-small">
-  {{#if qualityProfile}}
-    <i class="icon-quality-profile"></i>&nbsp;{{qualityProfileName}}&nbsp;
-    {{severityIcon severity}}{{t "severity" severity}}&nbsp;
-  {{/if}}
   <span class="coding-rules-detail-status">{{language}}</span>
-
   <div class="line-right">{{#notEq status 'READY'}}{{status}}{{/notEq}}</div>
 </div>
 <div class="line line-nowrap" title="{{name}}">{{name}}</div>
\ No newline at end of file