mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
31 lines
470 B
Ruby
31 lines
470 B
Ruby
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
|
|
"fill-#{zone.type}"
|
|
end
|
|
|
|
private
|
|
|
|
def zone
|
|
@scale.zone_for_score(@score)
|
|
end
|
|
end
|