bingo: planned status and capacity type
All checks were successful
Build and Deploy to Production / test (push) Successful in 23s
Build and Deploy to Production / build (push) Successful in 1m0s
Build and Deploy to Production / deploy (push) Successful in 39s

"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:
Sergei Poljanski 2026-10-10 06:59:04 +04:00
commit e5bd1c1ac7
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
9 changed files with 69 additions and 9 deletions

View file

@ -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