##// END OF EJS Templates
Refocus the related issue field after submitting an issue. #6275...
Eric Davis -
r3951:270b559d362a
parent child
Show More
@@ -1,33 +1,34
1 <div class="contextual">
1 <div class="contextual">
2 <% if authorize_for('issue_relations', 'new') %>
2 <% if authorize_for('issue_relations', 'new') %>
3 <%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'relation_issue_to_id'} %>
3 <%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'relation_issue_to_id'} %>
4 <% end %>
4 <% end %>
5 </div>
5 </div>
6
6
7 <p><strong><%=l(:label_related_issues)%></strong></p>
7 <p><strong><%=l(:label_related_issues)%></strong></p>
8
8
9 <% if @issue.relations.any? %>
9 <% if @issue.relations.any? %>
10 <table style="width:100%">
10 <table style="width:100%">
11 <% @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation| %>
11 <% @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation| %>
12 <tr>
12 <tr>
13 <td><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
13 <td><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
14 <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
14 <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
15 <%= link_to_issue(relation.other_issue(@issue), :truncate => 60) %>
15 <%= link_to_issue(relation.other_issue(@issue), :truncate => 60) %>
16 </td>
16 </td>
17 <td><%= relation.other_issue(@issue).status.name %></td>
17 <td><%= relation.other_issue(@issue).status.name %></td>
18 <td><%= format_date(relation.other_issue(@issue).start_date) %></td>
18 <td><%= format_date(relation.other_issue(@issue).start_date) %></td>
19 <td><%= format_date(relation.other_issue(@issue).due_date) %></td>
19 <td><%= format_date(relation.other_issue(@issue).due_date) %></td>
20 <td><%= link_to_remote(image_tag('delete.png'), { :url => {:controller => 'issue_relations', :action => 'destroy', :issue_id => @issue, :id => relation},
20 <td><%= link_to_remote(image_tag('delete.png'), { :url => {:controller => 'issue_relations', :action => 'destroy', :issue_id => @issue, :id => relation},
21 :method => :post
21 :method => :post
22 }, :title => l(:label_relation_delete)) if authorize_for('issue_relations', 'destroy') %></td>
22 }, :title => l(:label_relation_delete)) if authorize_for('issue_relations', 'destroy') %></td>
23 </tr>
23 </tr>
24 <% end %>
24 <% end %>
25 </table>
25 </table>
26 <% end %>
26 <% end %>
27
27
28 <% remote_form_for(:relation, @relation,
28 <% remote_form_for(:relation, @relation,
29 :url => {:controller => 'issue_relations', :action => 'new', :issue_id => @issue},
29 :url => {:controller => 'issue_relations', :action => 'new', :issue_id => @issue},
30 :method => :post,
30 :method => :post,
31 :complete => "Form.Element.focus('relation_issue_to_id');",
31 :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}) do |f| %>
32 :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}) do |f| %>
32 <%= render :partial => 'issue_relations/form', :locals => {:f => f}%>
33 <%= render :partial => 'issue_relations/form', :locals => {:f => f}%>
33 <% end %>
34 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now