diff --git a/app/assets/javascripts/manage/lib/setupDataTables.js b/app/assets/javascripts/manage/lib/setupDataTables.js index f9418bc3c..2403217db 100644 --- a/app/assets/javascripts/manage/lib/setupDataTables.js +++ b/app/assets/javascripts/manage/lib/setupDataTables.js @@ -124,7 +124,7 @@ var setupDataTables = function () { ] }); - $('.datatable.stats-mlhinfo-applied').DataTable({ + $('.datatable.stats-info-applied').DataTable({ order: [1, 'asc'], columns: [ { orderable: true, data: 'id', visible: false }, @@ -136,7 +136,7 @@ var setupDataTables = function () { ] }); - $('.datatable.stats-mlhinfo-checkedin').DataTable({ + $('.datatable.stats-info-checkedin').DataTable({ order: [1, 'asc'], columns: [ { orderable: true, data: 'id', visible: false }, diff --git a/app/controllers/manage/stats_controller.rb b/app/controllers/manage/stats_controller.rb index 09deb7526..426423c24 100644 --- a/app/controllers/manage/stats_controller.rb +++ b/app/controllers/manage/stats_controller.rb @@ -15,11 +15,11 @@ def attendee_sponsor_info_datatable render json: AttendeeSponsorInfoDatatable.new(params, view_context: view_context) end - def mlh_applied_datatable - render json: MLHAppliedDatatable.new(params, view_context: view_context) + def applied_datatable + render json: AppliedDatatable.new(params, view_context: view_context) end - def mlh_checked_in_datatable - render json: MLHCheckedInDatatable.new(params, view_context: view_context) + def checked_in_datatable + render json: CheckedInDatatable.new(params, view_context: view_context) end end diff --git a/app/datatables/mlh_applied_datatable.rb b/app/datatables/applied_datatable.rb similarity index 94% rename from app/datatables/mlh_applied_datatable.rb rename to app/datatables/applied_datatable.rb index 7da2d25c4..9fb418866 100644 --- a/app/datatables/mlh_applied_datatable.rb +++ b/app/datatables/applied_datatable.rb @@ -1,4 +1,4 @@ -class MLHAppliedDatatable < ApplicationDatatable +class AppliedDatatable < ApplicationDatatable def_delegators :@view, :link_to, :manage_stats_path, :bold, :display_datetime def view_columns diff --git a/app/datatables/mlh_checked_in_datatable.rb b/app/datatables/checked_in_datatable.rb similarity index 94% rename from app/datatables/mlh_checked_in_datatable.rb rename to app/datatables/checked_in_datatable.rb index 7524b2c01..3aadb6c6c 100644 --- a/app/datatables/mlh_checked_in_datatable.rb +++ b/app/datatables/checked_in_datatable.rb @@ -1,4 +1,4 @@ -class MLHCheckedInDatatable < ApplicationDatatable +class CheckedInDatatable < ApplicationDatatable def_delegators :@view, :link_to, :manage_stats_path, :bold, :display_datetime def view_columns diff --git a/app/views/manage/stats/index.html.haml b/app/views/manage/stats/index.html.haml index 7451827a2..22ae4ab48 100644 --- a/app/views/manage/stats/index.html.haml +++ b/app/views/manage/stats/index.html.haml @@ -2,79 +2,77 @@ .row .col - %h5.dashboard-container-title Dietary Restrictions or Special Needs + %h5.dashboard-container-title= t(:dietary_restrictions_special_needs, scope: 'pages.manage.stats') %table.datatable.stats-dietary.table.table-striped.table-hover{ "data-source" => dietary_restrictions_special_needs_datatable_manage_stats_path(format: :json) } %thead %tr - %th ID - %th First Name - %th Last Name - %th Email - %th Phone - %th Questionnaire - %th Checked In - %th Dietary Restrictions - %th Special Needs + %th= t(:id, scope: 'pages.manage.stats') + %th= t(:first_name, scope: 'pages.manage.stats') + %th= t(:last_name, scope: 'pages.manage.stats') + %th= t(:email, scope: 'pages.manage.stats') + %th= t(:phone, scope: 'pages.manage.stats') + %th= t(:questionnaire, scope: 'pages.manage.stats') + %th= t(:checked_in, scope: 'pages.manage.stats') + %th= t(:dietary_restrictions, scope: 'pages.manage.stats') + %th= t(:special_needs, scope: 'pages.manage.stats') %tbody - if !HackathonConfig['digital_hackathon'] .row .col - %h5.dashboard-container-title Attendees Not Traveling From Their School + %h5.dashboard-container-title= t(:attendees_not_traveling_from_their_school, scope: 'pages.manage.stats') %table.datatable.stats-notschooltravel.table.table-striped.table-hover{ "data-source" => alt_travel_datatable_manage_stats_path(format: :json) } %thead %tr - %th ID - %th First Name - %th Last Name - %th Email - %th Phone - %th Questionnaire - %th Traveling From - %th Questionnaire Status + %th= t(:id, scope: 'pages.manage.stats') + %th= t(:first_name, scope: 'pages.manage.stats') + %th= t(:last_name, scope: 'pages.manage.stats') + %th= t(:email, scope: 'pages.manage.stats') + %th= t(:phone, scope: 'pages.manage.stats') + %th= t(:questionnaire, scope: 'pages.manage.stats') + %th= t(:traveling_from, scope: 'pages.manage.stats') + %th= t(:questionnaire_status, scope: 'pages.manage.stats') %tbody .row .col - %h5.dashboard-container-title Attendee Info for Sponsors + %h5.dashboard-container-title= t(:attendee_info_for_sponsors, scope: 'pages.manage.stats') %table.datatable.stats-attendeeinfo.table.table-striped.table-hover{ "data-source" => attendee_sponsor_info_datatable_manage_stats_path(format: :json) } %thead %tr - %th ID - %th First name - %th Last name - %th Email - %th School - %th Open Source Link - %th Portfolio Link + %th= t(:id, scope: 'pages.manage.stats') + %th= t(:first_name, scope: 'pages.manage.stats') + %th= t(:last_name, scope: 'pages.manage.stats') + %th= t(:email, scope: 'pages.manage.stats') + %th= t(:school, scope: 'pages.manage.stats') + %th= t(:open_source_link, scope: 'pages.manage.stats') + %th= t(:portfolio_link, scope: 'pages.manage.stats') %tbody .row .col - %h5.dashboard-container-title MLH Info (applied) - %table.datatable.stats-mlhinfo-applied.table.table-striped.table-hover{ "data-source" => mlh_applied_datatable_manage_stats_path(format: :json) } + %h5.dashboard-container-title= t(:applied_attendees, scope: 'pages.manage.stats') + %table.datatable.stats-info-applied.table.table-striped.table-hover{ "data-source" => applied_datatable_manage_stats_path(format: :json) } %thead %tr - %th ID - %th First name - %th Last name - %th Email - %th Phone - %th School Name + %th= t(:id, scope: 'pages.manage.stats') + %th= t(:first_name, scope: 'pages.manage.stats') + %th= t(:last_name, scope: 'pages.manage.stats') + %th= t(:email, scope: 'pages.manage.stats') + %th= t(:phone, scope: 'pages.manage.stats') + %th= t(:school, scope: 'pages.manage.stats') %tbody .row .col - %h5.dashboard-container-title MLH Info (checked in) - %table.datatable.stats-mlhinfo-checkedin.table.table-striped.table-hover{ "data-source" => mlh_checked_in_datatable_manage_stats_path(format: :json) } + %h5.dashboard-container-title= t(:checked_in_attendees, scope: 'pages.manage.stats') + %table.datatable.stats-info-checkedin.table.table-striped.table-hover{ "data-source" => checked_in_datatable_manage_stats_path(format: :json) } %thead %tr - %th ID - %th First name - %th Last name - %th Email - %th Phone - %th School Name + %th= t(:id, scope: 'pages.manage.stats') + %th= t(:first_name, scope: 'pages.manage.stats') + %th= t(:last_name, scope: 'pages.manage.stats') + %th= t(:email, scope: 'pages.manage.stats') + %th= t(:phone, scope: 'pages.manage.stats') + %th= t(:school, scope: 'pages.manage.stats') %tbody - -.mb-4 diff --git a/config/locales/en.yml b/config/locales/en.yml index 3a0124856..227245d78 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -130,6 +130,25 @@ en: title: Check-in stats: title: Statistics + id: ID + first_name: First Name + last_name: Last Name + email: Email + phone: Phone + school: School + checked_in: Checked-in + traveling_from: Traveling From + questionnaire: Questionnaire + questionnaire_status: Questionnaire Status + dietary_restrictions: Dietary Restrictions + special_needs: Special Needs + open_source_link: Open Source Link + portfolio_link: Portfolio Link + dietary_restrictions_special_needs: Dietary Restrictions or Special Needs + attendes_not_traveling_from_their_school: Attendees Not Traveling From Their School + attendee_info_for_sponsors: Attendee Info for Sponsors + applied_attendees: Applied Attendees + checked_in_attendees: Checked-in Attendees trackable-tags: title: Trackable Tags events: diff --git a/config/routes.rb b/config/routes.rb index d249407b0..b19f3d108 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -101,8 +101,8 @@ post :dietary_restrictions_special_needs_datatable, on: :collection post :alt_travel_datatable, on: :collection post :attendee_sponsor_info_datatable, on: :collection - post :mlh_applied_datatable, on: :collection - post :mlh_checked_in_datatable, on: :collection + post :applied_datatable, on: :collection + post :checked_in_datatable, on: :collection end resources :users do post :user_datatable, on: :collection diff --git a/test/controllers/manage/stats_controller_test.rb b/test/controllers/manage/stats_controller_test.rb index 2c48aa112..a576bab95 100644 --- a/test/controllers/manage/stats_controller_test.rb +++ b/test/controllers/manage/stats_controller_test.rb @@ -114,6 +114,6 @@ class Manage::StatsControllerTest < ActionController::TestCase private def paths - [:dietary_restrictions_special_needs_datatable, :attendee_sponsor_info_datatable, :alt_travel_datatable, :mlh_applied_datatable, :mlh_checked_in_datatable] + [:dietary_restrictions_special_needs_datatable, :attendee_sponsor_info_datatable, :alt_travel_datatable, :applied_datatable, :checked_in_datatable] end end