Skip to content

refactor: Removes MLH branding from Stats page, moved stats strings to locales #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/assets/javascripts/manage/lib/setupDataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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 },
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/manage/stats_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class MLHAppliedDatatable < ApplicationDatatable
class AppliedDatatable < ApplicationDatatable
def_delegators :@view, :link_to, :manage_stats_path, :bold, :display_datetime

def view_columns
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class MLHCheckedInDatatable < ApplicationDatatable
class CheckedInDatatable < ApplicationDatatable
def_delegators :@view, :link_to, :manage_stats_path, :bold, :display_datetime

def view_columns
Expand Down
88 changes: 43 additions & 45 deletions app/views/manage/stats/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/manage/stats_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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