Skip to content
Browse files

SONAR-3014 Improve display of links not starting with 'http(s)'

Initial request:
=> The main project dashboard "Links" column provides a Developer 
   Connection link that browsers do not support
  • Loading branch information...
1 parent a7031c1 commit c3bc6982b7e165304e269d7b7ef309a05148be98 @bellingard bellingard committed
View
14 .../sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb
@@ -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>
@@ -35,7 +35,15 @@
<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>

0 comments on commit c3bc698

Please sign in to comment.
Something went wrong with that request. Please try again.