% chapter_id = "chapter-#{chapter.position.to_s}" %>
<%= ts("This chapter is a draft and hasn't been posted yet!") %>
<% end %> <% if chapter.user_has_creator_invite?(current_user) %><%= ts("You've been invited to become a co-creator of this chapter. To accept or reject the request, visit your %{creator_requests_page}.", creator_requests_page: link_to(ts("Co-Creator Requests page"), user_creatorships_path(current_user))).html_safe %>
<% end %> <% if logged_in? && is_author_of?(@work) && !@preview_mode%> <%= render "chapters/chapter_management", chapter: chapter, work: @work %> <% end %> <%# Both Entire Work and Chapter by Chapter mode write to and read from this cache. Only content needed for both modes should be included here. %> <% cache_if(!@preview_mode, "#{@work.cache_key}/#{chapter.cache_key}-show-v7", skip_digest: true) do %><%=raw sanitize_field(chapter, :summary) %>
(<%= ts("See the end of the chapter for ") %> <%= link_to(h(ts("notes")), "#chapter_#{chapter.position.to_s}_endnotes") %>.)
<% else %><%=raw sanitize_field(chapter, :notes) %><% unless chapter.endnotes.blank? %>
(<%= ts("See the end of the chapter for ") %> <%= link_to(h(ts("more notes")), "#chapter_#{chapter.position.to_s}_endnotes") %>.)
<% end %> <% end %><%=raw sanitize_field(chapter, :endnotes) %>