show.html.erb 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <%= render :partial => 'action_menu' %>
  2. <h2><%= issue_heading(@issue) %></h2>
  3. <div class="<%= @issue.css_classes %> details">
  4. <% if @prev_issue_id || @next_issue_id %>
  5. <div class="next-prev-links contextual">
  6. <%= link_to_if @prev_issue_id,
  7. "\xc2\xab #{l(:label_previous)}",
  8. (@prev_issue_id ? issue_path(@prev_issue_id) : nil),
  9. :title => "##{@prev_issue_id}" %> |
  10. <% if @issue_position && @issue_count %>
  11. <span class="position"><%= l(:label_item_position, :position => @issue_position, :count => @issue_count) %></span> |
  12. <% end %>
  13. <%= link_to_if @next_issue_id,
  14. "#{l(:label_next)} \xc2\xbb",
  15. (@next_issue_id ? issue_path(@next_issue_id) : nil),
  16. :title => "##{@next_issue_id}" %>
  17. </div>
  18. <% end %>
  19. <%= avatar(@issue.author, :size => "50") %>
  20. <div class="subject">
  21. <%= render_issue_subject_with_tree(@issue) %>
  22. </div>
  23. <p class="author">
  24. <%= authoring @issue.created_on, @issue.author %>.<br>
  25. <% if @issue.created_on != @issue.updated_on %>
  26. <%= l(:label_updated_time, :value => time_tag(@issue.updated_on), :time => @issue.updated_on).html_safe %>.
  27. <% end %>
  28. </p>
  29. <table class="attributes">
  30. <%= issue_fields_rows do |rows|
  31. rows.left l(:field_status), h(@issue.status.name), :class => 'status'
  32. rows.left l(:field_priority), h(@issue.priority.name), :class => 'priority'
  33. unless @issue.disabled_core_fields.include?('assigned_to_id')
  34. rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
  35. end
  36. unless @issue.disabled_core_fields.include?('category_id')
  37. rows.left l(:field_category), h(@issue.category ? @issue.category.name : "-"), :class => 'category'
  38. end
  39. unless @issue.disabled_core_fields.include?('fixed_version_id')
  40. rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version'
  41. end
  42. unless @issue.disabled_core_fields.include?('start_date')
  43. rows.right l(:field_start_date), format_date(@issue.start_date), :class => 'start-date'
  44. end
  45. unless @issue.disabled_core_fields.include?('due_date')
  46. rows.right l(:field_due_date), format_date(@issue.due_date), :class => 'due-date'
  47. end
  48. unless @issue.disabled_core_fields.include?('done_ratio')
  49. rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%"), :class => 'progress'
  50. end
  51. unless @issue.disabled_core_fields.include?('estimated_hours')
  52. unless @issue.estimated_hours.nil?
  53. rows.right l(:field_estimated_hours), l_hours(@issue.estimated_hours), :class => 'estimated-hours'
  54. end
  55. end
  56. if User.current.allowed_to?(:view_time_entries, @project)
  57. rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? link_to(l_hours(@issue.total_spent_hours), project_issue_time_entries_path(@project, @issue)) : "-"), :class => 'spent-time'
  58. end
  59. end %>
  60. <%= render_custom_fields_rows(@issue) %>
  61. <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
  62. </table>
  63. <% if @issue.description? || @issue.attachments.any? -%>
  64. <hr />
  65. <% if @issue.description? %>
  66. <div class="description">
  67. <div class="contextual">
  68. <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
  69. </div>
  70. <p><strong><%=l(:field_description)%></strong></p>
  71. <div class="wiki">
  72. <%= textilizable @issue, :description, :attachments => @issue.attachments %>
  73. </div>
  74. </div>
  75. <% end %>
  76. <%= link_to_attachments @issue, :thumbnails => true %>
  77. <% end -%>
  78. <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
  79. <% if !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>
  80. <hr />
  81. <div id="issue_tree">
  82. <div class="contextual">
  83. <%= link_to_new_subtask(@issue) if User.current.allowed_to?(:manage_subtasks, @project) %>
  84. </div>
  85. <p><strong><%=l(:label_subtask_plural)%></strong></p>
  86. <%= render_descendants_tree(@issue) unless @issue.leaf? %>
  87. </div>
  88. <% end %>
  89. <% if @relations.present? || User.current.allowed_to?(:manage_issue_relations, @project) %>
  90. <hr />
  91. <div id="relations">
  92. <%= render :partial => 'relations' %>
  93. </div>
  94. <% end %>
  95. </div>
  96. <% if @changesets.present? %>
  97. <div id="issue-changesets">
  98. <h3><%=l(:label_associated_revisions)%></h3>
  99. <%= render :partial => 'changesets', :locals => { :changesets => @changesets} %>
  100. </div>
  101. <% end %>
  102. <% if @journals.present? %>
  103. <div id="history">
  104. <h3><%=l(:label_history)%></h3>
  105. <%= render :partial => 'history', :locals => { :issue => @issue, :journals => @journals } %>
  106. </div>
  107. <% end %>
  108. <div style="clear: both;"></div>
  109. <%= render :partial => 'action_menu' %>
  110. <div style="clear: both;"></div>
  111. <% if @issue.editable? %>
  112. <div id="update" style="display:none;">
  113. <h3><%= l(:button_edit) %></h3>
  114. <%= render :partial => 'edit' %>
  115. </div>
  116. <% end %>
  117. <% other_formats_links do |f| %>
  118. <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
  119. <%= f.link_to 'PDF' %>
  120. <% end %>
  121. <% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
  122. <% content_for :sidebar do %>
  123. <%= render :partial => 'issues/sidebar' %>
  124. <% if User.current.allowed_to?(:add_issue_watchers, @project) ||
  125. (@issue.watchers.present? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
  126. <div id="watchers">
  127. <%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
  128. </div>
  129. <% end %>
  130. <% end %>
  131. <% content_for :header_tags do %>
  132. <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
  133. <% end %>
  134. <%= context_menu issues_context_menu_path %>