diff --git a/app.rb b/app.rb index 56a8fd3..8887339 100644 --- a/app.rb +++ b/app.rb @@ -25,6 +25,7 @@ end # Content is managed from asxp.io/admin/bingo (asxpio repo), which shares the # database and photo bucket. class BingoWeb < Sinatra::Base + SOURCE_URL = 'https://github.com/asxpi/datacenterbingo'.freeze HOSTS = [ENV['BINGO_HOST'], ENV['BINGO_ALT_HOST']].compact.reject(&:empty?).freeze configure do diff --git a/lib/bingo.rb b/lib/bingo.rb index 010b651..a316852 100644 --- a/lib/bingo.rb +++ b/lib/bingo.rb @@ -53,6 +53,7 @@ module Bingo close: 'Закрыть', no_incidents: 'Инцидентов не зафиксировано.', credits_ai: 'Информация собрана и проверена с помощью Claude (Anthropic).', credits_hym: 'Спасибо %{link} (данные Cat Eyes OSINT) за часть списка: каждая запись перепроверена по сайтам операторов и прессе.', + source_code: 'Исходный код на GitHub', footer: 'Данные из открытых источников (2025–2026). Клетка зачёркивается только по публичному источнику.', kinds: { 'strike' => 'Атака БПЛА', 'fire' => 'Пожар', 'outage' => 'Отключение', 'flood' => 'Затопление', 'cooling' => 'Перегрев', 'other' => 'Инцидент' }, letters: %w[Б И Н Г О], @@ -83,6 +84,7 @@ module Bingo close: 'Close', no_incidents: 'No incidents recorded.', credits_ai: 'Information collected and verified with the help of Claude (Anthropic).', credits_hym: 'Thanks to %{link} (data by Cat Eyes OSINT) for part of the list; every entry was re-verified against operator sites and the press.', + source_code: 'Source code on GitHub', footer: 'Open-source data (2025–2026). A cell is crossed out only with a public source.', kinds: { 'strike' => 'Drone strike', 'fire' => 'Fire', 'outage' => 'Outage', 'flood' => 'Flood', 'cooling' => 'Overheating', 'other' => 'Incident' }, letters: %w[B I N G O], @@ -113,6 +115,7 @@ module Bingo close: 'Закрити', no_incidents: 'Інцидентів не зафіксовано.', credits_ai: 'Інформацію зібрано й перевірено за допомогою Claude (Anthropic).', credits_hym: 'Дякуємо %{link} (дані Cat Eyes OSINT) за частину списку: кожен запис перевірено за сайтами операторів і пресою.', + source_code: 'Вихідний код на GitHub', footer: 'Дані з відкритих джерел (2025–2026). Клітинка закреслюється лише за публічним джерелом.', kinds: { 'strike' => 'Атака БПЛА', 'fire' => 'Пожежа', 'outage' => 'Відключення', 'flood' => 'Затоплення', 'cooling' => 'Перегрів', 'other' => 'Інцидент' }, letters: %w[Б І Н Г О], diff --git a/test/bingo_test.rb b/test/bingo_test.rb index 98d1604..595b22f 100644 --- a/test/bingo_test.rb +++ b/test/bingo_test.rb @@ -333,6 +333,15 @@ class BingoTest < Minitest::Test refute_includes last_response.body, 'Second.' # no fallback across languages end + def test_footer_links_to_source + { 'ru' => 'Исходный код на GitHub', 'en' => 'Source code on GitHub', 'uk' => 'Вихідний код на GitHub' }.each do |l, text| + get "/#{l}" + assert_includes last_response.body, %(#{text}) + end + get '/en/dc/dc-1' + assert_includes last_response.body, 'github.com/asxpi/datacenterbingo' + end + def test_static_files_not_served get '/style.css' assert_equal 404, last_response.status diff --git a/views/_credits.erb b/views/_credits.erb deleted file mode 100644 index 2571b4c..0000000 --- a/views/_credits.erb +++ /dev/null @@ -1,2 +0,0 @@ -

<%= t(:credits_ai) %> - <%== format(Rack::Utils.escape_html(t(:credits_hym)), link: 'hackyourmom') %>

diff --git a/views/_footer.erb b/views/_footer.erb new file mode 100644 index 0000000..0e15a97 --- /dev/null +++ b/views/_footer.erb @@ -0,0 +1,6 @@ + diff --git a/views/dc.erb b/views/dc.erb index b63d6ba..a09c921 100644 --- a/views/dc.erb +++ b/views/dc.erb @@ -27,9 +27,5 @@

<%= t(:back) %>

- + <%== erb :_footer, layout: false %> diff --git a/views/index.erb b/views/index.erb index 099c7f4..4564708 100644 --- a/views/index.erb +++ b/views/index.erb @@ -84,11 +84,7 @@ - + <%== erb :_footer, layout: false %> <% b.cells.each do |dc| %>