bingo: build the card from chosen providers
Let visitors tick providers (Yandex, IXcellerate, RTK-DC, Sber, …) and get the usual 5×5 card made of only those providers' datacenters, first 25 in ranking order, with lines scored as normal. A selection with fewer than 25 sites leaves the rest of the card empty, so the card is always 5×5. Each provider chip shows crossed/total for the current view. Datacenters get a provider slug, backfilled from the free-text operator, guessed for new rows and editable in the admin. Filtered URLs are noindex with canonical to the plain card. Assisted-by: Claude:opus-5
This commit is contained in:
parent
9ba108b6b0
commit
c64098813b
9 changed files with 155 additions and 8 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 mw_type status
|
||||
DC_TEXT = %w[name_ru name_en name_uk city_ru city_en city_uk operator provider mw mw_type status
|
||||
photo_credit photo_source_url info_url about_ru about_en about_uk].freeze
|
||||
|
||||
module Helpers
|
||||
|
|
@ -25,6 +25,7 @@ module BingoAdmin
|
|||
dc.year = params[:year].to_s =~ /\A\d{4}\z/ ? params[:year].to_i : nil
|
||||
dc.status = 'operational' unless Bingo::STATUSES.include?(dc.status)
|
||||
dc.mw_type = nil unless Bingo::MW_TYPES.include?(dc.mw_type)
|
||||
dc.provider = nil unless Bingo::PROVIDERS.key?(dc.provider)
|
||||
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