diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index 4217d8a6c..3d28764e1 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 000000000..810bf72df --- /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 5f70dc42d..5078313f7 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? %>