Skip to content

Commit

Permalink
[webui] Add a little hack to open upstream issue tracker links in new
Browse files Browse the repository at this point in the history
windows.

Adds some comments, too.
  • Loading branch information
saschpe committed Oct 26, 2011
1 parent b7c0efb commit 7e09cfb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webui/app/views/request/show.html.erb
Expand Up @@ -300,14 +300,20 @@
<% @diff_per_action.each do |index_and_type, diff| %>
<% index, _ = index_and_type.split('_', 2) %>
<% if diff[:bugs] && diff[:bugs].length > 0 %>
<%# TODO: Anything but nice, move to 'box' when request view is restructured: %>
<div style="float:right;">
<h3>Issues mentioned</h3>
<ul>
<% diff[:bugs].each do |bug, url| %>
<li><%= link_to(bug, url) %></li>
<li><%= link_to(bug, url, :class => 'issue_tracker_link') %></li>
<% end %>
</ul>
</div>
<%# Stupid XHTML-1.0 strict doesn't like 'target', but all browsers do. Thus, sneak around validation to %>
<%# allow opening a new window upon click: %>
<% javascript_tag do %>
$('a.issue_tracker_link').attr('target', '_blank')
<% end %>
<% end %>
<% if diff[:filenames] && diff[:filenames].length > 0 %>
<table class="diff_action_display" id="diff_action_<%= index_and_type %>" <%= 'class="hidden"' if index != '0' %>>
Expand Down

0 comments on commit 7e09cfb

Please sign in to comment.