From 978a84c02d6f2366f934a1cacf9488e1ae63e3b9 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Wed, 21 Oct 2026 12:43:06 +0200 Subject: [PATCH] =?UTF-8?q?Badge=20unifi=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/communication/website.rb | 1 + .../website/with_status_badge.rb | 11 ++++++ .../websites/show/_badge.html.erb | 38 +++++++++---------- app/views/server/websites/_list.html.erb | 3 +- 4 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 app/models/communication/website/with_status_badge.rb diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index 4217d8a6c6..3d28764e14 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -106,6 +106,7 @@ class Communication::Website < ApplicationRecord include WithScreenshot include WithSecurity include WithShowcase + include WithStatusBadge include WithStyle include WithTheme include WithTimeZone diff --git a/app/models/communication/website/with_status_badge.rb b/app/models/communication/website/with_status_badge.rb new file mode 100644 index 0000000000..810bf72dfb --- /dev/null +++ b/app/models/communication/website/with_status_badge.rb @@ -0,0 +1,11 @@ +module Communication::Website::WithStatusBadge + extend ActiveSupport::Concern + + def status_badge? + kelmscott_active? || deployment_status_badge.present? + end + + def status_badge_url + kelmscott_active? ? kelmscott_badge_url : deployment_status_badge + end +end diff --git a/app/views/admin/communication/websites/show/_badge.html.erb b/app/views/admin/communication/websites/show/_badge.html.erb index 5f70dc42d6..5078313f7d 100644 --- a/app/views/admin/communication/websites/show/_badge.html.erb +++ b/app/views/admin/communication/websites/show/_badge.html.erb @@ -1,28 +1,26 @@ <% if website.repository.present? %>