noesya/osuny

View on GitHub
app/views/admin/university/people/experiences/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.person.experiences.import_hint_html') %>
    </p>
    <%= simple_form_for @import,
                        url: admin_university_people_experiences_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('experiences-example.xlsx')) %>
      </small>
    <% end %>

  </div>
  <div class="col-md-6">
    <div class="table-responsive">
      <table class="<%= table_classes %>">
        <tbody>
          <%= render 'admin/university/people/imports/base_infos' %>
          <tr>
            <th>company_name*</th>
            <td>Le Monde</td>
          </tr>
          <tr>
            <th>company_siren</th>
            <td>433891850</td>
          </tr>
          <tr>
            <th>company_nic</th>
            <td>00052</td>
          </tr>
          <tr>
            <th>experience_job*</th>
            <td>Journaliste</td>
          </tr>
          <tr>
            <th>experience_from*</th>
            <td>2018</td>
          </tr>
          <tr>
            <th>experience_to</th>
            <td>2021</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>