noesya/osuny

View on GitHub
app/views/admin/administration/locations/_form.html.erb

Summary

Maintainability
Test Coverage
<%= simple_form_for [:admin, location] do |f| %>
  <%= f.simple_fields_for :localizations, l10n do |lf| %>
    <%= f.error_notification %>
    <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
    <%= lf.hidden_field :language_id, value: current_language.id %>

    <div class="row mb-5">
      <div class="col-lg-4">
        <%= render 'admin/application/featured_image/edit', f: lf, about: l10n %>
        <%= render  "admin/application/slug/form",
                    f: lf,
                    source: '#administration_location_localizations_attributes_0_name' %>
      </div>
      <div class="col-lg-8">
        <%= lf.input :name %>
        <%= render 'admin/application/summary/form', f: lf, about: l10n %>
        <%= lf.input :address_name %>
        <%= f.input :address %>
        <%= lf.input :address_additional %>
        <div class="row">
          <div class="col-lg-4">
            <%= f.input :zipcode %>
          </div>
          <div class="col-lg-8">
            <%= f.input :city %>
          </div>
        </div>
        <%= f.input :country, input_html: { class: 'form-select' } %>
        <%= f.input :phone %>
        <%= lf.input :url %>
        <%= f.association :programs,
                          as: :check_boxes,
                          collection: osuny_collection_tree(
                                        current_university.education_programs.root,
                                        localized: true
                                      ) %>
        <%= f.association :schools,
                          as: :check_boxes,
                          collection: osuny_collection(current_university.education_schools, localized: true) %>
      </div>
    </div>
    <% content_for :action_bar_right do %>
      <%= submit f %>
    <% end %>
  <% end %>
<% end %>