<h1>Project Links</h1>
<br/>
+
+<style>
+#widget_links td, #widget_links th {
+ white-space: nowrap;
+ vertical-align: top;
+ text-align: left;
+ padding-left: 20px;
+ padding-right: 20px;
+}
+</style>
+
<div class="yui-g widget" id="widget_links">
<% form_for( 'set_links', :url => { :action => 'set_links', :project_id => @project.id } ) do |form|
links_by_key[link.link_type]=link
end
%>
- <div class="yui-u first">
- <table class="data">
- <thead><tr><th>Title</th><th>URL</th></tr></thead>
+ <div class="yui-u first">
+ <table class="data">
+ <thead><tr><th >Title</th><th width="100%">URL</th></tr></thead>
- <tr class="even">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/homepage.png") -%> Home</td>
+ <tr class="even">
+ <td>
+ <%= image_tag("links/homepage.png") -%> <%= message('project_links.homepage') -%>
+ <br/>
+ <span class="note" style="margin-left: 20px">sonar.links.homepage</span>
+ </td>
<td>
- <input type="hidden" name="key_homepage" value="homepage" />
- <input type="hidden" name="name_homepage" value="Home" />
- <%= text_field_tag( "url_homepage", links_by_key['homepage'] ? links_by_key['homepage'].href : '', :readonly => true, :size => 30 ) -%>
+ <%
+ link = links_by_key['homepage'] ? links_by_key['homepage'].href : ''
+ if link.starts_with?("http")
+ link = "<a href=\"#{h link}\">#{h link}</a>"
+ end
+ %>
+ <%= link -%>
</td>
</tr>
<tr class="odd">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/ci.png") -%> Continuous integration</td>
+ <td>
+ <%= image_tag("links/ci.png") -%> <%= message('project_links.ci') -%>
+ <br/>
+ <span class="note" style="margin-left: 20px">sonar.links.ci</span>
+ </td>
<td>
- <input type="hidden" name="key_ci" value="ci" />
- <input type="hidden" name="name_ci" value="Continuous integration" />
- <%= text_field_tag( "url_ci", links_by_key['ci'] ? links_by_key['ci'].href : '', :readonly => true, :size => 30 ) -%>
+ <%
+ link = links_by_key['ci'] ? links_by_key['ci'].href : ''
+ if link.starts_with?("http")
+ link = "<a href=\"#{h link}\">#{h link}</a>"
+ end
+ %>
+ <%= link -%>
</td>
</tr>
<tr class="even">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/issue.png") -%> Issue tracker</td>
+ <td>
+ <%= image_tag("links/issue.png") -%> <%= message('project_links.issue') -%>
+ <br/>
+ <span class="note" style="margin-left: 20px">sonar.links.issue</span>
+ </td>
<td>
- <input type="hidden" name="key_issue" value="issue" />
- <input type="hidden" name="name_issue" value="Issues" />
- <%= text_field_tag( "url_issue", links_by_key['issue'] ? links_by_key['issue'].href : '', :readonly => true, :size => 30 ) -%>
+ <%
+ link = links_by_key['issue'] ? links_by_key['issue'].href : ''
+ if link.starts_with?("http")
+ link = "<a href=\"#{h link}\">#{h link}</a>"
+ end
+ %>
+ <%= link -%>
</td>
</tr>
<tr class="odd">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/scm.png") -%> Sources</td>
+ <td>
+ <%= image_tag("links/scm.png") -%> <%= message('project_links.scm') -%>
+ <br/>
+ <span class="note" style="margin-left: 20px">sonar.links.scm</span>
+ </td>
<td>
- <input type="hidden" name="key_scm" value="scm" />
- <input type="hidden" name="name_scm" value="Sources" />
- <%= text_field_tag( "url_scm", links_by_key['scm'] ? links_by_key['scm'].href : '', :readonly => true, :size => 30 ) -%>
+ <%
+ link = links_by_key['scm'] ? links_by_key['scm'].href : ''
+ if link.starts_with?("http")
+ link = "<a href=\"#{h link}\">#{h link}</a>"
+ end
+ %>
+ <%= link -%>
</td>
</tr>
<tr class="even">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/scm_dev.png") -%> Developer connection</td>
+ <td>
+ <%= image_tag("links/scm_dev.png") -%> <%= message('project_links.scm_dev') -%>
+ <br/>
+ <span class="note" style="margin-left: 20px">sonar.links.scm_dev</span>
+ </td>
<td>
- <input type="hidden" name="key_scm_dev" value="scm_dev" />
- <input type="hidden" name="name_scm_dev" value="Developer connection" />
- <%= text_field_tag( "url_scm_dev", links_by_key['scm_dev'] ? links_by_key['scm_dev'].href : '', :readonly => true, :size => 30 ) -%>
+ <%
+ link = links_by_key['scm_dev'] ? links_by_key['scm_dev'].href : ''
+ if link.starts_with?("http")
+ link = "<a href=\"#{h link}\">#{h link}</a>"
+ end
+ %>
+ <%= link -%>
</td>
</tr>
- </table>
- <br/>
- <%= submit_tag( "Save links" ) %>
- </div>
- <div class="yui-u">
- <table class="data">
- <thead><tr><th>Title</th><th>URL</th></tr></thead>
+
<% index = 0
@project.custom_links.each do |custom_link|
index += 1 %>
- <tr class="<%= cycle('even','odd') -%>">
+ <tr class="<%= cycle('odd','even') -%>">
<td align="left">
<%= image_tag("links/external.png") -%> <%= text_field_tag( "name_#{index}", h(custom_link.name), :size => 15 ) -%>
</td>
<% end %>
<% index += 1
for var in index..5 %>
- <tr class="<%= cycle('even','odd') -%>">
+ <tr class="<%= cycle('odd','even') -%>">
<td align="left"><%= image_tag("links/external.png") -%> <%= text_field_tag( "name_#{var}", '', :size => 15) %></td>
<td><%= text_field_tag( "url_#{var}", '', :size => 30 ) %></td>
</tr>
<% end %>
- </table>
- </div>
+ </table>
+ <br/>
+ <%= submit_tag( "Save links" ) %>
+ </div>
<% end %>
</div>
\ No newline at end of file