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
|
|
@ -3,7 +3,7 @@ require 'uri'
|
|||
# /admin/bingo/* on asxp.io: edit the card and record incidents for BingoWeb.
|
||||
# Registered into AsxpioWeb, so AdminAuth (HTTP Basic) and CSRF apply.
|
||||
module BingoAdmin
|
||||
DC_TEXT = %w[name_ru name_en name_uk city_ru city_en city_uk operator mw status
|
||||
DC_TEXT = %w[name_ru name_en name_uk city_ru city_en city_uk operator mw mw_type status
|
||||
photo_credit photo_source_url info_url].freeze
|
||||
|
||||
module Helpers
|
||||
|
|
@ -23,7 +23,8 @@ module BingoAdmin
|
|||
def assign_dc(dc)
|
||||
DC_TEXT.each { |f| dc[f.to_sym] = blank_nil(params[f]) }
|
||||
dc.year = params[:year].to_s =~ /\A\d{4}\z/ ? params[:year].to_i : nil
|
||||
dc.status = 'operational' unless %w[operational building].include?(dc.status)
|
||||
dc.status = 'operational' unless Bingo::STATUSES.include?(dc.status)
|
||||
dc.mw_type = nil unless Bingo::MW_TYPES.include?(dc.mw_type)
|
||||
errs = []
|
||||
errs << 'Name (ru), city (ru) and operator are required' if [dc.name_ru, dc.city_ru, dc.operator].any?(&:nil?)
|
||||
errs << 'URLs must be http(s)' unless [dc.photo_source_url, dc.info_url].all? { |u| http_url?(u.to_s) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue