Skip to content

Commit

Permalink
Merge pull request #682 from ChicagoWorldcon/plan-741-742-back-of-badges
Browse files Browse the repository at this point in the history
Plan 741 742 back of badges (2.0.2)
  • Loading branch information
Gailbear authored Aug 21, 2022
2 parents 6134567 + ebb3520 commit 20a338a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions app/controllers/reports/program_ops_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand All @@ -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.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
Expand All @@ -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)

Expand Down
1 change: 1 addition & 0 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20a338a

Please sign in to comment.