show.rhtml

sunday walker, 2008-02-11 14:16

Download (5.7 KB)

 
1
<div class="contextual">
2
<%= show_and_goto_link(l(:label_add_note), 'add-note', :class => 'icon icon-note') if authorize_for('issues', 'add_note') %>
3
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
4
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
5
<%= watcher_tag(@issue, User.current) %>
6
<%= link_to_if_authorized l(:button_copy), {:controller => 'projects', :action => 'add_issue', :id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
7
<%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'icon icon-move' %>
8
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
9
</div>
10

    
11
<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
12

    
13
<div class="issue <%= "status-#{@issue.status.position} priority-#{@issue.priority.position}" %>">
14
        <h3><%=h @issue.subject %></h3>
15
        <p class="author">
16
        <%= authoring @issue.created_on, @issue.author %>.
17
        <%= l(:label_updated_time, distance_of_time_in_words(Time.now, @issue.updated_on)) if @issue.created_on != @issue.updated_on %>.
18
        </p>
19

    
20
<table width="100%">
21
<tr>
22
    <td style="width:15%"><b><%=l(:field_status)%> :</b></td><td style="width:35%"><%= @issue.total('status').name %></td>
23
    <td style="width:15%"><b><%=l(:field_start_date)%> :</b></td><td style="width:35%"><%= format_date(@issue.total('start_date')) %></td>
24
</tr>
25
<tr>
26
    <td><b><%=l(:field_priority)%> :</b></td><td><%= @issue.total('priority').name %></td>
27
    <td><b><%=l(:field_due_date)%> :</b></td><td><%= format_date(@issue.total('due_date')) %></td>
28
</tr>
29
<tr>
30
    <td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
31
    <td><b><%=l(:field_done_ratio)%> :</b></td><td><%= progress_bar @issue.total('done_ratio'), :width => '80px', :legend => "#{@issue.total('done_ratio')}%" %></td>
32
</tr>
33
<tr>
34
    <td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
35
    <% if User.current.allowed_to?(:view_time_entries, @project) %>
36
    <td><b><%=l(:label_spent_time)%> :</b></td>
37
    <td><%= @issue.total('spent_hours') > 0 ? (link_to lwr(:label_f_hour, @issue.total('spent_hours')), {:controller => 'timelog', :action => 'details', :issue_id => @issue}, :class => 'icon icon-time') : "-" %></td>
38
    <% end %>
39
</tr>
40
<tr>
41
    <td><b><%=l(:field_fixed_version)%> :</b></td><td><%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %></td>
42
    <% if @issue.total('estimated_hours') %>
43
    <td><b><%=l(:field_estimated_hours)%> :</b></td><td><%= lwr(:label_f_hour, @issue.total('estimated_hours')) %></td>
44
    <% end %>
45
</tr>
46
<tr>
47
<% n = 0
48
for custom_value in @custom_values %>
49
    <td valign="top"><b><%= custom_value.custom_field.name %> :</b></td><td valign="top"><%= simple_format(h(show_value(custom_value))) %></td>
50
<% n = n + 1
51
   if (n > 1) 
52
        n = 0 %>
53
        </tr><tr>
54
 <%end
55
end %>
56
</tr>
57
</table>
58
<hr />
59

    
60
<% if @issue.changesets.any? %>
61
<div style="float:right;">
62
  <em><%= l(:label_revision_plural) %>: <%= @issue.changesets.collect{|changeset| link_to(changeset.revision, :controller => 'repositories', :action => 'revision', :id => @project, :rev => changeset.revision)}.join(", ") %></em>
63
</div>
64
<% end %>
65

    
66
<p><strong><%=l(:field_description)%></strong></p>
67
<%= textilizable @issue, :description, :attachments => @issue.attachments %>
68

    
69
<% if @issue.attachments.any? %>
70
<%= link_to_attachments @issue.attachments, :delete_url => (authorize_for('issues', 'destroy_attachment') ? {:controller => 'issues', :action => 'destroy_attachment', :id => @issue} : nil) %>
71
<% end %>
72

    
73
<% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
74
<hr />
75
<div id="relations">
76
<%= render :partial => 'relations' %>
77
</div>
78
<% end %>
79

    
80
</div>
81

    
82
<% if authorize_for('issues', 'change_status') and @status_options and !@status_options.empty? %>
83
  <% form_tag({:controller => 'issues', :action => 'change_status', :id => @issue}) do %>
84
  <p><%=l(:label_change_status)%> :
85
  <select name="new_status_id">
86
  <%= options_from_collection_for_select @status_options, "id", "name" %>
87
  </select>
88
  <%= submit_tag l(:button_change) %></p>
89
  <% end %>
90
<% end %>
91

    
92
<% if @journals.any? %>
93
<div id="history">
94
<h3><%=l(:label_history)%></h3>
95
<%= render :partial => 'history', :locals => { :journals => @journals } %>
96
</div>
97
<% end %>
98

    
99
<% if authorize_for('issues', 'add_note') %>
100
  <a name="add-note-anchor"></a>
101
  <div id="add-note" class="box" style="display:none;">
102
  <h3><%= l(:label_add_note) %></h3>
103
  <% form_tag({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular", :multipart => true) do %>
104
  <p><label for="notes"><%=l(:field_notes)%></label>
105
    <%= text_area_tag 'notes', '', :cols => 60, :rows => 10, :class => 'wiki-edit'  %></p>
106
    <%= wikitoolbar_for 'notes' %>
107
    <%= render :partial => 'attachments/form' %>
108
  <%= submit_tag l(:button_add) %>
109
  <%= toggle_link l(:button_cancel), 'add-note' %>
110
  <% end %>  
111
  </div>
112
<% end %>
113

    
114
<div class="contextual">
115
<%= l(:label_export_to) %><%= link_to 'PDF', {:format => 'pdf'}, :class => 'icon icon-pdf' %>
116
</div>
117
&nbsp;
118

    
119
<% set_html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
120

    
121
<% content_for :sidebar do %>
122
    <%= render :partial => 'issues/sidebar' %>
123
<% end %>