bingo: planned status and capacity type
"MW" on the card mixed IT load, connected power, total site power,
design capacity and even MVA (Oxygen, Sber Yuzhny Port). Record which
one a figure is in a new mw_type column; the dialog tags the number
("64 MW · design") and MVA replaces the unit, while cells keep the bare
figure to stay readable. Add a "planned" status for projects not yet
under construction; like "building", it is left out of the operational
view.
Assisted-by: Claude:opus-5
This commit is contained in:
parent
9e885dd8c1
commit
e5bd1c1ac7
9 changed files with 69 additions and 9 deletions
13
bingo_web.rb
13
bingo_web.rb
|
|
@ -57,8 +57,17 @@ class BingoWeb < Sinatra::Base
|
|||
end
|
||||
def fmt_date(d) = d.strftime('%d.%m.%Y')
|
||||
|
||||
def mw(dc)
|
||||
dc.mw.to_s.strip.empty? ? nil : "#{dc.mw} #{t(:mw)}"
|
||||
# "64 MW", "64 MW · design", "17 MVA" (MVA is a unit, not a tag).
|
||||
def mw(dc, tag: true)
|
||||
return if dc.mw.to_s.strip.empty?
|
||||
return "#{dc.mw} #{t(:mva)}" if dc.mw_type == 'mva'
|
||||
tag &&= t(:mw_types)[dc.mw_type]
|
||||
["#{dc.mw} #{t(:mw)}", tag || nil].compact.join(' · ')
|
||||
end
|
||||
|
||||
# Badge for anything not yet in service.
|
||||
def status_label(dc)
|
||||
{ 'building' => t(:building), 'planned' => t(:planned) }[dc.status]
|
||||
end
|
||||
|
||||
def preferred_locale
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue