<% set_meta_tags title: @content.name, description: @content.description %>

<div class="row">
  <div class="col s9">
    <div class="hoverable card">
      <div class="card-image">
        <%= render partial: 'content/display/image_card_header' %>
        <%= render partial: 'content/display/floating_action_buttons', locals: { editing: false } %>
      </div>

      <div class="card-content">
        <% @serialized_content.data[:categories].each do |serialized_category| %>
          <%=
            render partial: 'content/display/category_panel',
              locals: {
                content: @serialized_content,
                category: serialized_category
              }
          %>
        <% end %>
        <%= render partial: 'content/panels/documents', locals: { content: content } if @serialized_content.documents.any? %>
      </div>

      <%= render partial: 'content/display/visitor_cta', locals: { content: @serialized_content } %>
    </div>

  </div>

  <div class="col s3">
    <%= render partial: 'content/display/sidelinks', locals: { content: @serialized_content } %>

    <% if user_signed_in? && current_user.can_create?(@serialized_content.raw_model.class) %>
      <%= link_to new_polymorphic_path(@serialized_content.raw_model.class) do %>
        <div class="<%= @serialized_content.class_color %> card">
          <div class="card-content white-text">
            <i class="right material-icons">arrow_forward</i>
            Create another <%= @serialized_content.class_name.downcase %>
          </div>
        </div>
      <% end %>
    <% end %>
  </div>
</div>

<%= render partial: 'content/share', locals: { shared_content: @content} %>

<div class="row">
  <% if @content.is_a?(Universe) %>
    <%= render partial: 'content/contexts/universe', locals: { content: @content } %>
  <% else %>
    <%= render partial: "content/contexts/dynamic", locals: { content: @content } %>
  <% end %>
</div>
