File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33class TeamsController < ApplicationController
44 skip_after_action :verify_policy_scoped
55 before_action :set_team
6+ before_action :set_schools , only : :schools
7+ before_action :set_clinics , only : :clinics
68
79 layout "full"
810
@@ -23,4 +25,24 @@ def clinics
2325 def set_team
2426 @team = authorize current_team
2527 end
28+
29+ def set_schools
30+ @schools =
31+ @team
32+ . schools
33+ . joins ( :team_locations )
34+ . where ( team_locations : { academic_year : AcademicYear . pending } )
35+ . distinct
36+ . order ( :name )
37+ end
38+
39+ def set_clinics
40+ @clinics =
41+ @team
42+ . community_clinics
43+ . joins ( :team_locations )
44+ . where ( team_locations : { academic_year : AcademicYear . pending } )
45+ . distinct
46+ . order ( :name )
47+ end
2648end
Original file line number Diff line number Diff line change 1818 <% end %>
1919 <% end %>
2020 <% table . with_body do |body | %>
21- <% @team . community_clinics . each do |clinic | %>
21+ <% @clinics . each do |clinic | %>
2222 <% body . with_row do |row | %>
2323 <% row . with_cell {
2424 [
Original file line number Diff line number Diff line change 1515 <% table . with_head do |head | %>
1616 <% head . with_row do |row | %>
1717 <% row . with_cell { "Name" } %>
18- <% row . with_cell { "URN" } %>
19- <% row . with_cell { "Phase" } %>
18+ <% row . with_cell { "School URN" } %>
2019 <% end %>
2120 <% end %>
2221 <% table . with_body do |body | %>
23- <% @team . schools . each do |school | %>
22+ <% @schools . each do |school | %>
2423 <% body . with_row do |row | %>
2524 <% row . with_cell {
2625 [
3231 . html_safe
3332 } %>
3433 <% row . with_cell { tag . span ( school . urn_and_site , class : "app-u-code" ) } %>
35- <% row . with_cell { school . human_enum_name ( :phase ) } %>
3634 <% end %>
3735 <% end %>
3836 <% end %>
You can’t perform that action at this time.
0 commit comments