<% unless @preview_mode %>
  <%= render "works/work_header_navigation" %>
<% end %>

<%= render "works/meta", work: @work %>

<% if @work.work_skin && !Preference.disable_work_skin?(params[:style]) %>
  <% cache("#{@work.work_skin.id}-#{@work.work_skin.updated_at}-work-skin", skip_digest: true) do %>
    <%= render "skins/skin_style_block", skin: @work.work_skin %>
  <% end %><!-- end cache for work skin -->
<% end %>

<!-- BEGIN section where work skin applies -->
<div id="workskin">
  <div class="preface group">
    <h2 class="title heading">
      <% if @work.restricted %>
        <%= image_tag("lockblue.png", size: "15x15",
                                     alt: ts("(Restricted)"),
                                     title: ts("Restricted"),
                                     skip_pipeline: true) %>
      <% end %>
      <% if @work.hidden_by_admin %>
        <%= image_tag("lockred.png", size: "15x15",
                                     alt: ts("(Hidden by Admin)"),
                                     title: ts("Hidden by Administrator"),
                                     skip_pipeline: true) %>
      <% end %>
      <%= @work.title %>
    </h2>
    <h3 class="byline heading">
      <%= byline(@work).html_safe %>
    </h3>

    <% if @chapter == @work.first_chapter %>

      <% unless @work.summary.blank? %>
        <div class="summary module">
          <h3 class="heading"><%= ts("Summary:") %></h3>
          <% unless @work.summary.blank? %>
            <blockquote class="userstuff">
              <%=raw sanitize_field(@work, :summary) %>
            </blockquote>
          <% end %>
        </div>
      <% end %>

      <% if show_work_notes?(@work) %>
        <%= render "works/work_header_notes" %>
      <% end %>

    <% end %>
  </div>

  <% # NOTE: the div id="workskin" is DELIBERATELY not closed in this file! %>
