<% if @content.present? && @content.respond_to?(:as_jsonld) %> <% end %> <% set_meta_tags title: content.name, description: content.description %> <%# TODO: Check if /_meta exists and render it here if so %> <% content_for :sidebar_top do %> <%= render partial: 'cards/serendipitous/content_question', locals: { question: @question, content: @content } %> <% end %> <% categories = content.class.attribute_categories(current_user) %>
<%= link_to polymorphic_path(content.class) do %> <%= content.class.icon %> <% end %> <%= content.respond_to?(:label) ? content.label : content.name %>
    <% categories.each do |category| %> <%= attribute_category_tab(content, category) %> <% end %>
<% markdown = Redcarpet::Markdown.new( Redcarpet::Render::HTML.new( with_toc_data: true, safe_links_only: true, filter_html: true, link_attributes: {target: '_blank'} ), autolink: true, tables: true, strikethrough: true, superscript: true, underline: true, highlight: true, footnotes: true, ) %> <% categories.each do |category| %>
_panel" class="row"> <% category.attribute_fields.each do |attribute| %> <% next if attribute.name.start_with?("private") && @content.user != current_user %> <% value = nil if content.respond_to?(attribute.name.to_sym) value = content.send(attribute.name.to_sym) else value = Attribute.where(user: current_user, attribute_field: attribute, entity: content).first end %> <% next if value.blank? %>
<%= attribute.label %>
<% if value.is_a?(ActiveRecord::Associations::CollectionProxy) %> <% klass = value.first.class || value.build.class %>
<% value.each do |li| %>
<%= link_to li do %> <%= klass.icon %> <%= li.name %> <% end %>
<% end %>
<% elsif attribute.name == 'attribute_category_id' %>
<%= link_to content.attribute_category.label, content.attribute_category if content.attribute_category %>
<% elsif attribute.name == 'universe_id' %>
<%= link_to content.universe.name, content.universe if content.universe %>
<% else %> <%# TODO: if text is > 240, truncate and add "Read more" link that opens modal %>
140 %> markdownable"> <%= markdown.render(value.is_a?(Attribute) ? value.value : value).html_safe %> 
<% end %>
<% end %>
<% end %>
<%= yield :content_show_footer %> <% if current_user == content.user %> <%= link_to "Edit this #{content.class.to_s.downcase}", edit_polymorphic_path(@content), class: "btn #{content.class.color}" %> <% elsif content.user.name.present? %> <%= content.user.name %> created and maintains this universe on Notebook.ai.
<%= link_to "See more from #{content.user.name}", content.user %> <%= link_to "Create your own universe.", root_url %> <% end %>
<%= render partial: 'content/share', locals: { shared_content: @content} %> <%# TODO: not this %> <% if @content.is_a? Universe %>
<%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: :character, content_list: @content.characters } %>
<%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: :location, content_list: @content.locations } %>
<%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: :item, content_list: @content.items } %>
<% end %>