Files
nairobi/app/views/admin/milestones/_form.html.erb
Javi Martín 1e1d7996bb Simplify rendering document/image fields
We were adding <div> tags with the `images` or `documents` HTML class
prettly much every time we rendered a NestedComponent. We're now
including the HTML class inside the component, as we usually do.

We're also rendering the nested components directly, since it's been a
while since the partials were changed to simply render the components.
2023-10-23 15:49:01 +02:00

37 lines
1.3 KiB
Plaintext

<%= render "shared/globalize_locales", resource: @milestone %>
<%= translatable_form_for @milestone, url: admin_polymorphic_path(@milestone) do |f| %>
<div class="row">
<div class="small-12 medium-6 margin-bottom column">
<%= f.select :status_id,
@statuses.map { |s| [s.name, s.id] },
{ include_blank: @statuses.any? ? "" : t("admin.milestones.form.no_statuses_defined") },
{ disabled: @statuses.blank? } %>
<%= link_to t("admin.milestones.form.admin_statuses"),
admin_milestone_statuses_path %>
</div>
</div>
<div class="row">
<%= f.translatable_fields do |translations_form| %>
<div class="column">
<%= translations_form.hidden_field :title, value: l(Time.current, format: :datetime),
maxlength: Milestone.title_max_length %>
<%= translations_form.text_area :description, rows: 5 %>
</div>
<% end %>
</div>
<div class="row">
<div class="column">
<%= f.date_field :publication_date %>
<%= render Images::NestedComponent.new(f) %>
<%= render Documents::NestedComponent.new(f) %>
<%= f.submit nil, class: "button success" %>
</div>
</div>
<% end %>