1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

i18n statistics

This commit is contained in:
Sylvain 2016-06-28 14:07:59 +02:00
parent 9000305a11
commit 99aa8120fc
3 changed files with 81 additions and 31 deletions

View File

@ -228,4 +228,27 @@ en:
your_invoice_is_ready_html: "Your invoice #%{REFERENCE}, of %{AMOUNT} is ready. <a href='api/invoices/%{INVOICE_ID}/download' target='_blank'>Click here to download</a>."
undefined_notification:
unknown_notification: "Unknown notification"
notification_ID_wrong_type_TYPE_unknown: "Notification %{ID} wrong (type %{TYPE} unknown)"
notification_ID_wrong_type_TYPE_unknown: "Notification %{ID} wrong (type %{TYPE} unknown)"
statistics:
# statistics tools for admins
subscriptions: "Subscriptions"
machines_hours: "Machines hours"
trainings: "Trainings"
events: "Events"
registrations: "Registrations"
projects: "Projects"
users: "Users"
training_id: "Training ID"
training_date: "Training Date"
event_id: "Event ID"
event_date: "Event Date"
event_name: "Event Name"
themes: "Themes"
components: "Components"
machines: "Machines"
user_id: "User ID"
bookings: "Bookings"
hours_number: "Hours number"
tickets_number: "Tickets number"
revenue: "Revenue"

View File

@ -228,4 +228,31 @@ fr:
your_invoice_is_ready_html: "Votre facture n°%{REFERENCE}, d'un montant de %{AMOUNT}, est prête. <a href='api/invoices/%{INVOICE_ID}/download' target='_blank'>Cliquez ici pour la télécharger</a>."
undefined_notification:
unknown_notification: "Notification inconnue"
notification_ID_wrong_type_TYPE_unknown: "Notification {ID} erronée (type {TYPE} inconnu)."
notification_ID_wrong_type_TYPE_unknown: "Notification {ID} erronée (type {TYPE} inconnu)."
statistics:
# outil de statistiques pour les administrateurs
subscriptions: "Abonnements"
machines_hours: "Heures machines"
trainings: "Formations"
events: "Évènements"
registrations: "Inscriptions"
projects: "Projets"
users: "Utilisateurs"
training_id: "ID Formation"
training_date: "Date Formation"
event_id: "ID Évènement"
event_date: "Date Évènement"
event_name: "Nom Évènement"
themes: "Thèmes"
components: "Composants"
machines: "Machines"
user_id: "ID Utilisateur"
bookings: "Réservations"
hours_number: "Nombre d'heures"
tickets_number: "Nombre de places"
revenue: "Chiffre d'affaires"
course: "Stage"
workshop: "Atelier"
account_creation: "Création de compte"
project_publication: "Publication de projet"

View File

@ -2,13 +2,13 @@
if StatisticIndex.count == 0
StatisticIndex.create!([
{id:1, es_type_key:'subscription', label:'Abonnements'},
{id:2, es_type_key:'machine', label:'Heures machines'},
{id:3, es_type_key:'training', label:'Formations'},
{id:4, es_type_key:'event', label:'Ateliers/Stages'},
{id:5, es_type_key:'account', label:'Inscriptions', ca: false},
{id:6, es_type_key:'project', label:'Projets', ca: false},
{id:7, es_type_key:'user', label:'Utilisateurs', table: false, ca: false}
{id:1, es_type_key:'subscription', label:I18n.t('statistics.subscriptions')},
{id:2, es_type_key:'machine', label:I18n.t('statistics.machines_hours')},
{id:3, es_type_key:'training', label:I18n.t('statistics.trainings')},
{id:4, es_type_key:'event', label:I18n.t('statistics.events')},
{id:5, es_type_key:'account', label:I18n.t('statistics.registrations'), ca: false},
{id:6, es_type_key:'project', label:I18n.t('statistics.projects'), ca: false},
{id:7, es_type_key:'user', label:I18n.t('statistics.users'), table: false, ca: false}
])
connection = ActiveRecord::Base.connection
if connection.instance_values["config"][:adapter] == 'postgresql'
@ -19,15 +19,15 @@ end
if StatisticField.count == 0
StatisticField.create!([
# available data_types : index, number, date, text, list
{key:'trainingId', label:'ID Formation', statistic_index_id: 3, data_type: 'index'},
{key:'trainingDate', label:'Date Formation', statistic_index_id: 3, data_type: 'date'},
{key:'eventId', label:'ID Évènement', statistic_index_id: 4, data_type: 'index'},
{key:'eventDate', label:'Date Évènement', statistic_index_id: 4, data_type: 'date'},
{key:'themes', label:'Thèmes', statistic_index_id: 6, data_type: 'list'},
{key:'components', label:'Composants', statistic_index_id: 6, data_type: 'list'},
{key:'machines', label:'Machines', statistic_index_id: 6, data_type: 'list'},
{key:'name', label:'Nom Évènement', statistic_index_id: 4, data_type: 'text'},
{key:'userId', label:'ID Utilisateur', statistic_index_id: 7, data_type: 'index'}
{key:'trainingId', label:I18n.t('statistics.training_id'), statistic_index_id: 3, data_type: 'index'},
{key:'trainingDate', label:I18n.t('statistics.training_date'), statistic_index_id: 3, data_type: 'date'},
{key:'eventId', label:I18n.t('statistics.event_id'), statistic_index_id: 4, data_type: 'index'},
{key:'eventDate', label:I18n.t('statistics.event_date'), statistic_index_id: 4, data_type: 'date'},
{key:'themes', label:I18n.t('statistics.themes'), statistic_index_id: 6, data_type: 'list'},
{key:'components', label:I18n.t('statistics.components'), statistic_index_id: 6, data_type: 'list'},
{key:'machines', label:I18n.t('statistics.machines'), statistic_index_id: 6, data_type: 'list'},
{key:'name', label:I18n.t('statistics.event_name'), statistic_index_id: 4, data_type: 'text'},
{key:'userId', label:I18n.t('statistics.user_id'), statistic_index_id: 7, data_type: 'index'}
])
end
@ -41,25 +41,25 @@ end
if StatisticType.count == 0
StatisticType.create!([
{statistic_index_id: 2, key: 'booking', label:'Réservations', graph: true, simple: true},
{statistic_index_id: 2, key: 'hour', label:"Nombre d'heures", graph: true, simple: false},
{statistic_index_id: 3, key: 'booking', label:'Réservations', graph: false, simple: true},
{statistic_index_id: 3, key: 'hour', label:"Nombre d'heures", graph: false, simple: false},
{statistic_index_id: 4, key: 'booking', label:'Nombre de places', graph: false, simple: false},
{statistic_index_id: 4, key: 'hour', label:"Nombre d'heures", graph: false, simple: false},
{statistic_index_id: 5, key: 'member', label:'Utilisateurs', graph: true, simple: true},
{statistic_index_id: 6, key: 'project', label:'Projets', graph: false, simple: true},
{statistic_index_id: 7, key: 'revenue', label:"Chiffre d'affaires", graph: false, simple: false}
{statistic_index_id: 2, key: 'booking', label:I18n.t('statistics.bookings'), graph: true, simple: true},
{statistic_index_id: 2, key: 'hour', label:I18n.t('statistics.hours_number'), graph: true, simple: false},
{statistic_index_id: 3, key: 'booking', label:I18n.t('statistics.bookings'), graph: false, simple: true},
{statistic_index_id: 3, key: 'hour', label:I18n.t('statistics.hours_number'), graph: false, simple: false},
{statistic_index_id: 4, key: 'booking', label:I18n.t('statistics.tickets_number'), graph: false, simple: false},
{statistic_index_id: 4, key: 'hour', label:I18n.t('statistics.hours_number'), graph: false, simple: false},
{statistic_index_id: 5, key: 'member', label:I18n.t('statistics.users'), graph: true, simple: true},
{statistic_index_id: 6, key: 'project', label:I18n.t('statistics.projects'), graph: false, simple: true},
{statistic_index_id: 7, key: 'revenue', label:I18n.t('statistics.revenue'), graph: false, simple: false}
])
end
if StatisticSubType.count == 0
StatisticSubType.create!([
{key: 'Stage', label:'Stage', statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types},
{key: 'Atelier', label:'Atelier', statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types},
{key: 'Stage', label:I18n.t('statistics.course'), statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types},
{key: 'Atelier', label:I18n.t('statistics.workshop'), statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types},
{key: 'created', label:'Création de compte', statistic_types: StatisticIndex.find_by(es_type_key: 'account').statistic_types},
{key: 'published', label:'Publication de projet', statistic_types: StatisticIndex.find_by(es_type_key: 'project').statistic_types}
{key: 'created', label:I18n.t('statistics.account_creation'), statistic_types: StatisticIndex.find_by(es_type_key: 'account').statistic_types},
{key: 'published', label:I18n.t('statistics.project_publication'), statistic_types: StatisticIndex.find_by(es_type_key: 'project').statistic_types}
])
end