<h2><%= issue_heading(@issue) %></h2>

<div class="<%= @issue.css_classes %> details">
  <%= avatar(@ticket.from_address, :size => "50") %>

<div class="subject">
<h3><%= @issue.subject %></h3>
</div>
        <p class="author">
        <%= l(:label_added_time_by, :author => mail_to(@ticket.from_address), :age => content_tag('acronym', distance_of_time_in_words(Time.now, @issue.created_on), :title => format_time(@issue.created_on))).html_safe %>.
        <%# authoring @issue.created_on, mail_to(@ticket.from_address) %>
        <% if @issue.created_on != @issue.updated_on %>
        <%= l(:label_updated_time, ticket_time_tag(@issue.updated_on)).html_safe %>.
        <% end %>
        </p>

<<%= Redmine::VERSION.to_s > '3.2' ? 'div' : 'table' %> class="attributes">
<%= issue_fields_rows do |rows|
  rows.left l(:field_status), h(@issue.status.name), :class => 'status'

  unless @issue.disabled_core_fields.include?('assigned_to_id')
    rows.left l(:field_assigned_to), (@issue.assigned_to ? @issue.assigned_to.name : "-"), :class => 'assigned-to'
  end
  unless @issue.disabled_core_fields.include?('done_ratio')
    rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%"), :class => 'progress'
  end
  if RedmineHelpdesk.public_spent_time?
    unless @issue.disabled_core_fields.include?('estimated_hours')
      if RedmineHelpdesk.public_spent_time? && !@issue.estimated_hours.blank?
        rows.right l(:field_estimated_hours), l_hours(@issue.estimated_hours), :class => 'estimated-hours'
      end
    end
    rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? l_hours(@issue.total_spent_hours) : "-"), :class => 'spent-time'
  end
end %>
<%# render_custom_fields_rows(@issue) %>
</<%= Redmine::VERSION.to_s > '3.2' ? 'div' : 'table' %>>

<% if @issue.description? || @issue.attachments.any? -%>
<hr />
<% if @issue.description? %>

  <p><strong><%=l(:field_description)%></strong></p>
  <div class="wiki">
  <%= textilizable @issue, :description, :attachments => @issue.attachments %>
  </div>
<% end %>
<% if @issue.attachments.any? %>
<fieldset class="collapsible collapsed">
  <legend onclick="toggleFieldset(this);"><%= l(:label_attachment_plural) %></legend>
  <div style="display: none;">
    <%= link_to_attachments_with_hash @issue, :thumbnails => true %>
  </div>
</fieldset>
<% end %>
<% end -%>


</div>

<% if @journals.present? %>
<div id="history" class="ticket-history">
<h3><%=l(:label_history)%></h3>
<%= render :partial => 'public_tickets/history', :locals => { :issue => @issue, :journals => @journals } %>
</div>
<% end %>

<div style="clear: both;"></div>

<% if RedmineHelpdesk.public_comments? %>
  <p><%= toggle_link l(:label_comment_add), "update", :focus => "journal_notes" %></p>
  <div id="update" style="display:none;">
  <h3><%= l(:label_comment_add) %></h3>
  <%= render :partial => 'add_comment' %>
  </div>
<% end %>

<%= render :partial => 'sidebar_content' %>

