diff --git a/app/presenters/parent_scale_presenter.rb b/app/presenters/parent_scale_presenter.rb index 26706c12..8433b53b 100644 --- a/app/presenters/parent_scale_presenter.rb +++ b/app/presenters/parent_scale_presenter.rb @@ -44,12 +44,12 @@ class ParentScalePresenter scale.measure end - private - def scale_id scale.scale_id end + private + def parent_survey_presenter ParentSurveyPresenter.new(scale_id:, survey_items: scale.survey_items.parent_survey_items, has_sufficient_data: score.positive?, school:, academic_year:) diff --git a/app/views/analyze/_grouped_bar_column.html.erb b/app/views/analyze/_grouped_bar_column.html.erb index 2970e436..f487eef0 100644 --- a/app/views/analyze/_grouped_bar_column.html.erb +++ b/app/views/analyze/_grouped_bar_column.html.erb @@ -1,49 +1,49 @@ - <% score_label_y = [5, 10, 15, 5, 10, 15 ] %> - <% column.bars.each_with_index do |bar, index| %> - - data-bs-toggle="popover" - data-bs-placement="right" - data-bs-content="<%= column.popover_content(bar.academic_year) %>" - <% end %> +<% score_label_y = [5, 10, 15, 5, 10, 15 ] %> +<% column.bars.each_with_index do |bar, index| %> + + data-bs-toggle="popover" + data-bs-placement="right" + data-bs-content="<%= column.popover_content(bar.academic_year) %>" + <% end %> - data-for-academic-year="<%= bar.academic_year.range %>" - x="<%= bar.x_position %>%" - y="<%= bar.y_offset %>%" - width="<%= column.bar_width %>%" - height="<%= bar.bar_height_percentage %>%" - fill="<%= bar.color %>" /> + data-for-academic-year="<%= bar.academic_year.range %>" + x="<%= bar.x_position %>%" + y="<%= bar.y_offset %>%" + width="<%= column.bar_width %>%" + height="<%= bar.bar_height_percentage %>%" + fill="<%= bar.color %>" /> - <% if ENV["SCORES"].present? && ENV["SCORES"].upcase == "SHOW" %> - - <%= bar.average %> + <% if ENV["SCORES"].present? && ENV["SCORES"].upcase == "SHOW" %> + + <%= bar.average %> <% end %> <% end %> - <% words = column.label %> - <% words.each_with_index do | line, index | %> - +<% words = column.label %> +<% words.each_with_index do | line, index | %> + <%= line %> - + <% end %> <% if column.show_irrelevancy_message? %> - - measure not - based on - <%= column.basis %> + + measure not + based on + <%= column.basis %> <% elsif column.show_insufficient_data_message? %> - - <% column.insufficiency_message.each_with_index do |line, index| %> - <% offset = 29 + index * 5 %> - <%= line %> - <% end %> + + <% column.insufficiency_message.each_with_index do |line, index| %> + <% offset = 29 + index * 5 %> + <%= line %> + <% end %> <% end %> diff --git a/app/views/analyze/index.html.erb b/app/views/analyze/index.html.erb index dbb47265..73b6edb0 100644 --- a/app/views/analyze/index.html.erb +++ b/app/views/analyze/index.html.erb @@ -27,10 +27,10 @@ <% if @presenter.show_secondary_graph?(measure:) %>
- <% measure.scales.parent_scales.each do | scale| %> - + <% measure.scales.parent_scales.each do |scale| %> + <% end %> - <%= link_to("Parent Survey", district_school_category_path( @district, @school, @presenter.category, {year: @presenter.selected_academic_years&.last&.range , anchor: "#{measure.measure_id}"}), class: "construct-id", data: {turbo_frame: "_top"}) %> + <%= link_to("Parent Survey", district_school_category_path( @district, @school, @presenter.category, {year: @presenter.selected_academic_years&.last&.range , anchor: "#{measure.scales.parent_scales.first.scale_id}"}), class: "construct-id", data: {turbo_frame: "_top"}) %>

<%= measure.subcategory.name %>

<%= render partial: "grouped_bar_chart" , locals: { measure: measure, columns: @presenter.columns_for_measure(measure:)} %>
diff --git a/app/views/categories/_measures_section.html.erb b/app/views/categories/_measures_section.html.erb index 7aa00bed..2356ae7c 100644 --- a/app/views/categories/_measures_section.html.erb +++ b/app/views/categories/_measures_section.html.erb @@ -1,4 +1,4 @@ -
+

<%= measure_presenter.title %>

<%= link_to(district_school_analyze_index_path(@district, @school, { academic_year: @academic_year.range, category: measure_presenter.measure.subcategory.category.category_id, subcategory: measure_presenter.measure.subcategory.subcategory_id, anchor: measure_presenter.id}), class: "measure-description sub-header-4 mb-5") do %>

<%= measure_presenter.name %>

diff --git a/app/views/categories/_subcategory_section.html.erb b/app/views/categories/_subcategory_section.html.erb index 7102d542..52301795 100644 --- a/app/views/categories/_subcategory_section.html.erb +++ b/app/views/categories/_subcategory_section.html.erb @@ -46,14 +46,14 @@
<% subcategory.measure_presenters.each do |measure_presenter| %> - <%= render partial: "measures_section", locals: { measure_presenter: measure_presenter } %> + <%= render partial: "measures_section", locals: { measure_presenter: measure_presenter, id: measure_presenter.id } %> <% end %>
<% if subcategory.show_scale_presenters? %>
<% subcategory.scale_presenters.each do |scale_presenter| %> - <%= render partial: "measures_section", locals: { measure_presenter: scale_presenter } %> + <%= render partial: "measures_section", locals: { measure_presenter: scale_presenter, id: "#{scale_presenter.scale_id}" } %> <% end %>
<% end %>