##// END OF EJS Templates
code layout clean up app/views/issues/_relations.html.erb...
Toshi MARUYAMA -
r8484:b0824ea5a416
parent child
Show More
@@ -1,37 +1,40
1 <div class="contextual">
1 <div class="contextual">
2 <% if User.current.allowed_to?(:manage_issue_relations, @project) %>
2 <% if User.current.allowed_to?(:manage_issue_relations, @project) %>
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 @relations.present? %>
9 <% if @relations.present? %>
10 <form>
10 <form>
11 <table class="list issues">
11 <table class="list issues">
12 <% @relations.each do |relation| %>
12 <% @relations.each do |relation| %>
13 <tr class="issue hascontextmenu" id="relation-<%= relation.id %>">
13 <tr class="issue hascontextmenu" id="relation-<%= relation.id %>">
14 <td class="checkbox"><%= check_box_tag("ids[]", relation.other_issue(@issue).id, false, :id => nil) %></td>
14 <td class="checkbox"><%= check_box_tag("ids[]", relation.other_issue(@issue).id, false, :id => nil) %></td>
15 <td class="subject"><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
15 <td class="subject"><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
16 <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
16 <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
17 <%= link_to_issue(relation.other_issue(@issue), :truncate => 60) %>
17 <%= link_to_issue(relation.other_issue(@issue), :truncate => 60) %>
18 </td>
18 </td>
19 <td class="status"><%=h relation.other_issue(@issue).status.name %></td>
19 <td class="status"><%=h relation.other_issue(@issue).status.name %></td>
20 <td class="start_date"><%= format_date(relation.other_issue(@issue).start_date) %></td>
20 <td class="start_date"><%= format_date(relation.other_issue(@issue).start_date) %></td>
21 <td class="due_date"><%= format_date(relation.other_issue(@issue).due_date) %></td>
21 <td class="due_date"><%= format_date(relation.other_issue(@issue).due_date) %></td>
22 <td class="buttons"><%= link_to_remote(image_tag('link_break.png'), { :url => {:controller => 'issue_relations', :action => 'destroy', :id => relation},
22 <td class="buttons"><%= link_to_remote(
23 :method => :delete
23 image_tag('link_break.png'),
24 }, :title => l(:label_relation_delete)) if authorize_for('issue_relations', 'destroy') %></td>
24 { :url => {:controller => 'issue_relations', :action => 'destroy', :id => relation},
25 :method => :delete },
26 :title => l(:label_relation_delete)
27 ) if authorize_for('issue_relations', 'destroy') %></td>
25 </tr>
28 </tr>
26 <% end %>
29 <% end %>
27 </table>
30 </table>
28 </form>
31 </form>
29 <% end %>
32 <% end %>
30
33
31 <% remote_form_for(:relation, @relation,
34 <% remote_form_for(:relation, @relation,
32 :url => {:controller => 'issue_relations', :action => 'create', :issue_id => @issue},
35 :url => {:controller => 'issue_relations', :action => 'create', :issue_id => @issue},
33 :method => :post,
36 :method => :post,
34 :complete => "Form.Element.focus('relation_issue_to_id');",
37 :complete => "Form.Element.focus('relation_issue_to_id');",
35 :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}) do |f| %>
38 :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}) do |f| %>
36 <%= render :partial => 'issue_relations/form', :locals => {:f => f}%>
39 <%= render :partial => 'issue_relations/form', :locals => {:f => f}%>
37 <% end %>
40 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now