- |
- <%= Document.icon %>
- |
-
-
+<% if content_list.any? %>
+
+
+
+ |
+ Title |
+ Length |
+ Last edited |
+
+
+ <% content_list.each do |document| %>
+
+ |
+ <%= Document.icon %>
+ |
+
- <% if user_signed_in? && document.user == current_user %>
-
- <%= document.favorite? ? 'star' : 'star_border' %>
-
- <% else %>
- folder_shared
+
+ <% if user_signed_in? && document.user == current_user %>
+
+ <%= document.favorite? ? 'star' : 'star_border' %>
+
+ <% else %>
+ folder_shared
+ <% end %>
+
+
+ <%= document.title %>
+
+
+
+ <%= link_to document.user, class: "#{User.color}-text" do %>
+ <%= User.icon %>
+ by <%= document.user.display_name %>
+ <% end %>
+
+ <% if document.universe %>
+
+ <%= link_to document.universe, class: "#{Universe.color}-text" do %>
+ <%= Universe.icon %>
+ in <%= document.universe.try(:name) || 'Unknown universe' %>
+ <% end %>
+
<% end %>
-
-
- <%= document.title %>
-
+ <% if document.respond_to?(:page_tags) %>
+
+ <% document.page_tags.each do |tag| %>
+ <% if user_signed_in? && document.user == current_user %>
+ <%=
+ link_to send(
+ "page_tag_documents_path",
+ slug: PageTagService.slug_for(tag.tag)
+ ) do
+ %>
+
+ <% end %>
+ <% else %>
+
+ <% end %>
+ <% end %>
+
+ <% end %>
+ |
+
+
+ text_snippet
+ <%= pluralize document.word_count, 'word' %>
+
+
+ timer
+ <%= document.reading_estimate %>
+
+ |
+
+ ">
+ <%= document.updated_at == document.created_at ? 'created' : 'updated' %>
+ <%= time_ago_in_words document.updated_at %> ago
+
+ |
+
+ <% end %>
+
+
+ <%# Build info modals %>
+ <% content_list.each do |document| %>
+ |
-
-
- text_snippet
- <%= pluralize document.word_count, 'word' %>
-
-
- timer
- <%= document.reading_estimate %>
-
- |
-
- ">
- <%= document.updated_at == document.created_at ? 'created' : 'updated' %>
- <%= time_ago_in_words document.updated_at %> ago
-
- |
-
- <% end %>
-