mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Fix icon not showing up on category page
This commit is contained in:
parent
0a5e970ec0
commit
10bf7177e4
2 changed files with 17 additions and 17 deletions
|
|
@ -26,12 +26,12 @@ class CategoryPresenter
|
|||
end
|
||||
|
||||
def icon_class
|
||||
icon_suffix = classes[name.to_sym]
|
||||
icon_suffix = classes[id.to_sym]
|
||||
"fas fa-#{icon_suffix}"
|
||||
end
|
||||
|
||||
def icon_color_class
|
||||
color_suffix = colors[name.to_sym]
|
||||
color_suffix = colors[id.to_sym]
|
||||
"color-#{color_suffix}"
|
||||
end
|
||||
|
||||
|
|
@ -52,18 +52,18 @@ class CategoryPresenter
|
|||
private
|
||||
|
||||
def colors
|
||||
{ 'Teachers & Leadership': 'blue',
|
||||
'School Culture': 'red',
|
||||
'Resources': 'black',
|
||||
'Perceptions of Learning': 'lime',
|
||||
'Community & Wellbeing': 'teal' }
|
||||
{ '1': 'blue',
|
||||
'2': 'red',
|
||||
'3': 'black',
|
||||
'4': 'lime',
|
||||
'5': 'teal' }
|
||||
end
|
||||
|
||||
def classes
|
||||
{ 'Teachers & Leadership': 'apple-alt',
|
||||
'School Culture': 'school',
|
||||
'Resources': 'users-cog',
|
||||
'Perceptions of Learning': 'graduation-cap',
|
||||
'Community & Wellbeing': 'heart' }
|
||||
{ '1': 'apple-alt',
|
||||
'2': 'school',
|
||||
'3': 'users-cog',
|
||||
'4': 'graduation-cap',
|
||||
'5': 'heart' }
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,27 +11,27 @@ describe CategoryPresenter do
|
|||
end
|
||||
|
||||
let(:teachers_and_leadership_presenter) do
|
||||
category = create(:category, name: 'Teachers & Leadership')
|
||||
category = create(:category, name: 'Teachers & Leadership', category_id: '1')
|
||||
return CategoryPresenter.new(category:)
|
||||
end
|
||||
|
||||
let(:school_culture_presenter) do
|
||||
category = create(:category, name: 'School Culture')
|
||||
category = create(:category, name: 'School Culture', category_id: '2')
|
||||
return CategoryPresenter.new(category:)
|
||||
end
|
||||
|
||||
let(:resources_presenter) do
|
||||
category = create(:category, name: 'Resources')
|
||||
category = create(:category, name: 'Resources', category_id: '3')
|
||||
return CategoryPresenter.new(category:)
|
||||
end
|
||||
|
||||
let(:academic_learning_presenter) do
|
||||
category = create(:category, name: 'Perceptions of Learning')
|
||||
category = create(:category, name: 'Perceptions of Learning', category_id: '4')
|
||||
return CategoryPresenter.new(category:)
|
||||
end
|
||||
|
||||
let(:community_and_wellbeing_presenter) do
|
||||
category = create(:category, name: 'Community & Wellbeing')
|
||||
category = create(:category, name: 'Community & Wellbeing', category_id: '5')
|
||||
return CategoryPresenter.new(category:)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue