mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
better years links
This commit is contained in:
parent
d92d87b643
commit
1ee9df7695
2 changed files with 6 additions and 4 deletions
|
|
@ -14,8 +14,9 @@ class CategoriesController < ApplicationController
|
|||
district = @school.district
|
||||
authenticate(district.name.downcase, "#{district.name.downcase}!")
|
||||
school_categories = SchoolCategory.for(@school, @category)
|
||||
@years = school_categories.map(&:year)
|
||||
@years = school_categories.map(&:year).map(&:to_i).sort
|
||||
@year = (params[:year] || @years.first).to_i
|
||||
@years.delete(@year)
|
||||
@school_category = SchoolCategory.for(@school, @category).in(@year).first
|
||||
@child_school_categories = SchoolCategory.for_parent_category(@school, @category).valid
|
||||
@questions = @category.questions
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@
|
|||
Data from
|
||||
= "#{@year - 1}-#{@year}"
|
||||
school year.
|
||||
Show:
|
||||
- @years.each do |year|
|
||||
= link_to(year, school_category_path(@school_category.school, @school_category.category, year: year))
|
||||
- if @years.present?
|
||||
Show:
|
||||
- @years.each do |year|
|
||||
= link_to(year, school_category_path(@school_category.school, @school_category.category, year: year))
|
||||
- if @school.district.present?
|
||||
%p
|
||||
%strong District:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue