<!--Descriptive page name, messages and instructions-->
<h2 class="heading"><%= ts('Edit Work') %></h2>

<%= error_messages_for :work %>
<!--/descriptions-->

<!--subnav-->
<ul class="navigation actions" role="menu">
	<li><%= link_to ts('Add Chapter'), new_work_chapter_path(@work) %></li>
  <% if @chapters %>
    <li><%= ts('Edit Chapter:') %>
      <% for chapter in @chapters %>
        <% if chapter.posted? %>
          <%= link_to h(chapter.position), [:edit, @work, chapter] %>
        <% else %>
            <%= link_to h(chapter.position) + ts(" (Draft)"), [:edit, @work, chapter] %>
	<% end %>
      <% end %></li>
    <li><%= link_to ts('Manage Chapters'), manage_work_chapters_path(@work) %></li>
  <% end %>
  <% unless (@work.pseuds - current_user.pseuds).empty? %>
    <li><%= link_to ts("Remove Me As Co-Creator"), { :action => "edit", :remove => "me"}, data: { confirm: "This will remove you from all chapters as well. Are you sure?" } %></li>
  <% end %>
  <% if @work.posted? %>
    <li><%= link_to ts('Orphan Work'), {:controller => 'orphans', :action => 'new', :work_id => @work.id} %></li>
  <% end %>
  <li><%= link_to ts("Delete Work"), confirm_delete_work_path(@work), data: {confirm: ts("Are you sure you want to delete this work? This will destroy all comments and kudos on this work as well and CANNOT BE UNDONE!")} %></li>
</ul>
<!--/subnav-->

<!--main content-->
<%= render :partial => 'standard_form' %>
<!--/content-->
