diff --git a/app/controllers/admin/communication/websites_controller.rb b/app/controllers/admin/communication/websites_controller.rb index 959e547d19f7275e52d17a51b0b5cba18d2fa5d6..4c83bc938d0e182eaa38daacca27fb0834d09013 100644 --- a/app/controllers/admin/communication/websites_controller.rb +++ b/app/controllers/admin/communication/websites_controller.rb @@ -75,7 +75,7 @@ class Admin::Communication::WebsitesController < Admin::Communication::Websites: def website_params attribute_names = [ :name, :url, :repository, :access_token, :about_type, :about_id, :in_production, - :git_provider, :git_endpoint, :git_branch, :plausible_url, language_ids: [] + :git_provider, :git_endpoint, :git_branch, :plausible_url, :deployment_status_badge, language_ids: [] ] # For now, default language can't be changed, too many implications, especially around special pages. attribute_names << :default_language_id unless @website&.persisted? diff --git a/app/views/admin/communication/websites/_form.html.erb b/app/views/admin/communication/websites/_form.html.erb index 5433758d397df5aa490fa40cafba155d1158d0c8..53f3e1b6ac6f7e7af39f270ba185436f82b24a2c 100644 --- a/app/views/admin/communication/websites/_form.html.erb +++ b/app/views/admin/communication/websites/_form.html.erb @@ -19,6 +19,7 @@ <div class="col-xl-6"> <%= f.input :git_provider, include_blank: false %> <%= f.input :git_endpoint %> + <%= f.input :deployment_status_badge, as: :string %> </div> <div class="col-xl-6"> <%= f.input :access_token %> diff --git a/app/views/admin/communication/websites/show.html.erb b/app/views/admin/communication/websites/show.html.erb index dcce07ed02e0f973f972339622fa6de10e6b8312..e7be9bca63024a5e6f4f707ac27c34b4faf2ebf2 100644 --- a/app/views/admin/communication/websites/show.html.erb +++ b/app/views/admin/communication/websites/show.html.erb @@ -16,6 +16,7 @@ <%= render 'admin/communication/websites/sidebar' do %> <%= render 'admin/communication/websites/show/posts' if can? :read, Communication::Website::Post %> <%= render 'admin/communication/websites/show/pages' if can? :read, Communication::Website::Page %> + <%= image_tag @website.deployment_status_badge, alt: '' if @website.deployment_status_badge.present? %> <% end %> <% content_for :action_bar_left do %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index d13fae666830e6d6bc6ed99e20abcc7c80f2dfa9..707366c1f865bc277e411b23954c913cd0d6c323 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -133,6 +133,7 @@ en: access_token: Access token created_at: Creation default_language: Default language + deployment_status_badge: Deployment status badge git_branch: Git branch git_endpoint: Git endpoint git_provider: Git provider diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 441f6ccecd6c9b9215d1c2b697d81f25e1812f21..25668c9ee94b18c589331c33e6e7f77fed9a15c7 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -133,6 +133,7 @@ fr: access_token: Access token created_at: Création default_language: Langue par défaut + deployment_status_badge: Badge de statut du déploiement git_branch: Branche git_endpoint: Point d'accès Git git_provider: Provider Git diff --git a/db/migrate/20230704113222_add_status_to_communication_websites.rb b/db/migrate/20230704113222_add_status_to_communication_websites.rb new file mode 100644 index 0000000000000000000000000000000000000000..3c190207880016fcdf076092b5b05e067b68b2c6 --- /dev/null +++ b/db/migrate/20230704113222_add_status_to_communication_websites.rb @@ -0,0 +1,5 @@ +class AddStatusToCommunicationWebsites < ActiveRecord::Migration[7.0] + def change + add_column :communication_websites, :deployment_status_badge, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 53ef9884f8c238a1d7e493d9b79ab1da0ab666d2..548674c3aa1144c91760977417adf4b1fe8b34d7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_07_03_142438) do +ActiveRecord::Schema[7.0].define(version: 2023_07_04_113222) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -519,6 +519,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_03_142438) do t.boolean "in_production", default: false t.uuid "default_language_id", null: false t.string "theme_version", default: "NA" + t.text "deployment_status_badge" t.index ["about_type", "about_id"], name: "index_communication_websites_on_about" t.index ["default_language_id"], name: "index_communication_websites_on_default_language_id" t.index ["university_id"], name: "index_communication_websites_on_university_id"