bingo: default to the operational card
All checks were successful
Build and Deploy to Production / test (push) Successful in 28s
Build and Deploy to Production / build (push) Successful in 1m8s
Build and Deploy to Production / deploy (push) Successful in 41s

The card led with construction projects (Sber Balakovo at #1, MOS7,
MOS11, Yandex Vladimir-2), so the first thing visitors saw was not what
actually runs today. Make the operational-only card the bare URL and
move the full list to ?view=all. The variant is noindex with canonical
to the bare page, old ?view=operational links still land on the default,
and the admin dashboard tile follows the public default.

Assisted-by: Claude:opus-5
This commit is contained in:
Sergei Poljanski 2026-10-11 20:34:24 +04:00
commit 9ba108b6b0
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
5 changed files with 23 additions and 15 deletions

View file

@ -23,9 +23,10 @@ class BingoWeb < Sinatra::Base
def kind_label(kind) = Bingo::T[@locale][:kinds][kind] || Bingo::T[@locale][:kinds]['other']
def kind_icon(kind) = Bingo::ICONS[kind] || Bingo::ICONS['other']
def photo_path(dc, width = nil) = dc.photo_file(width) && "/p/#{dc.photo_file(width)}"
# Path for a locale/view combination; the default view keeps a bare URL.
# Path for a locale/view combination; the default view (operational)
# keeps a bare URL, the full list is ?view=all.
def card_path(locale = @locale, view = @view)
view == 'operational' ? "/#{locale}?view=operational" : "/#{locale}"
view == 'all' ? "/#{locale}?view=all" : "/#{locale}"
end
def dc_path(dc, locale = @locale) = "/#{locale}/dc/#{dc.slug}"
@ -165,11 +166,11 @@ class BingoWeb < Sinatra::Base
get %r{/(ru|en|uk)} do |locale|
@locale = locale
@view = Bingo::VIEWS.include?(params[:view]) ? params[:view] : 'all'
@view = params[:view] == 'all' ? 'all' : Bingo::VIEWS.first
@board = Bingo::Board.load(@view)
@title = t(:seo_title)
@desc = format(t(:seo_desc), hit: @board.hit.count(true), total: @board.cells.size)
@noindex = @board.operational_only?
@noindex = !@board.operational_only? # ?view=all is a variant of the bare page
@path_for = ->(l) { "/#{l}" }
@x_default = '/'
@og = og_dc(@board)