Skip to content
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

fix: Update external report form sorting/labeling [PT-186835600] #1248

Merged
merged 1 commit into from
Mar 21, 2024
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 rails/app/views/shared/_cohorts_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.aligned
= hidden_field_tag :update_cohorts, "true"
%ul.menu_h
- Pundit.policy_scope(current_user, Admin::Cohort).each do |cohort|
- Pundit.policy_scope(current_user, Admin::Cohort).sort_by(&:fullname).each do |cohort|
%li
= cohort.fullname
= check_box_tag "cohort_ids[]", cohort.id, object.cohorts.include?(cohort), :id => cohort.id
= label_tag cohort.fullname
4 changes: 2 additions & 2 deletions rails/app/views/shared/_grade_levels_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.aligned
= hidden_field_tag :update_grade_levels, "true"
%ul.menu_h
- Admin::Tag.where(scope: "grade_levels").each do |admin_tag|
- Admin::Tag.where(scope: "grade_levels").sort_by {|sub| sub[:tag].downcase}.each do |admin_tag|
%li
- label_str = "grade_levels_#{admin_tag.tag.underscore}"
= label_tag label_str, admin_tag.tag
= check_box_tag "grade_levels[]", admin_tag.tag, object.grade_level_list.include?(admin_tag.tag), :id => label_str
= label_tag label_str, admin_tag.tag
4 changes: 2 additions & 2 deletions rails/app/views/shared/_material_properties_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.aligned
= hidden_field_tag :update_material_properties, "true"
%ul.menu_h
- Admin::Tag.where(scope: "material_properties").each do |admin_tag|
- Admin::Tag.where(scope: "material_properties").sort_by {|sub| sub[:tag].downcase}.each do |admin_tag|
%li
- label_str = "material_properties_#{admin_tag.tag.underscore}"
= label_tag label_str, admin_tag.tag
= check_box_tag "material_properties[]", admin_tag.tag, object.material_property_list.include?(admin_tag.tag), :id => label_str
= label_tag label_str, admin_tag.tag
4 changes: 2 additions & 2 deletions rails/app/views/shared/_projects_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
-# Hidden field handles a case when all checkboxes are unchecked.
= hidden_field_tag prop_name
- project_assigned = Hash[object.projects.map { |p| [p.id, true ] }]
- Admin::Project.all.each do |project|
- Admin::Project.all.sort_by(&:name).each do |project|
- if policy(project).assign_to_material?
%li
- label_str = "project_#{project.id}"
= label_tag label_str, project.name
= check_box_tag prop_name, project.id, project_assigned[project.id], id: label_str
= label_tag label_str, project.name
- elsif project_assigned[project.id]
-# This is necessary to keep hidden projects still assigned to the material.
= hidden_field_tag prop_name, project.id
4 changes: 2 additions & 2 deletions rails/app/views/shared/_sensors_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.aligned
= hidden_field_tag :update_sensors, "true"
%ul.menu_h
- Admin::Tag.where(scope: "sensors").each do |admin_tag|
- Admin::Tag.where(scope: "sensors").sort_by {|sub| sub[:tag].downcase}.each do |admin_tag|
%li
- label_str = "sensors_#{admin_tag.tag.underscore}"
= label_tag label_str, admin_tag.tag
= check_box_tag "sensors[]", admin_tag.tag, object.sensor_list.include?(admin_tag.tag), :id => label_str
= label_tag label_str, admin_tag.tag
2 changes: 1 addition & 1 deletion rails/app/views/shared/_subject_areas_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
- Admin::Tag.where(scope: "subject_areas").sort_by {|sub| sub[:tag].downcase}.each do |admin_tag|
%li
- label_str = "subject_areas_#{admin_tag.tag.underscore}"
= label_tag label_str, admin_tag.tag
= check_box_tag "subject_areas[]", admin_tag.tag, object.subject_area_list.include?(admin_tag.tag), :id => label_str
= label_tag label_str, admin_tag.tag
Loading