<%= render(file: File.join(EasyExtensions::EASY_EXTENSIONS_DIR, 'app/views', 'issues/show.html.erb')) %>
<% content_for :easy_page_layout_service_box, {flush: true} do %>
  <!--override by easy_project_com-->
  <%= call_hook(:view_issue_sidebar_top, :issue => @issue) %>

  <div class="easy-entity-details-sidebar-attributes multieditable-container" data-entity-type="Issue" data-entity-id="<%= @issue.id %>" data-url="<%= url_to_entity(@issue, :format => 'json') %>">
    <% if @issue.project.module_enabled?(:time_tracking) && User.current.allowed_to?(:view_time_entries, @issue.project) -%>
      <table class="highlight">
        <% if @issue.estimated_hours.to_f > 0 %>
          <tr>
            <td class="bigger estimated-time<%= ' color-positive' if @issue.total_spent_hours < @issue.estimated_hours.to_f %><%= ' color-negative' if @issue.total_spent_hours > @issue.estimated_hours.to_f %>">
              <%= format_locale_number(@issue.total_spent_estimated_timeentries, :precision => 0, :percentage => true) -%></td>
            <th class="highlight-desc">
              <label><%= l(:label_spent_to_estimated_time_ratio) %></label>
            </th>
          </tr>
        <% end %>
        <tr>
          <td class="big spent-time"><%= easy_link_to_spent_hours(@issue, @issue.total_spent_hours, {:format => 'simple'}) -%></td>
          <th class="highlight-desc">
            <label><%= l(:label_spent_time_total) %></label>
            <%#= easy_issue_timer_button(@issue) %>
          </th>
        </tr>
        <tr>
          <td class="progress"><%= progress_bar(@issue.done_ratio, :legend => "#{@issue.done_ratio}%", :width => '100%') unless @issue.disabled_core_fields.include?('done_ratio') %></td>
          <th><%= content_tag :label, "#{l(:label_progress)}" -%></th>
        </tr>
      </table>
    <% end -%>
  </div>

  <%= call_hook(:view_issue_sidebar_under_issue_info, :issue => @issue) %>
  <%= render :partial => 'sidebar/issue_info', :locals => {:issue => @issue} %>
<% end %>
<% content_for :easy_page_layout_service_box_primary_actions, {flush: true} do %>
    <!--override by easy_project_com-->
    <%= link_to_function(l(:button_update), "show_update(this)", {
        :class => "icon icon-edit #{params[:dd].blank? ? 'button-positive' : 'button'}",
        :accesskey => accesskey(:issue_edit),
        :title => l(:sidebar_issue_button_update)
    }) if @issue.editable? %>
    <%= ep_com_easy_issue_timer_button(@issue) %>
<% end %>