We didn't add any validation rules to the card model. At the very least, the title should be mandatory. The fact that the label field is marked as optional in the form but the other fields are not probably means description and link should be mandatory as well. However, since there might be institutions using cards with descriptions but no link or cards with links but no description, so we're keeping these fields optional for compatibility reasons. We might change our minds in the future, though.
60 lines
1.7 KiB
Plaintext
60 lines
1.7 KiB
Plaintext
<%= render "shared/globalize_locales", resource: @card %>
|
|
|
|
<%= translatable_form_for [:admin, @card] 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? %>
|
|
<div class="column">
|
|
<%= f.label :columns %>
|
|
<p class="help-text"><%= t("admin.site_customization.pages.cards.columns_help") %></p>
|
|
<div class="small-12 medium-4 large-2">
|
|
<%= f.select :columns, (1..12), label: false %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%= f.hidden_field :header, value: @card.header? %>
|
|
<%= f.hidden_field :site_customization_page_id, value: @card.site_customization_page_id %>
|
|
<div class="row">
|
|
<div class="image-form">
|
|
<div class="image small-12 column">
|
|
<%= render "images/nested_image", imageable: @card, f: f %>
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<%= f.submit(
|
|
t("admin.homepage.#{admin_submit_action(@card)}.#{@card.header? ? "submit_header" : "submit_card"}"),
|
|
class: "button success"
|
|
) %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|