]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5134 Display the list of found rules on a left side bar
authorStas Vilchik <vilchiks@gmail.com>
Thu, 13 Mar 2014 06:51:44 +0000 (12:51 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 13 Mar 2014 06:51:44 +0000 (12:51 +0600)
22 files changed:
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_actions_template.hbs.erb
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_layout.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/fonts/sonar.eot
sonar-server/src/main/webapp/fonts/sonar.svg
sonar-server/src/main/webapp/fonts/sonar.ttf
sonar-server/src/main/webapp/fonts/sonar.woff
sonar-server/src/main/webapp/javascripts/coding-rules/app.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/app.js
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/actions-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/actions-view.js
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-item-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-item-view.js
sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/quality-profile-filter-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/quality-profile-filter-view.js
sonar-server/src/main/webapp/stylesheets/icons.css
sonar-server/src/main/webapp/stylesheets/icons.less
sonar-server/src/main/webapp/stylesheets/navigator.css
sonar-server/src/main/webapp/stylesheets/navigator/base.css
sonar-server/src/main/webapp/stylesheets/navigator/base.less

index 3cea3eb051cfbef88809eb63d0719a93973a3b90..ff660ae4a244d7f40ede40f3554ea7a46a14bd1f 100644 (file)
@@ -1,4 +1,17 @@
 <script id="coding-rules-status-template" type="text/x-handlebars-template">
+  <div class="navigator-actions-order">
+    {{#if sorting}}
+      {{t 'coding_rules.ordered_by'}} <strong>{{sorting.sortText}}</strong> {{#if sorting.asc}}<i class="icon-arrow-up"></i>{{else}}<i class="icon-arrow-down"></i>{{/if}}
+    {{else}}
+      {{t 'coding_rules.order'}}
+    {{/if}}
+  </div>
+  <ul class="navigator-actions-order-choices">
+    <li data-sort="CREATION_DATE" data-asc="true">{{t 'coding_rules.sort.creation_date'}} <i class="icon-arrow-up"></i></li>
+    <li data-sort="CREATION_DATE" data-asc="false">{{t 'coding_rules.sort.creation_date'}} <i class="icon-arrow-down"></i></li>
+    <li data-sort="NAME" data-asc="true">{{t 'coding_rules.sort.name'}} <i class="icon-arrow-up"></i></li>
+    <li data-sort="NAME" data-asc="false">{{t 'coding_rules.sort.name'}} <i class="icon-arrow-down"></i></li>
+  </ul>
   <div class="navigator-actions-total">
     {{t 'coding_rules.found'}}: <strong>{{paging.fTotal}}</strong>
     <a class="navigator-actions-bulk"
index debdccc91f1e31f74ce90dac04f3bf5ecff4b8bf..aa7e978699b9da4c3399b43d24dc87019b75581e 100644 (file)
@@ -1,7 +1,7 @@
 <script id="coding-rules-layout" type="text/x-handlebars-template">
   <div class="navigator-header"></div>
   <div class="navigator-filters"></div>
-  <div class="navigator-actions"></div>
   <div class="navigator-results"></div>
+  <div class="navigator-actions"></div>
   <div class="navigator-details"></div>
 </script>
index cdd992740beea3c4f02ee802b96581ac1cbedb52..df21c196d5f040b0be1c1073216d783c3b37b541 100644 (file)
@@ -1,7 +1,10 @@
 <script id="coding-rules-list-item-template" type="text/x-handlebars-template">
-  <div class="line line-nowrap" title="{{name}}">{{name}}</div>
   <div class="line line-small">
-    {{#if qualityProfile}}{{severityIcon severity}}{{t "severity" severity}} |{{/if}}
-    {{language}}
+    {{#if qualityProfile}}
+      <i class="icon-quality-profile"></i>&nbsp;{{qualityProfileName}}&nbsp;
+    {{/if}}
+    {{severityIcon severity}}{{t "severity" severity}}&nbsp;
+    <i class="icon-lang"></i>&nbsp;{{language}}
   </div>
+  <div class="line line-nowrap" title="{{name}}">{{name}}</div>
 </script>
index 38a3bbfe0727ac7ddb5799d5be519e1c19404903..2197934d123ab14443143a0bbcd3432ecc829a1d 100755 (executable)
Binary files a/sonar-server/src/main/webapp/fonts/sonar.eot and b/sonar-server/src/main/webapp/fonts/sonar.eot differ
index a686944a8fc327f35b69deb08264bb7260a5a680..942bb35ffacdf7630b47c1084771c35f6d845c7c 100755 (executable)
@@ -19,6 +19,8 @@
 <glyph unicode="&#xf013;" d="M733.714 519.238q0 16-10.286 26.286l-52 51.429q-10.857 10.857-25.714 10.857t-25.714-10.857l-233.143-232.571-129.143 129.143q-10.857 10.857-25.714 10.857t-25.714-10.857l-52-51.429q-10.286-10.286-10.286-26.286 0-15.429 10.286-25.714l206.857-206.857q10.857-10.857 25.714-10.857 15.429 0 26.286 10.857l310.286 310.286q10.286 10.286 10.286 25.714zM877.714 426.667q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
 <glyph unicode="&#xf014;" d="M877.714 426.667q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
 <glyph unicode="&#xf015;" d="M585.143 426.667q0 60.571-42.857 103.429t-103.429 42.857-103.429-42.857-42.857-103.429 42.857-103.429 103.429-42.857 103.429 42.857 42.857 103.429zM877.714 488.953v-126.857q0-6.857-4.571-13.143t-11.429-7.429l-105.714-16q-10.857-30.857-22.286-52 20-28.571 61.143-78.857 5.714-6.857 5.714-14.286t-5.143-13.143q-15.429-21.143-56.571-61.714t-53.714-40.571q-6.857 0-14.857 5.143l-78.857 61.714q-25.143-13.143-52-21.714-9.143-77.714-16.571-106.286-4-16-20.571-16h-126.857q-8 0-14 4.857t-6.571 12.286l-16 105.143q-28 9.143-51.429 21.143l-80.571-61.143q-5.714-5.143-14.286-5.143-8 0-14.286 6.286-72 65.143-94.286 96-4 5.714-4 13.143 0 6.857 4.571 13.143 8.571 12 29.143 38t30.857 40.286q-15.429 28.571-23.429 56.571l-104.571 15.429q-7.429 1.143-12 7.143t-4.571 13.429v126.857q0 6.857 4.571 13.143t10.857 7.429l106.286 16q8 26.286 22.286 52.571-22.857 32.571-61.143 78.857-5.714 6.857-5.714 13.714 0 5.714 5.143 13.143 14.857 20.571 56.286 61.429t54 40.857q7.429 0 14.857-5.714l78.857-61.143q25.143 13.143 52 21.714 9.143 77.714 16.571 106.286 4 16 20.571 16h126.857q8 0 14-4.857t6.571-12.286l16-105.143q28-9.143 51.429-21.143l81.143 61.143q5.143 5.143 13.714 5.143 7.429 0 14.286-5.714 73.714-68 94.286-97.143 4-4.571 4-12.571 0-6.857-4.571-13.143-8.571-12-29.143-38t-30.857-40.286q14.857-28.571 23.429-56l104.571-16q7.429-1.143 12-7.143t4.571-13.429z" />
+<glyph unicode="&#xf022;" d="M219.429 262.096v-36.571q0-7.429-5.429-12.857t-12.857-5.429h-36.571q-7.429 0-12.857 5.429t-5.429 12.857v36.571q0 7.429 5.429 12.857t12.857 5.429h36.571q7.429 0 12.857-5.429t5.429-12.857zM219.429 408.381v-36.571q0-7.429-5.429-12.857t-12.857-5.429h-36.571q-7.429 0-12.857 5.429t-5.429 12.857v36.571q0 7.429 5.429 12.857t12.857 5.429h36.571q7.429 0 12.857-5.429t5.429-12.857zM219.429 554.667v-36.571q0-7.429-5.429-12.857t-12.857-5.429h-36.571q-7.429 0-12.857 5.429t-5.429 12.857v36.571q0 7.429 5.429 12.857t12.857 5.429h36.571q7.429 0 12.857-5.429t5.429-12.857zM877.714 262.096v-36.571q0-7.429-5.429-12.857t-12.857-5.429h-548.571q-7.429 0-12.857 5.429t-5.429 12.857v36.571q0 7.429 5.429 12.857t12.857 5.429h548.571q7.429 0 12.857-5.429t5.429-12.857zM877.714 408.381v-36.571q0-7.429-5.429-12.857t-12.857-5.429h-548.571q-7.429 0-12.857 5.429t-5.429 12.857v36.571q0 7.429 5.429 12.857t12.857 5.429h548.571q7.429 0 12.857-5.429t5.429-12.857zM877.714 554.667v-36.571q0-7.429-5.429-12.857t-12.857-5.429h-548.571q-7.429 0-12.857 5.429t-5.429 12.857v36.571q0 7.429 5.429 12.857t12.857 5.429h548.571q7.429 0 12.857-5.429t5.429-12.857zM950.857 152.381v475.429q0 7.429-5.429 12.857t-12.857 5.429h-841.143q-7.429 0-12.857-5.429t-5.429-12.857v-475.429q0-7.429 5.429-12.857t12.857-5.429h841.143q7.429 0 12.857 5.429t5.429 12.857zM1024 774.096v-621.714q0-37.714-26.857-64.571t-64.571-26.857h-841.143q-37.714 0-64.571 26.857t-26.857 64.571v621.714q0 37.714 26.857 64.571t64.571 26.857h841.143q37.714 0 64.571-26.857t26.857-64.571z" />
+<glyph unicode="&#xf024;" d="M182.857 792.381q0-41.143-36.571-62.857v-723.429q0-7.429-5.429-12.857t-12.857-5.429h-36.571q-7.429 0-12.857 5.429t-5.429 12.857v723.429q-36.571 21.714-36.571 62.857 0 30.286 21.429 51.714t51.714 21.429 51.714-21.429 21.429-51.714zM1024 755.81v-436q0-14.286-7.143-22t-22.571-15.714q-122.857-66.286-210.857-66.286-34.857 0-70.571 12.571t-62 27.429-66 27.429-81.429 12.571q-109.714 0-265.143-83.429-9.714-5.143-18.857-5.143-14.857 0-25.714 10.857t-10.857 25.714v424q0 18.286 17.714 31.429 12 8 45.143 24.571 134.857 68.571 240.571 68.571 61.143 0 114.286-16.571t125.143-50.286q21.714-10.857 50.286-10.857 30.857 0 67.143 12t62.857 26.857 50.286 26.857 31.143 12q14.857 0 25.714-10.857t10.857-25.714z" />
 <glyph unicode="&#xf039;" d="M1024 170.667v-73.143q0-14.857-10.857-25.714t-25.714-10.857h-950.857q-14.857 0-25.714 10.857t-10.857 25.714v73.143q0 14.857 10.857 25.714t25.714 10.857h950.857q14.857 0 25.714-10.857t10.857-25.714zM1024 390.096v-73.143q0-14.857-10.857-25.714t-25.714-10.857h-950.857q-14.857 0-25.714 10.857t-10.857 25.714v73.143q0 14.857 10.857 25.714t25.714 10.857h950.857q14.857 0 25.714-10.857t10.857-25.714zM1024 609.524v-73.143q0-14.857-10.857-25.714t-25.714-10.857h-950.857q-14.857 0-25.714 10.857t-10.857 25.714v73.143q0 14.857 10.857 25.714t25.714 10.857h950.857q14.857 0 25.714-10.857t10.857-25.714zM1024 828.953v-73.143q0-14.857-10.857-25.714t-25.714-10.857h-950.857q-14.857 0-25.714 10.857t-10.857 25.714v73.143q0 14.857 10.857 25.714t25.714 10.857h950.857q14.857 0 25.714-10.857t10.857-25.714z" />
 <glyph unicode="&#xf03a;" d="M146.286 188.953v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-109.714q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h109.714q7.429 0 12.857-5.429t5.429-12.857zM146.286 408.381v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-109.714q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h109.714q7.429 0 12.857-5.429t5.429-12.857zM146.286 627.81v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-109.714q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h109.714q7.429 0 12.857-5.429t5.429-12.857zM1024 188.953v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-768q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h768q7.429 0 12.857-5.429t5.429-12.857zM146.286 847.238v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-109.714q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h109.714q7.429 0 12.857-5.429t5.429-12.857zM1024 408.381v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-768q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h768q7.429 0 12.857-5.429t5.429-12.857zM1024 627.81v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-768q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h768q7.429 0 12.857-5.429t5.429-12.857zM1024 847.238v-109.714q0-7.429-5.429-12.857t-12.857-5.429h-768q-7.429 0-12.857 5.429t-5.429 12.857v109.714q0 7.429 5.429 12.857t12.857 5.429h768q7.429 0 12.857-5.429t5.429-12.857z" />
 <glyph unicode="&#xf046;" d="M804.571 407.238v-181.714q0-68-48.286-116.286t-116.286-48.286h-475.429q-68 0-116.286 48.286t-48.286 116.286v475.429q0 68 48.286 116.286t116.286 48.286h475.429q36 0 66.857-14.286 8.571-4 10.286-13.143 1.714-9.714-5.143-16.571l-28-28q-5.714-5.714-13.143-5.714-1.714 0-5.143 1.143-13.143 3.429-25.714 3.429h-475.429q-37.714 0-64.571-26.857t-26.857-64.571v-475.429q0-37.714 26.857-64.571t64.571-26.857h475.429q37.714 0 64.571 26.857t26.857 64.571v145.143q0 7.429 5.143 12.571l36.571 36.571q5.714 5.714 13.143 5.714 3.429 0 6.857-1.714 11.429-4.571 11.429-16.571zM936.571 686.667l-465.143-465.143q-13.714-13.714-32.571-13.714t-32.571 13.714l-245.714 245.714q-13.714 13.714-13.714 32.571t13.714 32.571l62.857 62.857q13.714 13.714 32.571 13.714t32.571-13.714l150.286-150.286 369.714 369.714q13.714 13.714 32.571 13.714t32.571-13.714l62.857-62.857q13.714-13.714 13.714-32.571t-13.714-32.571z" horiz-adv-x="951" />
index a5c8be5f11a6372ce83e1dc98cd35d1204dee3f4..21baa983b02bbc43d9739694bb365a13dbd89393 100755 (executable)
Binary files a/sonar-server/src/main/webapp/fonts/sonar.ttf and b/sonar-server/src/main/webapp/fonts/sonar.ttf differ
index 380f913c1310b285ee06136f9a106f5c4abe71fe..27ded4b018c6c5b5823dadbe0a8f47afb70bfdc5 100755 (executable)
Binary files a/sonar-server/src/main/webapp/fonts/sonar.woff and b/sonar-server/src/main/webapp/fonts/sonar.woff differ
index 0c57cc7fc9027e712667bcaa70a0be07b1ef93f2..0b69e5429057fce0f4f797e4b4602dc0e8422a52 100644 (file)
@@ -158,6 +158,7 @@ requirejs [
   # Define coding rules
   App.addInitializer ->
     @codingRules = new Backbone.Collection
+    @codingRules.sorting = sort: 'CREATION_DATE', asc: false
 
 
   # Construct status bar
index d24f093b7166bf14e6d130f7f1727f4a08f557d4..ff1c02cbb00e685607abc9888fec5cc8762c2349 100644 (file)
       return this.layout.headerRegion.show(this.codingRulesHeaderView);
     });
     App.addInitializer(function() {
-      return this.codingRules = new Backbone.Collection;
+      this.codingRules = new Backbone.Collection;
+      return this.codingRules.sorting = {
+        sort: 'CREATION_DATE',
+        asc: false
+      };
     });
     App.addInitializer(function() {
       this.codingRulesActionsView = new CodingRulesActionsView({
index 7f1533dc29ce60288b24fe2cfc05ea98affc8620..72f71095b651baaf5feb3be3f62036b93f9e9a0d 100644 (file)
@@ -55,13 +55,15 @@ define ['jquery.mockjax'], ->
         'severity.MINOR': 'Minor'
         'severity.INFO': 'Info'
 
-        'coding_rules.page': 'Coding Rules'
+        'coding_rules.activate_quality_profile': 'Activate Quality Profile'
+        'coding_rules.deactivate_quality_profile': 'Deactivate'
+        'coding_rules.found': 'Found'
         'coding_rules.new_search': 'New Search'
         'coding_rules.no_results': 'No Coding Rules'
-        'coding_rules.found': 'Found'
+        'coding_rules.order': 'Order'
+        'coding_rules.ordered_by': 'Ordered By'
+        'coding_rules.page': 'Coding Rules'
         'coding_rules.quality_profiles': 'Quality Profiles'
-        'coding_rules.activate_quality_profile': 'Activate Quality Profile'
-        'coding_rules.deactivate_quality_profile': 'Deactivate'
 
         'coding_rules.filters.availableSince': 'Available Since'
         'coding_rules.filters.description': 'Description'
@@ -81,6 +83,9 @@ define ['jquery.mockjax'], ->
         'coding_rules.filters.status': 'Status'
         'coding_rules.filters.tag': 'Tag'
 
+        'coding_rules.sort.creation_date': 'Creation Date'
+        'coding_rules.sort.name': 'Name'
+
 
   # GET /api/codingrules/search
   jQuery.mockjax
@@ -185,3 +190,11 @@ define ['jquery.mockjax'], ->
         { id: 'qp3', text: 'Quality Profile 3', parent: null },
       ]
 
+
+  # GET /api/qualityprofiles/show
+  jQuery.mockjax
+    url: "#{baseUrl}/api/qualityprofiles/show"
+    responseText: JSON.stringify
+      qualityprofile:
+        id: 'sonarway', text: 'Sonar Way', parent: null
+
index c0b195ad61c36554fbae135abc72eb70e425d695..6c65ea7c283eab5f8bcbcf962933c482382c21e5 100644 (file)
           'severity.MAJOR': 'Major',
           'severity.MINOR': 'Minor',
           'severity.INFO': 'Info',
-          'coding_rules.page': 'Coding Rules',
+          'coding_rules.activate_quality_profile': 'Activate Quality Profile',
+          'coding_rules.deactivate_quality_profile': 'Deactivate',
+          'coding_rules.found': 'Found',
           'coding_rules.new_search': 'New Search',
           'coding_rules.no_results': 'No Coding Rules',
-          'coding_rules.found': 'Found',
+          'coding_rules.order': 'Order',
+          'coding_rules.ordered_by': 'Ordered By',
+          'coding_rules.page': 'Coding Rules',
           'coding_rules.quality_profiles': 'Quality Profiles',
-          'coding_rules.activate_quality_profile': 'Activate Quality Profile',
-          'coding_rules.deactivate_quality_profile': 'Deactivate',
           'coding_rules.filters.availableSince': 'Available Since',
           'coding_rules.filters.description': 'Description',
           'coding_rules.filters.in_quality_profile': 'In Quality Profile',
@@ -86,7 +88,9 @@
           'coding_rules.filters.repository': 'Repository',
           'coding_rules.filters.severity': 'Severity',
           'coding_rules.filters.status': 'Status',
-          'coding_rules.filters.tag': 'Tag'
+          'coding_rules.filters.tag': 'Tag',
+          'coding_rules.sort.creation_date': 'Creation Date',
+          'coding_rules.sort.name': 'Name'
         }
       })
     });
         }
       })
     });
-    return jQuery.mockjax({
+    jQuery.mockjax({
       url: "" + baseUrl + "/api/qualityprofiles/list",
       responseText: JSON.stringify({
         more: false,
         ]
       })
     });
+    return jQuery.mockjax({
+      url: "" + baseUrl + "/api/qualityprofiles/show",
+      responseText: JSON.stringify({
+        qualityprofile: {
+          id: 'sonarway',
+          text: 'Sonar Way',
+          parent: null
+        }
+      })
+    });
   });
 
 }).call(this);
index 8220be5a30cf20d61ecedcb3af1b8464ece25132..b9472b9a23c2f2019bacda97216bc6236f380537 100644 (file)
@@ -13,6 +13,42 @@ define [
       'all': 'render'
 
 
+    ui:
+      orderChoices: '.navigator-actions-order-choices'
+
+
+    events:
+      'click .navigator-actions-order': 'toggleOrderChoices'
+      'click @ui.orderChoices': 'sort'
+
+
+    onRender: ->
+      unless @collection.sorting.sortText
+        @collection.sorting.sortText = @$('[data-sort=' + @collection.sorting.sort + ']:first').text()
+        @render()
+
+
+    toggleOrderChoices: (e) ->
+      e.stopPropagation()
+      @ui.orderChoices.toggleClass 'open'
+      if @ui.orderChoices.is '.open'
+        jQuery('body').on 'click.coding_rules_actions', =>
+          @ui.orderChoices.removeClass 'open'
+
+
+    sort: (e) ->
+      e.stopPropagation()
+      @ui.orderChoices.removeClass 'open'
+      jQuery('body').off 'click.coding_rules_actions'
+      el = jQuery(e.target)
+      sort = el.data 'sort'
+      asc = el.data 'asc'
+      if sort != null && asc != null
+        @collection.sorting = sort: sort, sortText: el.text(), asc: asc
+        @options.app.fetchFirstPage()
+
+
     serializeData: ->
       _.extend super,
         paging: @collection.paging
+        sorting: @collection.sorting
index d2cefc37634503cca9b07bc7d8f4838a65f7c3cc..18a3cb256bd2c03a2b4f390ffae509709b316fe4 100644 (file)
         'all': 'render'
       };
 
+      CodingRulesStatusView.prototype.ui = {
+        orderChoices: '.navigator-actions-order-choices'
+      };
+
+      CodingRulesStatusView.prototype.events = {
+        'click .navigator-actions-order': 'toggleOrderChoices',
+        'click @ui.orderChoices': 'sort'
+      };
+
+      CodingRulesStatusView.prototype.onRender = function() {
+        if (!this.collection.sorting.sortText) {
+          this.collection.sorting.sortText = this.$('[data-sort=' + this.collection.sorting.sort + ']:first').text();
+          return this.render();
+        }
+      };
+
+      CodingRulesStatusView.prototype.toggleOrderChoices = function(e) {
+        var _this = this;
+        e.stopPropagation();
+        this.ui.orderChoices.toggleClass('open');
+        if (this.ui.orderChoices.is('.open')) {
+          return jQuery('body').on('click.coding_rules_actions', function() {
+            return _this.ui.orderChoices.removeClass('open');
+          });
+        }
+      };
+
+      CodingRulesStatusView.prototype.sort = function(e) {
+        var asc, el, sort;
+        e.stopPropagation();
+        this.ui.orderChoices.removeClass('open');
+        jQuery('body').off('click.coding_rules_actions');
+        el = jQuery(e.target);
+        sort = el.data('sort');
+        asc = el.data('asc');
+        if (sort !== null && asc !== null) {
+          this.collection.sorting = {
+            sort: sort,
+            sortText: el.text(),
+            asc: asc
+          };
+          return this.options.app.fetchFirstPage();
+        }
+      };
+
       CodingRulesStatusView.prototype.serializeData = function() {
         return _.extend(CodingRulesStatusView.__super__.serializeData.apply(this, arguments), {
-          paging: this.collection.paging
+          paging: this.collection.paging,
+          sorting: this.collection.sorting
         });
       };
 
index 456c61e35b5ba105bbe1c6d97e208cda8982d351..bf0ed4d62c51c658996d311b1543972bf37ead2c 100644 (file)
@@ -33,4 +33,6 @@ define [
 
 
     serializeData: ->
-      _.extend super, qualityProfile: @options.app.getActiveQualityProfile()
+      _.extend super,
+        qualityProfile: @options.app.getActiveQualityProfile()
+        qualityProfileName: @options.app.activeInFilter.view.renderValue()
index 7cb2d9709bc7b0967c70fae863b265ee728f1857..6dc0c2324c1d2229a28b8b89089539dcd84f7175 100644 (file)
@@ -45,7 +45,8 @@
 
       CodingRulesListItemView.prototype.serializeData = function() {
         return _.extend(CodingRulesListItemView.__super__.serializeData.apply(this, arguments), {
-          qualityProfile: this.options.app.getActiveQualityProfile()
+          qualityProfile: this.options.app.getActiveQualityProfile(),
+          qualityProfileName: this.options.app.activeInFilter.view.renderValue()
         });
       };
 
index 3e0503ff788dc60c9a1288a5374593d1e9623e12..ab1c4bd0c93901fe7bd4ceab1e64e835c6c76467 100644 (file)
@@ -26,3 +26,16 @@ define [
       else
         @model.unset 'parentQualityProfile'
 
+
+    createRequest: (v) ->
+      jQuery.ajax
+        url: baseUrl + '/api/qualityprofiles/show'
+        type: 'GET'
+        data: key: v
+      .done (r) =>
+        @choices.add new Backbone.Model
+          id: r.qualityprofile.id,
+          text: r.qualityprofile.text,
+          parent: r.qualityprofile.parent,
+          checked: true
+
index 65d5574d9d96d618b0e0be92835168d43938fb35..18c145e5821d037c7af5928a67efedc0cdcef1df 100644 (file)
         }
       };
 
+      QualityProfileFilterView.prototype.createRequest = function(v) {
+        var _this = this;
+        return jQuery.ajax({
+          url: baseUrl + '/api/qualityprofiles/show',
+          type: 'GET',
+          data: {
+            key: v
+          }
+        }).done(function(r) {
+          return _this.choices.add(new Backbone.Model({
+            id: r.qualityprofile.id,
+            text: r.qualityprofile.text,
+            parent: r.qualityprofile.parent,
+            checked: true
+          }));
+        });
+      };
+
       return QualityProfileFilterView;
 
     })(AjaxSelectFilters.AjaxSelectFilterView);
index d660974798aebf8165eb2d98d46e9c9a6264f776..a01708fc0dc5e224c56c13341d1c3707ee11a0bc 100644 (file)
   top: -0.1em;
   content: "\f00c";
 }
+.icon-lang:before {
+  content: "\f024";
+  font-size: 14px;
+}
+.icon-quality-profile:before {
+  content: "\f022";
+  font-size: 14px;
+}
 /*
  * Spinner
  */
index d5cf86cfc9c0dbbf20b4c680608559a47f20bbb2..6d201a1c1683717bd2a995fcc54b1d99683e3d47 100644 (file)
   top: -0.1em;
   content: "\f00c";
 }
+.icon-lang:before {
+  content: "\f024";
+  font-size: @iconFontSize;
+}
+.icon-quality-profile:before {
+  content: "\f022";
+  font-size: @iconFontSize;
+}
 
 
 /*
index b1f659991c23e63d4bb195aec89772718a6475e8..31e93180fd7853f4fe17ea7df30a356ea3a2b7d1 100644 (file)
 }
 .navigator-results-list > li {
   padding: 5px 0;
+  border-top: 1px solid transparent;
   cursor: pointer;
   transition: all 0.3s ease;
 }
-.navigator-results-list > li:first-child {
-  border-top: 1px solid transparent;
-}
-.navigator-results-list > li:first-child.active {
-  border-top-color: #4B9FD5;
-}
-.navigator-results-list > li:last-child {
-  border-bottom: 1px solid transparent;
-}
-.navigator-results-list > li:last-child.active {
-  border-bottom-color: #4B9FD5;
-}
 .navigator-results-list > li .line {
   padding: 5px 10px;
   line-height: 1.2;
   background-color: #CAE3F2;
   border-color: #4B9FD5;
 }
+.navigator-results-list > li.with-context {
+  border-right: 6px solid #e1e1e1;
+}
+.navigator-results-list > li:last-child {
+  border-bottom: 1px solid transparent;
+}
+.navigator-results-list > li:last-child.active {
+  border-bottom-color: #4B9FD5;
+}
 .navigator-results-list > li + li {
-  border-top: 1px solid #e1e1e1;
+  border-top-color: #e1e1e1;
 }
 .navigator-results-list > li.active + li {
   border-top-color: #4B9FD5;
index 1ea09e693496dd7bf5fd9642b616b556a991878c..f8ed869af8519e4038be74557774ed5125a72e77 100644 (file)
 }
 .navigator-results-list > li {
   padding: 5px 0;
+  border-top: 1px solid transparent;
   cursor: pointer;
   transition: all 0.3s ease;
 }
-.navigator-results-list > li:first-child {
-  border-top: 1px solid transparent;
-}
-.navigator-results-list > li:first-child.active {
-  border-top-color: #4B9FD5;
-}
-.navigator-results-list > li:last-child {
-  border-bottom: 1px solid transparent;
-}
-.navigator-results-list > li:last-child.active {
-  border-bottom-color: #4B9FD5;
-}
 .navigator-results-list > li .line {
   padding: 5px 10px;
   line-height: 1.2;
   background-color: #CAE3F2;
   border-color: #4B9FD5;
 }
+.navigator-results-list > li.with-context {
+  border-right: 6px solid #e1e1e1;
+}
+.navigator-results-list > li:last-child {
+  border-bottom: 1px solid transparent;
+}
+.navigator-results-list > li:last-child.active {
+  border-bottom-color: #4B9FD5;
+}
 .navigator-results-list > li + li {
-  border-top: 1px solid #e1e1e1;
+  border-top-color: #e1e1e1;
 }
 .navigator-results-list > li.active + li {
   border-top-color: #4B9FD5;
index d14c174282085056bdc56c96153f968d493e2a9f..6b5bc5ad83700677326639cf742e314070cf2261 100644 (file)
 
   & > li {
     padding: @navigatorPadding / 2 0;
+    border-top: 1px solid transparent;
     cursor: pointer;
     .trans;
 
-    &:first-child {
-      border-top: 1px solid transparent;
-
-      &.active {
-        border-top-color: #4B9FD5;
-      }
-    }
-
-    &:last-child {
-      border-bottom: 1px solid transparent;
-
-      &.active {
-        border-bottom-color: #4B9FD5;
-      }
-    }
-
     .line {
       padding: @navigatorPadding / 2 @navigatorPadding;
       line-height: 1.2;
       background-color: #CAE3F2;
       border-color: #4B9FD5;
     }
+
+    &.with-context {
+      border-right: 6px solid @navigatorBorderLightColor;
+    }
+
+    &:last-child {
+      border-bottom: 1px solid transparent;
+
+      &.active {
+        border-bottom-color: #4B9FD5;
+      }
+    }
   }
 
   & > li + li {
-    border-top: 1px solid @navigatorBorderLightColor;
+    border-top-color: @navigatorBorderLightColor;
   }
 
   & > li.active + li {