<% content_list.each.with_index do |content, i| %> <% content_image = @random_image_including_private_pool_cache.fetch([content.page_type, content.id], []) .sample .try(:src, :medium) if @saved_basil_commissions content_image ||= @saved_basil_commissions.fetch([content.page_type, content.id], []) .sample .try(:image) .try(:url) end content_image ||= asset_path("card-headers/#{content.page_type.downcase.pluralize}.jpg") %>
<%= render partial: 'content/display/favorite_control', locals: { content: content } %>
<%= ContentFormatterService.show(text: content.name.presence || 'Untitled', viewing_user: current_user) %>
<% if content.respond_to?(:page_tags) %>

<% content.page_tags.each do |tag| %> <% if user_signed_in? && content.user == current_user %> <%= link_to params.permit(:tag).merge({ tag: PageTagService.slug_for(tag.tag) }) do %> <% end %> <% else %> <% end %> <% end %>

<% end %>
<% if user_signed_in? %>
<% if current_user.can_update?(content) %> <%= link_to content.is_a?(ContentPage) ? content.edit_path : edit_polymorphic_path(content), class: 'green-text right', target: content.is_a?(Document) ? '_new' : '_self' do %> <%= content_type.icon %> Edit <% end %> <% end %> <% if current_user.can_read?(content) %> <%= link_to content.is_a?(ContentPage) ? content.view_path : content, class: 'blue-text text-lighten-1' do %> <%= content_type.icon %> View <% end %> <% end %>
<% end %>
<%= content.name.presence || 'Document preview' %> close <% if content.is_a?(Document) || (content.description.try(:length) || 0 > 140) %> <% if content.is_a?(Document) %>

<%= content.reading_estimate %>

<% end %>

<%= sanitize ContentFormatterService.show(text: truncate(content.description, length: 420, escape: false), viewing_user: current_user) %>

<% end %> <% if content.respond_to?(:page_tags) %>

<% content.page_tags.each do |tag| %> <% if user_signed_in? && content.user == current_user %> <%= link_to params.permit(:tag).merge({ tag: PageTagService.slug_for(tag.tag) }) do %> <% end %> <% else %> <% end %> <% end %>

<% end %>

<%= content.created_at == content.updated_at ? 'created' : 'last updated' %> <%= time_ago_in_words content.updated_at %> ago

<% end %> <% if local_assigns.fetch(:show_new_button, true) %> <% if current_user.can_create?(content_type) %>
<%= link_to new_polymorphic_path(content_type), class: 'white-text' do %>

add

New
<%= content_type.name %>
<% end %>
<% else %>

<%= content_type.icon %>

An active <%= link_to 'Notebook.ai Premium', subscription_path, class: 'blue-text text-darken-2' %> subscription is required to create additional <%= content_type.name.downcase %> pages, but pages you've already created will always be available here.

<% end %> <% end %> <% if local_assigns.fetch(:show_template_editor_form, false) %>
<%= link_to attribute_customization_path(content_type: content_type.name.downcase), class: 'white-text' do %>

<%= content_type.icon %>

Customize
template
<% end %>
<% end %>