Use category presenters on page.

Show category and subcategory cards

Conditionally render subcategory icons

fix styling
This commit is contained in:
rebuilt 2021-10-01 17:05:50 +02:00
parent 8e0af1f17f
commit b29107688e
11 changed files with 171 additions and 14 deletions

View file

@ -1,13 +1,21 @@
class DashboardController < SqmApplicationController
def index
@presenters = measure_ids
.map { |measure_id| Measure.find_by_measure_id measure_id }
.map(&method(:presenter_for_measure))
.sort
.reverse
@measure_graph_row_presenters = measure_ids
.map { |measure_id| Measure.find_by_measure_id measure_id }
.map(&method(:presenter_for_measure))
.sort
.reverse
@category_presenters = SqmCategory.all.map { |sqm_category| CategoryPresenter.new(
category: sqm_category,
academic_year: academic_year,
school: school,
)}
end
private
def measure_ids