<%# Usage: render partial: 'content/list/document_table', locals: { content_list: @documents, content_type: Document, folders: @folders.pluck(:title, :id), tags: PageTag.where(page_type: 'Document', page_id: @documents.pluck(:id)).to_a } %> <% if content_list.any? %>
<% content_list.each do |document| %> <% end %>
Title Length Last edited
<%= link_to 'View', document_path(document), class: "btn btn-flat blue-text" %>
<%= link_to 'Edit', edit_document_path(document), class: "btn btn-flat green-text", target: '_new' %>
<%# Build info modals %> <% content_list.each do |document| %> <% end %>
Statistics
  • <%= Document.icon %> <%= number_with_delimiter content_list.count %> <%= 'document'.pluralize(content_list.count) %>
  • <% total_word_count = content_list.sum { |doc| doc.cached_word_count || 0 } %> spellcheck totalling <%= number_with_delimiter total_word_count %> <%= 'word'.pluralize(total_word_count) %>
  • <% if tags.any? %>

  • Tags
    <% tags.each do |tag| %> <%= link_to params.permit(:tag).merge({ tag: tag.slug }) do %> <% end %> <% end %>
  • <% end %> <% universes = Universe.where(id: content_list.pluck(:universe_id)) %> <% if universes.any? %>

  • Universes
    <% universes.each do |universe| %> <%= link_to universe do %> <% end %> <% end %>
  • <% end %> <% authors = User.where(id: content_list.pluck(:user_id)) %> <% if authors.count > 1 %>

  • Authors
    <% User.where(id: content_list.pluck(:user_id)).each do |user| %> <%= link_to user do %> <% end %> <% end %>
  • <% end %>
<%= link_to data_documents_path do %>
lock See more statistics in your Data Vault
<% end %> <%= link_to '#new-folder-modal', class: "#{Folder.color} modal-trigger" do %>
<%= Folder.icon %> Create a document folder
<% end %>
<% else %>

You haven't created any documents <% if @universe_scope %>in the <%= link_to @universe_scope.name, @universe_scope, class: Universe.color + "-text" %> universe<% end %> <% if @folder %>in this folder<% end %> yet!

<%= Document.icon %>

You can create an unlimited number of documents with no limits on length. Enjoy!


<%= link_to "Create your first document", new_document_path({folder: @folder.try(:id)}), target: '_blank', class: "btn #{Document.color}" %>
<% end %>