chore: start adding browse view

This commit is contained in:
Nelson Jovel 2024-01-26 07:43:52 -08:00
parent a538eb72f2
commit f71f88a4ac
12 changed files with 296 additions and 87 deletions

View file

@ -1,8 +1,10 @@
# frozen_string_literal: true
class AnalyzeController < SqmApplicationController
def index
@presenter = Analyze::Presenter.new(params:, school: @school, academic_year: @academic_year)
@background ||= BackgroundPresenter.new(num_of_columns: @presenter.graph.columns.count)
module Dashboard
class AnalyzeController < SqmApplicationController
def index
@presenter = Analyze::Presenter.new(params:, school: @school, academic_year: @academic_year)
@background ||= BackgroundPresenter.new(num_of_columns: @presenter.graph.columns.count)
end
end
end

View file

@ -1,11 +1,13 @@
# frozen_string_literal: true
class CategoriesController < SqmApplicationController
helper GaugeHelper
module Dashboard
class CategoriesController < SqmApplicationController
helper GaugeHelper
def show
@categories = Category.sorted.map { |category| CategoryPresenter.new(category:) }
def show
@categories = Category.sorted.map { |category| CategoryPresenter.new(category:) }
@category = CategoryPresenter.new(category: Category.find_by_slug(params[:id]))
@category = CategoryPresenter.new(category: Category.find_by_slug(params[:id]))
end
end
end