You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 line
1.2 KiB

  1. <p id="notice"><%= notice %></p>
  2. <p>
  3. <strong>Name:</strong>
  4. <%= @document.name %>
  5. </p>
  6. <p>
  7. <strong>Category:</strong>
  8. <%= @document.category.get_fqcn %>
  9. </p>
  10. <% if @document.content.page_previews.any? %>
  11. <% @document.content.page_previews.each do |page_preview| %>
  12. <%= link_to image_tag(page_preview.preview.url, alt: 'Page #' + page_preview.pagenumber.to_s), @document.doc.url + '#page=' + page_preview.pagenumber.to_s %>
  13. <% end %>
  14. <% elsif File.exists?(@document.doc.path(:thumb)) %>
  15. <p>
  16. <%= link_to image_tag(@document.doc.url(:thumb), alt: 'Thumbnail of PDF'), @document.doc.url %>
  17. </p>
  18. <% else %>
  19. <p>
  20. <%= link_to @document.doc_file_name, @document.doc.url %>
  21. </p>
  22. <% end %>
  23. <% if @document.content %>
  24. <p>
  25. <strong>Pagecount:</strong>
  26. <%= @document.content.pagecount %>
  27. </p>
  28. <p>
  29. <strong>Content:</strong>
  30. <%= @document.content.text.truncate_words(30) %>
  31. </p>
  32. <p>
  33. <strong>Words (length > 3):</strong>
  34. <%= @document.content.text.squish.split(/\s+/).uniq.delete_if { |w| w.length <= 3 } %>
  35. </p>
  36. <% end %>
  37. <%= link_to 'Edit', edit_document_path(@document) %> |
  38. <%= link_to 'Destroy', @document, method: :delete, data: { confirm: 'Are you sure?' } %> |
  39. <%= link_to 'Back', documents_path %>