From 966d716db739f4a4d1d81c736a32da7fc2322372 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 21 Aug 2022 12:14:52 -0400 Subject: [PATCH 1/2] Plan-740 and Plan-741 back of badge repory changes --- Gemfile.lock | 6 +++--- .../reports/program_ops_reports_controller.rb | 11 ++++++++--- db/structure.sql | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 12f0cbf71..651116cd9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,8 +74,8 @@ GEM zeitwerk (~> 2.3) acts-as-taggable-on (9.0.1) activerecord (>= 6.0, < 7.1) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) bcrypt (3.1.18) bindex (0.8.1) @@ -229,7 +229,7 @@ GEM pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.7) + public_suffix (5.0.0) puma (5.6.4) nio4r (~> 2.0) pundit (2.2.0) diff --git a/app/controllers/reports/program_ops_reports_controller.rb b/app/controllers/reports/program_ops_reports_controller.rb index cc910ce5f..1af22e970 100644 --- a/app/controllers/reports/program_ops_reports_controller.rb +++ b/app/controllers/reports/program_ops_reports_controller.rb @@ -64,6 +64,8 @@ def back_of_badge group_assignments = assignments.group_by {|a| a.person} max_sessions = 0 group_assignments.each do |person, grouped| + next if person.attendance_type == 'virtual' + row = [ person.published_name ] @@ -72,12 +74,15 @@ def back_of_badge grouped.each do |assignment| row.concat [ assignment.session.title, + assignment.session.title.truncate(30), assignment.session.start_time ? FastExcel.date_num(assignment.session.start_time, assignment.session.start_time.in_time_zone.utc_offset) : nil, - "#{assignment.session.duration}m", + "#{assignment.session.duration}mins", assignment.session.room&.name, + assignment.session.format&.name, + assignment.session_assignment_role_type&.name ] styles.concat [ - nil, date_time_style, nil, nil + nil, nil, date_time_style, nil, nil, nil, nil ] end max_sessions = grouped.size if grouped.size > max_sessions @@ -87,7 +92,7 @@ def back_of_badge header = ['Published Name'] (0..max_sessions).each do |n| - header.concat ["Title #{n+1}", "Start Time #{n+1}", "Duration #{n+1}", "Room #{n+1}"] + header.concat ["Title #{n+1}", "Truncated Title #{n+1}", "Start Time #{n+1}", "Duration #{n+1}", "Room #{n+1}", "Format #{n+1}", "Role #{n+1}"] end worksheet.write_row(0, header) diff --git a/db/structure.sql b/db/structure.sql index 4d3757d1c..7215ac4c5 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1155,6 +1155,7 @@ CREATE VIEW public.person_schedules AS sessions.participant_notes, sessions.description, sessions.environment, + sessions.status, CASE WHEN (sa.updated_at > sessions.updated_at) THEN sa.updated_at ELSE sessions.updated_at From ebb352052f85df1e6363989e52d432e3e20940cd Mon Sep 17 00:00:00 2001 From: Gail Terman Date: Sun, 21 Aug 2022 14:11:19 -0400 Subject: [PATCH 2/2] Add back in change that was made yesterday --- app/controllers/reports/program_ops_reports_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/reports/program_ops_reports_controller.rb b/app/controllers/reports/program_ops_reports_controller.rb index 1af22e970..0caf9beb1 100644 --- a/app/controllers/reports/program_ops_reports_controller.rb +++ b/app/controllers/reports/program_ops_reports_controller.rb @@ -76,7 +76,7 @@ def back_of_badge assignment.session.title, assignment.session.title.truncate(30), assignment.session.start_time ? FastExcel.date_num(assignment.session.start_time, assignment.session.start_time.in_time_zone.utc_offset) : nil, - "#{assignment.session.duration}mins", + "#{assignment.session.duration}m", assignment.session.room&.name, assignment.session.format&.name, assignment.session_assignment_role_type&.name