]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 Apply some feedback
authorStas Vilchik <vilchiks@gmail.com>
Thu, 20 Mar 2014 11:29:22 +0000 (17:29 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 20 Mar 2014 11:29:22 +0000 (17:29 +0600)
13 files changed:
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_quality_profile_template.hbs.erb
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_template.hbs.erb
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_item_template.hbs.erb
sonar-server/src/main/webapp/javascripts/coding-rules/mockjax.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/mockjax.js
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profile-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profile-view.js
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-view.js
sonar-server/src/main/webapp/stylesheets/coding-rules.css
sonar-server/src/main/webapp/stylesheets/coding-rules.less
sonar-server/src/main/webapp/stylesheets/icons.css
sonar-server/src/main/webapp/stylesheets/icons.less

index b5d4295ccfad3d9c7bc5b1bdd2508f44f5bb8b7e..6a07f89c317ec185a3b01f47b1824ce314b970b1 100644 (file)
@@ -1,11 +1,12 @@
 <script id="coding-rules-detail-quality-profile-template" type="text/x-handlebars-template">
-  <div class="coding-rules-detail-quality-profile-name">{{name}}</div>
-
-  {{#if parent}}
-    <div class="coding-rules-detail-quality-profile-inheritance">
-      <i class="icon-inheritance"></i> {{t 'coding_rules.inherits'}} <strong>{{parent.name}}</strong>
-    </div>
-  {{/if}}
+  <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">
@@ -18,7 +19,9 @@
         </select>
         {{#if parent}}
           {{#notEq severity parent.severity}}
-            {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}}
+            <span class="coding-rules-detail-parameter-original">
+              {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}}
+            </span>
           {{/notEq}}
         {{/if}}
       </div>
@@ -30,7 +33,9 @@
           <input type="text" value="{{value}}">
           {{#if ../parent}}
             {{#notEq value original}}
-              {{t 'coding_rules.original'}} {{original}}
+              <span class="coding-rules-detail-parameter-original">
+                {{t 'coding_rules.original'}} {{original}}
+              </span>
             {{/notEq}}
           {{/if}}
         </div>
     {{/each}}
   </ul>
 
-  <div class="coding-rules-detail-quality-profile-note">
-    {{#if note}}
+  <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>
+
+  {{#if note}}
+    <div class="coding-rules-detail-quality-profile-note">
       <blockquote class="rule-desc">
         <cite>
           <b>{{note.username}}</b> ({{note.fCreationDate}}) &nbsp;|&nbsp;
         </cite>
         {{{note.html}}}
       </blockquote>
-    {{else}}
-      <a class="coding-rules-detail-quality-profile-note-add link-action">{{t 'coding_rules.add_note'}}</a>
-    {{/if}}
-  </div>
+    </div>
+  {{/if}}
 
   <div class="coding-rules-detail-quality-profile-note-form admin">
     <table class="width100 table">
       </tbody>
     </table>
   </div>
-
-  <div class="button-group coding-rules-detail-quality-profile-actions">
-    <button>{{t 'update'}}</button>
-    {{#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>
 </script>
index 09447f2c00e10b6d66b540df1c0729f5ec429040..733e567f5a41529a73afca90c14de92fc935b870 100644 (file)
@@ -3,13 +3,9 @@
 
   <ul class="coding-rules-detail-properties">
     <li class="coding-rules-detail-property">{{severityIcon severity}} {{t "severity" severity}}</li>
-    <li class="coding-rules-detail-property">
-      <span class="coding-rules-detail-status">{{language}}</span>
-    </li>
+    <li class="coding-rules-detail-property">{{language}}</li>
     {{#notEq status 'READY'}}
-      <li class="coding-rules-detail-property">
-        <span class="coding-rules-detail-status">{{status}}</span>
-      </li>
+      <li class="coding-rules-detail-property">{{status}}</li>
     {{/notEq}}
     <li class="coding-rules-detail-property coding-rules-detail-tag-list">
       <i class="icon-tags"></i>
index 22f6ce7a0190784bb5bf11b7beaac46705359449..754888a0d1d5fb615d88c762861dc0db5cdc316d 100644 (file)
@@ -4,7 +4,7 @@
       <i class="icon-quality-profile"></i>&nbsp;{{qualityProfileName}}&nbsp;
       {{severityIcon severity}}{{t "severity" severity}}&nbsp;
     {{/if}}
-    <span class="coding-rules-detail-status">{{language}}</span>
+    {{language}}
 
     <div class="line-right">{{#notEq status 'READY'}}{{status}}{{/notEq}}</div>
   </div>
index d052e6dd8294dffad8ecab769b51afc142a03fe6..27b45a97ecc77fe543455b01953f50e26251f8d7 100644 (file)
@@ -71,7 +71,7 @@ define ['jquery.mockjax'], ->
         'coding_rules.extend_description': 'Extend Description'
         'coding_rules.deactivate_quality_profile': 'Deactivate'
         'coding_rules.found': 'Found'
-        'coding_rules.inherits': 'Inherits'
+        'coding_rules._inherits': 'inherits'
         'coding_rules.key': 'Key:'
         'coding_rules.new_search': 'New Search'
         'coding_rules.no_results': 'No Coding Rules'
index 6d86976882b252000e19f5a7d01e0e645683e7d8..b1bbc0be9ad5a545cdf9bd235ab67add0dcbccd1 100644 (file)
@@ -85,7 +85,7 @@
           'coding_rules.extend_description': 'Extend Description',
           'coding_rules.deactivate_quality_profile': 'Deactivate',
           'coding_rules.found': 'Found',
-          'coding_rules.inherits': 'Inherits',
+          'coding_rules._inherits': 'inherits',
           'coding_rules.key': 'Key:',
           'coding_rules.new_search': 'New Search',
           'coding_rules.no_results': 'No Coding Rules',
index 289c209d2c0a45bd19c600779f96675187c210b4..15fc149d888eea0553e506d743658fa2ff8456a5 100644 (file)
@@ -11,6 +11,7 @@ define [
 
 
     ui:
+      update: '.coding-rules-detail-quality-profile-update'
       severitySelect: '.coding-rules-detail-quality-profile-severity'
 
       note: '.coding-rules-detail-quality-profile-note'
@@ -30,6 +31,9 @@ define [
       'click @ui.noteCancel': 'cancelNote'
       'click @ui.noteSubmit': 'submitNote'
 
+      'change .coding-rules-detail-parameters select': 'enableUpdate'
+      'keyup .coding-rules-detail-parameters input': 'enableUpdate'
+
 
     editNote: ->
       @ui.note.hide()
@@ -62,6 +66,10 @@ define [
         @render()
 
 
+    enableUpdate: ->
+      @ui.update.prop 'disabled', false
+
+
     onRender: ->
       @ui.noteForm.hide()
 
index 4cb28435c398afbb5ac26c0e7f7f1fb81bb9cf14..7ba3234d5028d70bdd8405609b5d6d28fa68c8ce 100644 (file)
@@ -18,6 +18,7 @@
       CodingRulesDetailQualityProfilesView.prototype.template = getTemplate('#coding-rules-detail-quality-profile-template');
 
       CodingRulesDetailQualityProfilesView.prototype.ui = {
+        update: '.coding-rules-detail-quality-profile-update',
         severitySelect: '.coding-rules-detail-quality-profile-severity',
         note: '.coding-rules-detail-quality-profile-note',
         noteForm: '.coding-rules-detail-quality-profile-note-form',
@@ -34,7 +35,9 @@
         'click @ui.noteEdit': 'editNote',
         'click @ui.noteDelete': 'deleteNote',
         'click @ui.noteCancel': 'cancelNote',
-        'click @ui.noteSubmit': 'submitNote'
+        'click @ui.noteSubmit': 'submitNote',
+        'change .coding-rules-detail-parameters select': 'enableUpdate',
+        'keyup .coding-rules-detail-parameters input': 'enableUpdate'
       };
 
       CodingRulesDetailQualityProfilesView.prototype.editNote = function() {
         });
       };
 
+      CodingRulesDetailQualityProfilesView.prototype.enableUpdate = function() {
+        return this.ui.update.prop('disabled', false);
+      };
+
       CodingRulesDetailQualityProfilesView.prototype.onRender = function() {
         var format;
         this.ui.noteForm.hide();
index 01e4cca5d403efae580e709eedc81e90e2412705..3f91063ef4ac463e5d2655057570efab4a654416 100644 (file)
@@ -56,7 +56,7 @@ define [
 
       @ui.tagInput.select2
         tags: _.difference @options.app.tags, @model.get 'tags'
-        width: '500px'
+        width: '300px'
       @ui.tagsEdit.hide()
 
       @ui.extendDescriptionForm.hide()
index 5649c0b1dfac0adfc7f421edca6365785db6df40..b4afc08950e0e24264c8c353abbffe6ecb6464d9 100644 (file)
@@ -55,7 +55,7 @@
         this.qualityProfilesRegion.show(this.qualityProfilesView);
         this.ui.tagInput.select2({
           tags: _.difference(this.options.app.tags, this.model.get('tags')),
-          width: '500px'
+          width: '300px'
         });
         this.ui.tagsEdit.hide();
         this.ui.extendDescriptionForm.hide();
index 7e2e846532d3794977b9729f4069679cfd9dae69..5c178362ab51abf6bff3d68fff16bdf2ac67f6e3 100644 (file)
   line-height: 1.5;
   font-weight: bold;
 }
+.coding-rules-detail-header {
+  font-size: 18px;
+}
 .coding-rules-detail-title {
   display: inline-block;
+  margin-top: 30px;
   text-transform: uppercase;
 }
-.coding-rules-detail-status {
-  padding: 3px 4px;
-  background-color: #efefef;
-  color: #777;
-  font-size: 11px;
-}
 .coding-rules-detail-properties {
   margin: 10px 0;
   font-size: 0;
 }
 .coding-rules-detail-parameter-name {
   display: inline-block;
-  visibility: top;
+  vertical-align: top;
   width: 150px;
   font-size: 13px;
-  font-weight: bold;
+  font-weight: normal;
   text-align: right;
 }
 .coding-rules-detail-parameter-description {
   margin-left: 20px;
   font-size: 13px;
 }
+.coding-rules-detail-parameter-original {
+  margin-left: 10px;
+  font-size: 11px;
+}
 .coding-rules-detail-quality-profiles-header {
   margin-top: 30px;
 }
   font-size: 0;
 }
 .coding-rules-detail-quality-profile {
-  border: 1px solid transparent;
-}
-.coding-rules-detail-quality-profile.active {
-  border-color: #4b9fd5;
+  margin-left: 20px;
 }
 .coding-rules-detail-quality-profile.active .coding-rules-detail-quality-profile-name {
   background-color: #4b9fd5;
 }
 .coding-rules-detail-quality-profile + .coding-rules-detail-quality-profile {
   margin-top: 20px;
+  padding-top: 20px;
+  border-top: 1px solid #e1e1e1;
 }
 .coding-rules-detail-quality-profile-name {
-  padding: 5px;
-  background-color: #efefef;
-  line-height: 1;
   font-weight: bold;
 }
 .coding-rules-detail-quality-profile-actions {
   width: 200px;
 }
 .coding-rules-detail-quality-profile-inheritance {
-  margin: 10px 0;
-  padding: 0 5px;
+  vertical-align: middle;
+  margin-left: 10px;
+  font-size: 11px;
+  font-weight: normal;
+}
+.coding-rules-detail-quality-profile-inheritance i {
+  position: relative;
+  top: -1px;
+  font-size: 14px;
 }
 .coding-rules-detail-quality-profile-inheritance strong {
   font-weight: bold;
 }
 .coding-rules-detail-quality-profile-note {
-  margin: 10px 0;
+  margin: 20px 0;
   padding: 0 5px;
 }
 .coding-rules-detail-quality-profiles-activation {
index 6a3358b90aab233e68b787b7d58b05aea8593d6e..9669c34aceb11221ad7571c47454b65ac3aea648 100644 (file)
   font-weight: bold;
 }
 
+.coding-rules-detail-header {
+  font-size: 18px;
+}
+
 .coding-rules-detail-title {
   display: inline-block;
+  margin-top: 3 * @navigatorPadding;
   text-transform: uppercase;
 }
 
-.coding-rules-detail-status {
-  padding: 3px 4px;
-  background-color: @navigatorBarBackground;
-  color: #777;
-  font-size: @smallFontSize;
-}
-
-.coding-rules-detail-key {
-
-}
-
 .coding-rules-detail-properties {
   margin: @navigatorPadding 0;
   font-size: 0;
 
 .coding-rules-detail-parameter-name {
   display: inline-block;
-  visibility: top;
+  vertical-align: top;
   width: 150px;
   font-size: @baseFontSize;
-  font-weight: bold;
+  font-weight: normal;
   text-align: right;
 }
 
   font-size: @baseFontSize;
 }
 
+.coding-rules-detail-parameter-original {
+  margin-left: @navigatorPadding;
+  font-size: @smallFontSize;
+}
+
 
 // Quality Profiles
 .coding-rules-detail-quality-profiles-header {
 }
 
 .coding-rules-detail-quality-profile {
-  border: 1px solid transparent;
+  margin-left: 2 * @navigatorPadding;
 
   &.active {
-    border-color: @highlighted;
 
     .coding-rules-detail-quality-profile-name {
       background-color: @highlighted;
 
 .coding-rules-detail-quality-profile + .coding-rules-detail-quality-profile {
   margin-top: 2 * @navigatorPadding;
+  padding-top: 2 * @navigatorPadding;
+  border-top: 1px solid @navigatorBorderLightColor;
 }
 
 .coding-rules-detail-quality-profile-name {
-  padding: @navigatorPadding / 2;
-  background-color: @navigatorBarBackground;
-  line-height: 1;
   font-weight: bold;
 }
 
 }
 
 .coding-rules-detail-quality-profile-inheritance {
-  margin: @navigatorPadding 0;
-  padding: 0 @navigatorPadding / 2;
+  vertical-align: middle;
+  margin-left: @navigatorPadding;
+  font-size: @smallFontSize;
+  font-weight: normal;
 
+  i {
+    position: relative;
+    top: -1px;
+    font-size: @iconSmallFontSize;
+  }
   strong { font-weight: bold; }
 }
 
 .coding-rules-detail-quality-profile-note {
-  margin: @navigatorPadding 0;
+  margin: @navigatorPadding * 2 0;
   padding: 0 @navigatorPadding / 2;
 }
 
index cbeeb7190ca12ac05cc9f7989533e2a53b3b6bd8..aa150eafb4d7e272b7c6254f63416fd3920c1817 100644 (file)
@@ -264,7 +264,6 @@ a[class*=" icon-"] {
 }
 .icon-inheritance:before {
   content: "\f126";
-  font-size: 16px;
 }
 .icon-plus:before {
   content: "\f067";
index aca5c15c06d135d4b57d68b701709e1002ec6b91..5c8bc983bd16471feb1bba769b035239c72cbe4e 100644 (file)
@@ -273,7 +273,6 @@ a[class^="icon-"], a[class*=" icon-"] {
 }
 .icon-inheritance:before {
   content: "\f126";
-  font-size: @iconFontSize;
 }
 .icon-plus:before {
   content: "\f067";