noesya/osuny

View on GitHub
app/views/admin/administration/alumni/cohorts/imports/new.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, Import.model_name.human %>

<div class="row">
  <div class="col-md-6">
    <p>
      <%= t('imports.hint_html') %>
      <br>
      <%= t('university.person.import_hint_html') %>
      <br>
      <%= t('university.alumni.cohorts.import_hint_html') %>
    </p>
    <%= simple_form_for @import,
                        url: admin_administration_alumni_cohorts_imports_path do |f| %>

      <%= f.error_notification %>
      <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>

      <%# as file can be empty the global object can be unset. To prevent crash in controller add an (unused) hidden field %>
      <%= f.input :id, as: :hidden %>

      <%= f.input :file %>

      <% content_for :action_bar_right do %>
        <%= submit f %>
      <% end %>

      <small>
        <%= t('imports.example_file_html', link: asset_url('alumni-example.xlsx')) %>
      </small>
    <% end %>

  </div>
  <div class="col-md-6">
    <div class="table-responsive">
      <table class="<%= table_classes(with_actions: false) %>">
        <tbody>
          <%= render 'admin/university/people/imports/base_infos' %>
          <tr>
            <th>school*</th>
            <td>af96c31c-2e6b-4485-b88f-e28843480e3f</td>
          </tr>
          <tr>
            <th>program*</th>
            <td>c6b78fac-0a5f-4c44-ad22-4ee68ed382bb</td>
          </tr>
          <tr>
            <th>year*</th>
            <td>2022</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>