_relations.rhtml

sunday walker, 2008-02-11 14:16

Download (1.61 KB)

 
1
<div class="contextual">
2
<% if authorize_for('issue_relations', 'new') %>
3
    <%= toggle_link l(:button_add), 'new-relation-form'%>
4
<% end %>
5
</div>
6

    
7
<p><strong><%=l(:label_related_issues)%></strong></p>
8

    
9
<% if @issue.relations.any? %>
10
<table style="width:100%">
11
<% @issue.relations.each do |relation| %>
12
<tr>
13
<td><%= l(relation.label_for(@issue)) %> <%= "(#{lwr(:actionview_datehelper_time_in_words_day, relation.delay)})" if relation.delay && relation.delay != 0 %> <%= link_to_issue relation.other_issue(@issue) %></td>
14
<td><%=h relation.other_issue(@issue).subject %></td>
15
<td><%= relation.other_issue(@issue).total('status').name %></td>
16
<td><%= format_date(relation.other_issue(@issue).total('start_date')) %></td>
17
<td><%= format_date(relation.other_issue(@issue).total('due_date')) %></td>
18
<td><%= link_to_remote(image_tag('delete.png'), { :url => {:controller => 'issue_relations', :action => 'destroy', :issue_id => @issue, :id => relation},                                              
19
                                                  :method => :post
20
                                                }, :title => l(:label_relation_delete)) if authorize_for('issue_relations', 'destroy') %></td>
21
</tr>
22
<% end %>
23
</table>
24
<% end %>
25

    
26
<% remote_form_for(:relation, @relation, 
27
                 :url => {:controller => 'issue_relations', :action => 'new', :issue_id => @issue},
28
                 :method => :post,
29
                 :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}) do |f| %>
30
<%= render :partial => 'issue_relations/form', :locals => {:f => f}%>
31
<% end %>