Commit 8a613590 authored by Thomas THIMOTHEE's avatar Thomas THIMOTHEE

Add info to csv

parent 2c82552c
......@@ -7,7 +7,7 @@ ActiveAdmin.register Student do
controller do
def scoped_collection
super.includes(:program)
super.includes(:program, courses: :sport)
end
end
......@@ -82,8 +82,23 @@ ActiveAdmin.register Student do
xls(i18n_scope: [:activerecord, :attributes, :student],
header_format: { weight: :bold, color: :blue }) do
delete_columns :encrypted_password, :reset_password_token,
:reset_password_sent_at, :remember_created_at, :code, :created_at, :updated_at,
:current_sign_in_at, :current_sign_in_ip, :last_sign_in_at, :last_sign_in_ip,
:confirmed_at, :confirmation_token, :confirmation_sent_at, :unconfirmed_email
:reset_password_sent_at, :remember_created_at, :code, :created_at, :updated_at,
:current_sign_in_at, :current_sign_in_ip, :last_sign_in_at, :last_sign_in_ip,
:confirmed_at, :confirmation_token, :confirmation_sent_at, :unconfirmed_email
column :program do |student|
student.program.name
end
column('sport_1') do |student|
student.courses.first&.sport&.name
end
column('creneau_1') do |student|
student.courses.first&.day_and_time
end
column('sport_2') do |student|
student.courses.second&.sport&.name
end
column('creneau_2') do |student|
student.courses.second&.day_and_time
end
end
end
......@@ -10,6 +10,7 @@ fr:
subscriptions_limit: Nombre d'inscriptions max par élève
course: Cours de sport
teacher: Enseignant
phone_number: Téléphone
campus: Campus
sport: Sport
student: Étudiant
......@@ -69,6 +70,11 @@ fr:
female: Femme
firstname: Prénom
lastname: Nom
phone_number: Téléphone
creneau_1: Créneau 1
creneau_2: Créneau 2
sport_1: Sport 1
sport_2: Sport 2
number_of_courses: Nb cours
program: Formation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment