From b2a1df5f7ab45e7086c22ecff6d2b3161daaaf39 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <arnaud.levy@noesya.coop>
Date: Sun, 24 Nov 2024 11:48:10 +0100
Subject: [PATCH] =?UTF-8?q?Utilisation=20des=20interrupteurs=20plut=C3=B4t?=
 =?UTF-8?q?=20que=20les=20cases=20=C3=A0=20cocher=20(#2447)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/views/admin/application/static/_design.html.erb         | 3 ---
 .../communication/blocks/components/boolean/_edit.html.erb  | 2 +-
 .../communication/blocks/templates/posts/_edit.html.erb     | 2 +-
 .../communication/websites/agenda/events/_form.html.erb     | 3 ++-
 app/views/admin/communication/websites/pages/_form.html.erb | 3 ++-
 .../websites/portfolio/projects/_form.html.erb              | 3 ++-
 app/views/admin/communication/websites/posts/_form.html.erb | 6 +++---
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/app/views/admin/application/static/_design.html.erb b/app/views/admin/application/static/_design.html.erb
index 509ad3388..220982d70 100644
--- a/app/views/admin/application/static/_design.html.erb
+++ b/app/views/admin/application/static/_design.html.erb
@@ -6,9 +6,6 @@ toc_offcanvas = local_assigns.has_key?(:toc_offcanvas)  ? local_assigns[:toc_off
 toc_present = local_assigns.has_key?(:toc_present)      ? local_assigns[:toc_present]
                                                         : l10n.show_toc?
 %>
-<% # legacy, please remove when site migrated %>
-full_width: <%= full_width %>
-<% # end of legacy%>
 design:
   full_width: <%= full_width %>
   toc:
diff --git a/app/views/admin/communication/blocks/components/boolean/_edit.html.erb b/app/views/admin/communication/blocks/components/boolean/_edit.html.erb
index baf464e4a..bdf510125 100644
--- a/app/views/admin/communication/blocks/components/boolean/_edit.html.erb
+++ b/app/views/admin/communication/blocks/components/boolean/_edit.html.erb
@@ -1,4 +1,4 @@
-<div class="form-check">
+<div class="form-check form-switch">
   <input  :id="<%= dom_id.html_safe %>"
           class="form-check-input"
           v-model="<%= model %>.<%= property %>"
diff --git a/app/views/admin/communication/blocks/templates/posts/_edit.html.erb b/app/views/admin/communication/blocks/templates/posts/_edit.html.erb
index 729b3fe76..50d26366f 100644
--- a/app/views/admin/communication/blocks/templates/posts/_edit.html.erb
+++ b/app/views/admin/communication/blocks/templates/posts/_edit.html.erb
@@ -7,7 +7,7 @@
     <%= block_component_edit block, :option_image, label: Communication::Website::Post::Localization.human_attribute_name(:featured_image) %>
     <%= block_component_edit block, :option_subtitle, label: Communication::Website::Post::Localization.human_attribute_name(:subtitle) %>
     <%= block_component_edit block, :option_summary, label: t('admin.summary.label') %>
-    <%= block_component_edit block, :option_author, label: Communication::Website::Post.human_attribute_name(:author) %>
+    <%= block_component_edit block, :option_author, label: Communication::Website::Post.human_attribute_name(:authors) %>
     <%= block_component_edit block, :option_date, label: Communication::Website::Post::Localization.human_attribute_name(:date) %>
     <%= block_component_edit block, :option_categories, label: Communication::Website::Post.human_attribute_name(:categories) %>
     <%= block_component_edit block, :option_reading_time, label: Communication::Website::Post::Localization.human_attribute_name(:reading_time) %>
diff --git a/app/views/admin/communication/websites/agenda/events/_form.html.erb b/app/views/admin/communication/websites/agenda/events/_form.html.erb
index 8ca620d72..3ca8ba8ee 100644
--- a/app/views/admin/communication/websites/agenda/events/_form.html.erb
+++ b/app/views/admin/communication/websites/agenda/events/_form.html.erb
@@ -40,7 +40,8 @@
       </div>
       <div class="col-md-4">
         <%= osuny_panel t('metadata') do %>
-          <%= lf.input :published if can? :publish, event %>
+          <%= lf.input :published,
+                        wrapper: :custom_boolean_switch if can? :publish, event %>
           <%= render  "admin/application/slug/form",
                       f: lf,
                       source: '#communication_website_agenda_event_localizations_attributes_0_title' %>
diff --git a/app/views/admin/communication/websites/pages/_form.html.erb b/app/views/admin/communication/websites/pages/_form.html.erb
index 4b07e3bf9..884c4e5f4 100644
--- a/app/views/admin/communication/websites/pages/_form.html.erb
+++ b/app/views/admin/communication/websites/pages/_form.html.erb
@@ -30,7 +30,8 @@ url = page.new_record?  ? admin_communication_website_pages_path
       </div>
       <div class="col-md-4">
         <%= osuny_panel t('metadata') do %>
-          <%= lf.input :published if page.draftable? %>
+          <%= lf.input :published,
+                        wrapper: :custom_boolean_switch if page.draftable? %>
           <%= render  "admin/application/slug/form",
                       f: lf,
                       source: '#communication_website_page_localizations_attributes_0_title' unless page.is_home? %>
diff --git a/app/views/admin/communication/websites/portfolio/projects/_form.html.erb b/app/views/admin/communication/websites/portfolio/projects/_form.html.erb
index 7f304a6e7..8d5db630d 100644
--- a/app/views/admin/communication/websites/portfolio/projects/_form.html.erb
+++ b/app/views/admin/communication/websites/portfolio/projects/_form.html.erb
@@ -17,7 +17,8 @@
       </div>
       <div class="col-md-4">
         <%= osuny_panel t('metadata') do %>
-          <%= lf.input :published if can? :publish, project %>
+          <%= lf.input :published,
+                        wrapper: :custom_boolean_switch if can? :publish, project %>
           <%= f.input :year %>
           <%= render  "admin/application/slug/form",
                       f: lf,
diff --git a/app/views/admin/communication/websites/posts/_form.html.erb b/app/views/admin/communication/websites/posts/_form.html.erb
index befbf6f16..55b798a9a 100644
--- a/app/views/admin/communication/websites/posts/_form.html.erb
+++ b/app/views/admin/communication/websites/posts/_form.html.erb
@@ -21,10 +21,10 @@
           <% if can? :publish, post %>
             <div class="row pure__row--small">
               <div class="col-6">
-                <%= lf.input :published %>
+                <%= lf.input :published, wrapper: :custom_boolean_switch %>
               </div>
               <div class="col-6">
-                <%= lf.input :pinned %>
+                <%= lf.input :pinned, wrapper: :custom_boolean_switch %>
               </div>
             </div>
             <%= lf.input :published_at, html5: true, as: :date %>
@@ -42,7 +42,7 @@
           <%= render  "admin/application/slug/form",
                       f: lf,
                       source: '#communication_website_post_localizations_attributes_0_title' %>
-          <%= f.input :full_width %>
+          <%= f.input :full_width, wrapper: :custom_boolean_switch %>
         <% end %>
         <%= render 'admin/application/featured_image/edit', f: lf, about: @l10n %>
         <%= render 'admin/application/shared_image/edit', f: lf, about: @l10n %>
-- 
GitLab