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
23
db/migrations/016_bingo_provider.rb
Normal file
23
db/migrations/016_bingo_provider.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Sequel.migration do
|
||||
up do
|
||||
# Company grouping for the per-provider cards (Bingo::PROVIDERS slugs).
|
||||
# Backfilled from the free-text operator; Datacenter#before_create keeps
|
||||
# new rows filled the same way (Bingo.guess_provider).
|
||||
add_column :bingo_datacenters, :provider, String
|
||||
{
|
||||
'yandex' => %w[Яндекс%], 'ixcellerate' => %w[IXcellerate%], 'rtk' => %w[РТК-ЦОД%],
|
||||
'atomdata' => %w[Атомдата% Росатом%], 'datapro' => %w[DataPro%], 'selectel' => %w[Selectel%],
|
||||
'mws' => %w[MWS% МТС%], 'keypoint' => ['Key Point%'], '3data' => %w[3data%], 'sber' => %w[Сбер%],
|
||||
'megafon' => %w[МегаФон%], 'datahouse' => %w[DataHouse%], 'oxygen' => %w[OXYGEN%], 'linx' => %w[Linx%],
|
||||
'cloudx' => ['Cloud X%'], 'nkgroup' => ['NK Group%'], 'goznak' => %w[Гознак%]
|
||||
}.each do |slug, patterns|
|
||||
patterns.each do |pat|
|
||||
self[:bingo_datacenters].where(provider: nil).where(Sequel.ilike(:operator, pat)).update(provider: slug)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
down do
|
||||
drop_column :bingo_datacenters, :provider
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue