bingo: operational-only view of the card
The card mixes facilities in service with construction projects (Sber Balakovo at #1, MOS7, MOS11, Yandex Vladimir-2), which is fine for a bingo but not when you want to compare what actually runs today. Add a toggle that builds the card from operational rows only, in the same ranking, with bingo lines recomputed for that card. The filtered view is noindex with canonical to the plain locale URL, so it does not compete with the main page in search. Assisted-by: Claude:opus-5
This commit is contained in:
parent
61bb1393fe
commit
9e885dd8c1
6 changed files with 74 additions and 14 deletions
|
|
@ -21,6 +21,11 @@ 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.
|
||||
def card_path(locale = @locale, view = @view)
|
||||
view == 'operational' ? "/#{locale}?view=operational" : "/#{locale}"
|
||||
end
|
||||
|
||||
def base_url = "https://#{ENV.fetch('BINGO_HOST', request.host)}"
|
||||
|
||||
# WebSite + ItemList of the card's datacenters, for rich results.
|
||||
|
|
@ -85,7 +90,8 @@ class BingoWeb < Sinatra::Base
|
|||
|
||||
get %r{/(ru|en|uk)/?} do |locale|
|
||||
@locale = locale
|
||||
@board = Bingo::Board.load
|
||||
@view = Bingo::VIEWS.include?(params[:view]) ? params[:view] : 'all'
|
||||
@board = Bingo::Board.load(@view)
|
||||
cache_control :public, max_age: 60
|
||||
erb :index
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue