Skip to content

Commit e0142d9

Browse files
committed
feat: Always show interested bus captains table
1 parent 90f3b7b commit e0142d9

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

app/views/manage/bus_lists/show.html.haml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,34 +49,33 @@
4949

5050
= render "questionnaire_datatable", scope_params: { bus_list_id: @bus_list.id, acc_status: 'rsvp_confirmed' }, columns: %w(link first_name last_name email phone checked_in boarded_bus bus_captain school), order: '13 desc, 15 desc', bulk_actions: false
5151

52-
- if @bus_list.needs_bus_captain
53-
%h4.mt-4.pb-2 Possible Bus Captains
54-
%table.table
55-
%thead
52+
%h4.mt-4.pb-2 Interested Bus Captains
53+
%table.table
54+
%thead
55+
%tr
56+
%th
57+
%th First Name
58+
%th Last Name
59+
%th Email
60+
%th Phone Number
61+
%th School
62+
- if current_user.admin?
63+
%th Actions
64+
%tbody
65+
- @bus_list.passengers.select { |q| q.bus_captain_interest }.each do |p|
5666
%tr
57-
%th
58-
%th First Name
59-
%th Last Name
60-
%th Email
61-
%th Phone Number
62-
%th School
67+
%td= link_to '<i class="fa fa-search"></i>'.html_safe, manage_questionnaire_path(p)
68+
%td= p.first_name
69+
%td= p.last_name
70+
%td= p.email
71+
%td= phone_link_to p.phone
72+
%td= link_to p.school.name, manage_school_path(p.school)
6373
- if current_user.admin?
64-
%th Actions
65-
%tbody
66-
- @bus_list.passengers.select { |q| q.bus_captain_interest }.each do |p|
67-
%tr
68-
%td= link_to '<i class="fa fa-search"></i>'.html_safe, manage_questionnaire_path(p)
69-
%td= p.first_name
70-
%td= p.last_name
71-
%td= p.email
72-
%td= phone_link_to p.phone
73-
%td= link_to p.school.name, manage_school_path(p.school)
74-
- if current_user.admin?
75-
%td
76-
- if p.is_bus_captain?
77-
= link_to "Remove Bus Captain", toggle_bus_captain_manage_bus_list_path(@bus_list, questionnaire_id: p.id, bus_captain: '0'), method: 'post', class: 'text-danger'
78-
- else
79-
= link_to "Make Bus Captain", toggle_bus_captain_manage_bus_list_path(@bus_list, questionnaire_id: p.id, bus_captain: '1'), method: 'post', data: { confirm: 'Are you sure? This will send a confirmation email to the bus captain.' }
74+
%td
75+
- if p.is_bus_captain?
76+
= link_to "Remove Bus Captain", toggle_bus_captain_manage_bus_list_path(@bus_list, questionnaire_id: p.id, bus_captain: '0'), method: 'post', class: 'text-danger'
77+
- else
78+
= link_to "Make Bus Captain", toggle_bus_captain_manage_bus_list_path(@bus_list, questionnaire_id: p.id, bus_captain: '1'), method: 'post', data: { confirm: 'Are you sure? This will send a confirmation email to the bus captain.' }
8079

8180
.row.mt-2.mb-4
8281
.col

0 commit comments

Comments
 (0)