noesya/osuny

View on GitHub
app/views/admin/research/journals/volumes/_form.html.erb

Summary

Maintainability
Test Coverage
<%= simple_form_for [:admin, volume] 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">
      <div class="col-xl-8">
        <%= osuny_panel t('content') do %>
          <%= lf.input :title %>
          <%= render 'admin/application/summary/form', f: lf, about: l10n %>
          <%= lf.input :text, as: :summernote %>
        <% end %>
        <%= render 'admin/application/meta_description/form', f: lf, about: l10n %>
      </div>
      <div class="col-xl-4">
        <%= osuny_panel t('metadata') do %>
          <%= render  "admin/application/slug/form",
                      f: lf,
                      source: '#research_journal_volume_localizations_attributes_0_title' %>
          <%= f.input :number %>
          <%= lf.input :published %>
          <%= lf.input :published_at, html5: true, as: :date %>
          <%= lf.input :keywords %>
        <% end %>
        <%= render 'admin/application/featured_image/edit', f: lf, about: l10n %>
      </div>
    </div>
    <% content_for :action_bar_right do %>
      <%= submit f %>
    <% end %>
  <% end %>
<% end %>