|
- <p id="notice"><%= notice %></p>
-
- <p>
- <strong>Name:</strong>
- <%= @document.name %>
- </p>
-
- <p>
- <strong>Category:</strong>
- <%= @document.category.get_fqcn %>
- </p>
-
- <% if @document.content.page_previews.any? %>
- <% @document.content.page_previews.each do |page_preview| %>
- <%= link_to image_tag(page_preview.preview.url, alt: 'Page #' + page_preview.pagenumber.to_s), @document.doc.url + '#page=' + page_preview.pagenumber.to_s %>
- <% end %>
- <% elsif File.exists?(@document.doc.path(:thumb)) %>
- <p>
- <%= link_to image_tag(@document.doc.url(:thumb), alt: 'Thumbnail of PDF'), @document.doc.url %>
- </p>
- <% else %>
- <p>
- <%= link_to @document.doc_file_name, @document.doc.url %>
- </p>
- <% end %>
-
- <% if @document.content %>
- <p>
- <strong>Pagecount:</strong>
- <%= @document.content.pagecount %>
- </p>
- <p>
- <strong>Content:</strong>
- <%= @document.content.text.truncate_words(30) %>
- </p>
- <p>
- <strong>Words (length > 3):</strong>
- <%= @document.content.text.squish.split(/\s+/).uniq.delete_if { |w| w.length <= 3 } %>
- </p>
- <% end %>
-
-
- <%= link_to 'Edit', edit_document_path(@document) %> |
- <%= link_to 'Destroy', @document, method: :delete, data: { confirm: 'Are you sure?' } %> |
- <%= link_to 'Back', documents_path %>
|