<%= render "shared/globalize_locales", resource: card %>

<%= translatable_form_for [namespace.to_sym, card.cardable, card], url: local_assigns[:url] do |f| %>
  <%= render "shared/errors", resource: card %>

  <div class="row">
    <%= f.translatable_fields do |translations_form| %>
      <div class="small-12 medium-6 column end">
        <%= translations_form.text_field :label %>
      </div>

      <div class="column">
        <%= translations_form.text_field :title %>
      </div>

      <div class="column">
        <%= translations_form.text_area :description, rows: 5 %>
      </div>

      <div class="small-12 medium-6 column end">
        <%= translations_form.text_field :link_text %>
      </div>
    <% end %>
  </div>

  <div class="row">
    <div class="small-12 medium-6 column">
      <%= f.text_field :link_url %>
    </div>
  </div>

  <div class="row">
    <% unless card.header_or_sdg_header? %>
      <div class="small-12 medium-6 column">
        <%= f.select :columns, (1..12), hint: t("admin.site_customization.pages.cards.columns_help") %>
      </div>

      <div class="small-12 medium-6 column">
        <%= f.number_field :order, min: 1, hint: t("admin.site_customization.pages.cards.order_help") %>
      </div>
    <% end %>
  </div>

  <%= f.hidden_field :header, value: card.header? %>
  <div class="row">
    <div class="image-form">
      <div class="image small-12 column">
        <%= render Images::NestedComponent.new(f) %>
      </div>
    </div>
    <div class="column">
      <%= f.submit(
        t("admin.homepage.#{admin_submit_action(card)}.#{card.header_or_sdg_header? ? "submit_header" : "submit_card"}"),
        class: "button success"
      ) %>
    </div>
  </div>
<% end %>
