Show category and subcategory cards Conditionally render subcategory icons fix stylingpull/1/head
parent
8e0af1f17f
commit
b29107688e
@ -0,0 +1,12 @@
|
||||
@import "colors";
|
||||
|
||||
.view-details {
|
||||
background-color: #01788E;
|
||||
font-family: 'Bitter', sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
color: $white;
|
||||
padding: 8px 16px;
|
||||
border: 0px;
|
||||
width: 70%;
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
class SubcategoryCardPresenter
|
||||
|
||||
def initialize(scale:, score:)
|
||||
@scale = scale
|
||||
@score = score
|
||||
end
|
||||
|
||||
def abbreviation
|
||||
abbreviations = { approval: "A", ideal: "I", growth: "G", watch: "Wa", warning: "Wr" , no_zone: "N"}
|
||||
abbreviations[zone.type]
|
||||
end
|
||||
|
||||
def svg
|
||||
|
||||
end
|
||||
|
||||
def offset
|
||||
return 40 unless abbreviation.length > 1
|
||||
27
|
||||
end
|
||||
|
||||
def color
|
||||
case zone.type
|
||||
when :warning
|
||||
return "fill-warning"
|
||||
when :watch
|
||||
return "fill-watch"
|
||||
when :growth
|
||||
return "fill-growth"
|
||||
when :approval
|
||||
return "fill-approval"
|
||||
when :ideal
|
||||
return "fill-ideal"
|
||||
else
|
||||
return "fill-warning"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def zone
|
||||
@scale.zone_for_score(@score)
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,30 @@
|
||||
<div class="school-quality-frameworks mt-5 p-4 border-radius-8">
|
||||
<h2 class="sub-header">School Quality Framework Indicators</h2>
|
||||
|
||||
<div class="row">
|
||||
<% category_presenters.each do |category_presenter| %>
|
||||
<section class="category-card column">
|
||||
<div class="category-card__title"><h3><%= category_presenter.name %></h3></div>
|
||||
<p class="category-card__description">This category measures the relevant abilities of a school's teachers and the degree to which they are receiving the support they need to grow as professionals. </p>
|
||||
<div class="subcategory-card border-radius-8 fdc">
|
||||
<div class="subcategory-card__benchmark-list" >
|
||||
<% category_presenter.subcategories.each do |subcategory | %>
|
||||
<% presenter = subcategory.subcategory_card_presenter %>
|
||||
<div class="subcategory-card__benchmark-item row">
|
||||
<div class="subcategory-card__circle-container " style="width:50px; height:50px;">
|
||||
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle class="subcategory-card__benchmark-icon <%= presenter.color %>" cx="50" cy="50" r="35"/>
|
||||
<text class="subcategory-card__benchmark-label" x="<%= presenter.offset %>" y= "55"><%= presenter.abbreviation %></text>
|
||||
</svg>
|
||||
</div>
|
||||
<p class="subcategory-card__name"><%= subcategory.name %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<button class="view-details mt-3">View Details</button>
|
||||
</section>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in new issue