<div class="hidden-print">
<%= link_to "Back to parent" , @document.parent, class: "btn" %>
<div class="btn-group">
<%= link_to fa_icon('file-pdf-o')+" PDF", document_path(@document, :format=>"pdf"),class: "btn" %>
<%= link_to "sanitize", sanitize_document_path(@document),class: "btn" if can? :sanitize, @document %>

<%= link_to ff_icon("icon-pencil") + " Edit", write_document_path(@document), class: "btn" %>
<%= link_to ff_icon("icon-refresh")+" Refresh from Etherpad", read_from_etherpad_document_path(@document), class: "btn" if @document.is_etherpad? %>
<%= link_to "Copy Document to Etherpad", dump_to_etherpad_document_path(@document)  , confirm: "Sicher? Löscht alle Änderungen im Etherpad" , class: "btn" %>
  <%= link_to 'Delete', @document, method: :delete, data: { confirm: 'Are you sure?' } , remote: true, class: "btn btn-danger" if can? :delete, @document %>

</div>
</div>
<%= raw(@document.toc) %>
<div style="background:white; border: thin #ccc solid; padding: 15px;-webkit-box-shadow: 10px 10px 10px 0px rgba(0,0,0,0.5); -moz-box-shadow: 10px 10px 10px 0px rgba(0,0,0,0.5); box-shadow: 10px 10px 10px 0px rgba(0,0,0,0.5);">
  <h1><%= @document.name %></h1>
  <div>
    <%= raw(@document.text) %>
  </div>
</div>
<% if can?(:edit, @document) %>
<ul class='breadcrumb hidden-print'>
<% @document.versions.each do |v| %>
<li>
<%= link_to User.find(v.whodunnit).name+": "+ v.event + " (" +  I18n.l(v.created_at)+ ") ", write_document_path(@document,:versionid=>v.id)  unless v.whodunnit.nil? %>
<% end %> <span class="divider">/</span></li>
</ul>
<% end %>

<div class="hidden-print">
<%= render_attachments_for(@document) %>
</div>
