- content_for :title do
Importer des membres
= form_tag import_admin_users_path, multipart: true, class: 'form-horizontal' do
- if @invalid_file
.alert.alert-danger
Le fichier transmis ne contenait pas d'e-mails en 2ème colonne. Veuillez réessayer avec un fichier conforme.
- elsif @imported_count || @already_existing_count || @not_imported
%blockquote
%p Le fichier a bien été importé.
%ul
- if @imported_count > 0
%li #{@imported_count} membres ont été créés.
- if @already_existing_count > 0
%li #{@already_existing_count} membres étaient déjà présents dans la base.
- if @not_imported.any?
%li
#{@not_imported.count} membres n'ont pas été importés.
= link_to '#', data: {toggle: 'collapse', target: '#not_imported'} do
Détail
%i.fa.fa-chevron-down
.collapse#not_imported
- @not_imported.each do |row|
.well.well-sm= row.join(' | ')
.form-group
= file_field_tag :file
%p.help-block Sélectionnez un fichier CSV contenant trois colonnes (nom d'utilisateur, e-mail et langue par défaut (fr/en)) et pas de ligne de titre.
%span.help-block.with-errors
.form-group
= label_tag do
Groupes
%small
%span.text-muted –
= link_to 'Tous', '#', id: 'check-all'
%span.text-muted –
= link_to 'Aucun', '#', id: 'check-none'
%p.help-block Sélectionnez les groupes auxquels appartiendront les membres qui seront importés.
.row
- Group.all.each do |group|
.col-sm-3
= label_tag nil, class: 'checkbox-inline' do
= check_box_tag "group_ids[]", group.id
= group.name
%span.help-block.with-errors
.form-group
= submit_tag t('links.submit'), class: 'btn btn-primary'
= link_to t('links.cancel'), admin_users_path, class: 'btn btn-default'