]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3014 Improve display of links not starting with 'http(s)'
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 9 Feb 2012 17:49:46 +0000 (18:49 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 9 Feb 2012 17:49:46 +0000 (18:49 +0100)
Initial request:
=> The main project dashboard "Links" column provides a Developer
   Connection link that browsers do not support

plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb

index 758eb00d9869cf1cd1cd1ce06c6cedadde90d93d..8152bde247f38873277380966c576326f0cde20e 100644 (file)
@@ -6,8 +6,8 @@
   <table class="width100 marginbottom10">
     <tbody>
     <tr>
-      <td><%= message('widget.description.key') -%>: </td>
-      <td id="resource_key"><%= @project.key -%></td>
+      <td width="25%"><%= message('widget.description.key') -%>: </td>
+      <td width="75%" id="resource_key"><%= @project.key -%></td>
     </tr>
     <% if @project.language %>
     <tr>
         <td valign="top"><%= message('widget.description.links') -%>: </td>
         <td id="resource_links">
         <% @project.project_links.sort.each do |link| %>
-          <%= link_to(image_tag(link.icon, :alt => link.name), link.href , :popup => true, :class => 'nolink') -%> <%= link_to(h(link.name), link.href, :popup => true) -%><br/>
+          <div>
+          <%= link_to(image_tag(link.icon, :alt => link.name), link.href , :popup => true, :class => 'nolink') -%>
+          <% if link.href.starts_with?('http') %>
+            <%= link_to(h(link.name), link.href, :popup => true) -%>
+          <% else %>
+            <a href="#" onclick="$('link_<%= link.id -%>').toggle();return false;"><%= h(link.name) -%></a>
+            <div id="link_<%= link.id -%>" style="padding-left: 20px; display:none"><%= h(link.href) -%></div>
+          <% end %>
+          </div>
         <% end %>
         </td>
       </tr>