mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-10 07:50:33 -07:00
This wraps bootstrap styles in `sqm_bootstrap` which can now selectively import specific desired pieces of bootstrap styling
35 lines
604 B
Ruby
35 lines
604 B
Ruby
class SubcategoryCardPresenter
|
|
attr_reader :name
|
|
|
|
def initialize(name:, scale:, score:)
|
|
@name = name
|
|
@scale = scale
|
|
@score = score
|
|
end
|
|
|
|
def harvey_ball_icon
|
|
icons_by_zone_type = {
|
|
ideal: "full-circle",
|
|
approval: "three-quarter-circle",
|
|
growth: "half-circle",
|
|
watch: "one-quarter-circle",
|
|
warning: "full-circle",
|
|
no_zone: "full-circle"
|
|
}
|
|
icons_by_zone_type[zone.type]
|
|
end
|
|
|
|
def color
|
|
zone.type.to_s
|
|
end
|
|
|
|
def insufficient_data?
|
|
zone.type == :no_zone
|
|
end
|
|
|
|
private
|
|
|
|
def zone
|
|
@scale.zone_for_score(@score)
|
|
end
|
|
end
|