]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6331 show project meta in the header
authorStas Vilchik <vilchiks@gmail.com>
Wed, 8 Apr 2015 14:09:23 +0000 (16:09 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 8 Apr 2015 14:09:32 +0000 (16:09 +0200)
server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs
server/sonar-web/src/main/js/nav/context-navbar-view.js
server/sonar-web/src/main/less/init/misc.less

index 5dcff71a941a75519813a807e3827cc4ccf819dc..74d0196ce6a1d4c74ad9cd9302661fad58b825c5 100644 (file)
         {{/if}}
       </ul>
     </li>
+    <li class="js-meta-dropdown dropdown pull-right">
+      <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{t 'info'}}&nbsp;<i class="icon-dropdown"></i></a>
+      <div class="dropdown-menu dropdown-menu-right panel abs-width-400">
+        <form class="js-meta"></form>
+      </div>
+    </li>
   </ul>
 </div>
index 6f37d7ab2e458258d35af0d9f57ab2249f29c337..eccfd034dfc3845384809f5ec7af361ef9076ced 100644 (file)
@@ -39,7 +39,8 @@ define([
     },
 
     events: {
-      'click .js-favorite': 'onFavoriteClick'
+      'click .js-favorite': 'onFavoriteClick',
+      'show.bs.dropdown .js-meta-dropdown': 'onMetaDropdownShow'
     },
 
     onRender: function () {
@@ -58,6 +59,22 @@ define([
       });
     },
 
+    onMetaDropdownShow: function () {
+      var that = this;
+      this.requestMeta().done(function (r) {
+        that.$('.js-meta').html(r);
+      });
+    },
+
+    requestMeta: function () {
+      var url = baseUrl + '/widget/show',
+          options = {
+            id: 'description',
+            resource: this.model.get('contextKey')
+          };
+      return $.get(url, options);
+    },
+
     serializeData: function () {
       var href = window.location.href,
           isMoreActive = _.some(OVERVIEW_URLS, function (url) {
index ce7d07dc15e6f7c0dc0cbee5858f70a546a691ab..f3000fbb979cba79935169ce158c23dc0e533900 100644 (file)
@@ -48,6 +48,9 @@ td.spacer-right  { padding-right: 8px; }
 td.spacer-bottom { padding-bottom: 8px; }
 td.spacer-top    { padding-top: 8px; }
 
+.pull-left  { float: left !important; }
+.pull-right { float: right !important; }
+
 .bordered        { border: 1px solid @barBorderColor; }
 .bordered-left   { border-left: 1px solid @barBorderColor; }
 .bordered-right  { border-right: 1px solid @barBorderColor; }
@@ -62,6 +65,8 @@ td.spacer-top    { padding-top: 8px; }
 .width-20 { width: 20%; }
 .width-15 { width: 15%; }
 
+.abs-width-400 { width: 400px; }
+
 .justify {
   margin-bottom: -1em;
   text-align: justify;