<div style="padding: 35px 20px;">
  <%= render 'content/form/errors', content: @content %>

  <%# Content panels %>
  <%
    categories = if content.is_a?(ContentSerializer)
      content.data[:categories]
    else
      raise [@content.class.name, @content.id, @content.errors.messages] if !@content.valid? && @serialized_categories_and_fields == nil

      @serialized_categories_and_fields.data
    end
  %>
  <% categories.each do |category| %>
    <%= render 'content/form/panel', category: category, f: f, content: content %>
  <% end %>
</div>

<div class="card-action center grey-text">
  Tip: You don't need to save before changing categories (on the right). Just remember to save when you're done!
</div>