From dca6cb3671eb6e3d4f5012f43a5ab34bd8a9cf19 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Tue, 11 Apr 2023 06:38:43 +0200
Subject: [PATCH] wip

---
 .../admin/application/a11y/_widget.html.erb   |  2 +-
 .../{_index_show.html.erb => _list.html.erb}  |  0
 .../_editor.html.erb}                         |  0
 .../posts/categories/preview.html.erb         |  2 +-
 .../extranets/posts/preview.html.erb          |  2 +-
 .../extranets/posts/show.html.erb             |  2 +-
 .../websites/categories/show.html.erb         |  2 +-
 .../websites/pages/preview.html.erb           |  2 +-
 .../websites/pages/show.html.erb              |  2 +-
 .../websites/posts/preview.html.erb           |  2 +-
 .../websites/posts/show.html.erb              |  8 ++---
 .../websites/posts/show/_metadata.html.erb    | 30 ++++++++++---------
 .../admin/education/diplomas/show.html.erb    |  2 +-
 .../admin/education/programs/preview.html.erb |  2 +-
 .../admin/education/programs/show.html.erb    |  2 +-
 .../research/journals/papers/show.html.erb    |  2 +-
 .../university/organizations/show.html.erb    |  2 +-
 .../university/people/_main_infos.html.erb    |  2 +-
 app/views/extranet/posts/posts/show.html.erb  |  2 +-
 19 files changed, 35 insertions(+), 33 deletions(-)
 rename app/views/admin/communication/blocks/{_index_show.html.erb => _list.html.erb} (100%)
 rename app/views/admin/communication/blocks/{_index_edit.html.erb => editor/_editor.html.erb} (100%)

diff --git a/app/views/admin/application/a11y/_widget.html.erb b/app/views/admin/application/a11y/_widget.html.erb
index d7b84583c..8643ced17 100644
--- a/app/views/admin/application/a11y/_widget.html.erb
+++ b/app/views/admin/application/a11y/_widget.html.erb
@@ -4,7 +4,7 @@ small ||= false
 %>
 <%= osuny_panel t('accessibility.label'), small: true do %>
   <% if horizontal %>
-    <div class="row"><div class="offset-lg-4 col-lg-8 pt-n4">
+    <div class="row"><div class="offset-lg-4 col-lg-8 mt-n4">
   <% end %>
   <% if about.accessibility_errors.any? %>
     <p class="text-danger">
diff --git a/app/views/admin/communication/blocks/_index_show.html.erb b/app/views/admin/communication/blocks/_list.html.erb
similarity index 100%
rename from app/views/admin/communication/blocks/_index_show.html.erb
rename to app/views/admin/communication/blocks/_list.html.erb
diff --git a/app/views/admin/communication/blocks/_index_edit.html.erb b/app/views/admin/communication/blocks/editor/_editor.html.erb
similarity index 100%
rename from app/views/admin/communication/blocks/_index_edit.html.erb
rename to app/views/admin/communication/blocks/editor/_editor.html.erb
diff --git a/app/views/admin/communication/extranets/posts/categories/preview.html.erb b/app/views/admin/communication/extranets/posts/categories/preview.html.erb
index 556e4ae55..99d37c119 100644
--- a/app/views/admin/communication/extranets/posts/categories/preview.html.erb
+++ b/app/views/admin/communication/extranets/posts/categories/preview.html.erb
@@ -1,3 +1,3 @@
 <% content_for :title, @post.title %>
 <% content_for :image, kamifusen_tag(@post.featured_image) if @post.featured_image.attached? %>
-<%= render 'admin/communication/blocks/index_show', about: @post %>
+<%= render 'admin/communication/blocks/list', about: @post %>
diff --git a/app/views/admin/communication/extranets/posts/preview.html.erb b/app/views/admin/communication/extranets/posts/preview.html.erb
index 556e4ae55..99d37c119 100644
--- a/app/views/admin/communication/extranets/posts/preview.html.erb
+++ b/app/views/admin/communication/extranets/posts/preview.html.erb
@@ -1,3 +1,3 @@
 <% content_for :title, @post.title %>
 <% content_for :image, kamifusen_tag(@post.featured_image) if @post.featured_image.attached? %>
-<%= render 'admin/communication/blocks/index_show', about: @post %>
+<%= render 'admin/communication/blocks/list', about: @post %>
diff --git a/app/views/admin/communication/extranets/posts/show.html.erb b/app/views/admin/communication/extranets/posts/show.html.erb
index cd49d50bd..823c70c0b 100644
--- a/app/views/admin/communication/extranets/posts/show.html.erb
+++ b/app/views/admin/communication/extranets/posts/show.html.erb
@@ -4,7 +4,7 @@
   <div class="row">
     <div class="col-xl-8">
       <%= render 'admin/application/summary/show', about: @post %>
-      <%= render 'admin/communication/blocks/index_edit', about: @post %>
+      <%= render 'admin/communication/blocks/editor/editor', about: @post %>
     </div>
     <div class="col-xl-4">
       <%
diff --git a/app/views/admin/communication/websites/categories/show.html.erb b/app/views/admin/communication/websites/categories/show.html.erb
index 99f034375..a9195f0ea 100644
--- a/app/views/admin/communication/websites/categories/show.html.erb
+++ b/app/views/admin/communication/websites/categories/show.html.erb
@@ -4,7 +4,7 @@
   <div class="row">
     <div class="col-md-8">
       <%= render 'admin/application/summary/show', about: @category %>
-      <%= render 'admin/communication/blocks/index_edit', about: @category %>
+      <%= render 'admin/communication/blocks/editor/editor', about: @category %>
     </div>
     <div class="col-md-4">
       <%= render 'admin/application/i18n/widget', about: @category %>
diff --git a/app/views/admin/communication/websites/pages/preview.html.erb b/app/views/admin/communication/websites/pages/preview.html.erb
index e61751b88..ccf5a659a 100644
--- a/app/views/admin/communication/websites/pages/preview.html.erb
+++ b/app/views/admin/communication/websites/pages/preview.html.erb
@@ -1,3 +1,3 @@
 <% content_for :title, @page.title %>
 <% content_for :image, kamifusen_tag(@page.best_featured_image) if @page.best_featured_image.attached? %>
-<%= render 'admin/communication/blocks/index_show', about: @page %>
+<%= render 'admin/communication/blocks/list', about: @page %>
diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb
index 54cd979bd..8aff4d572 100644
--- a/app/views/admin/communication/websites/pages/show.html.erb
+++ b/app/views/admin/communication/websites/pages/show.html.erb
@@ -6,7 +6,7 @@
   <%= render 'admin/application/a11y/widget', about: @page, horizontal: true, small: true %>
   <hr class="my-5">
   <%= render 'admin/communication/websites/pages/show/details' %>
-  <%= render 'admin/communication/blocks/index_edit', about: @page %>
+  <%= render 'admin/communication/blocks/editor/editor', about: @page %>
 <% end %>
 
 <%= render 'admin/application/dependencies',
diff --git a/app/views/admin/communication/websites/posts/preview.html.erb b/app/views/admin/communication/websites/posts/preview.html.erb
index 556e4ae55..99d37c119 100644
--- a/app/views/admin/communication/websites/posts/preview.html.erb
+++ b/app/views/admin/communication/websites/posts/preview.html.erb
@@ -1,3 +1,3 @@
 <% content_for :title, @post.title %>
 <% content_for :image, kamifusen_tag(@post.featured_image) if @post.featured_image.attached? %>
-<%= render 'admin/communication/blocks/index_show', about: @post %>
+<%= render 'admin/communication/blocks/list', about: @post %>
diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb
index 619fa1dfb..e43670e95 100644
--- a/app/views/admin/communication/websites/posts/show.html.erb
+++ b/app/views/admin/communication/websites/posts/show.html.erb
@@ -11,20 +11,20 @@
       <%= render 'admin/application/featured_image/show', about: @post %>
     </div>
   </div>
-  <hr class="my-5">
+  <hr class="mb-5">
   <%= render 'admin/application/a11y/widget', about: @post, horizontal: true %>
-  <hr class="my-5">
+  <hr class="mb-5">
   <div class="row">
     <div class="col-lg-4">
       <%= render 'admin/communication/websites/posts/show/metadata' %>
-      <%= render 'admin/application/i18n/widget', about: @post %>
+      <%= render 'admin/application/i18n/widget', about: @post, small: true %>
     </div>
     <div class="col-lg-8">
       <%= render 'admin/application/summary/show', about: @post %>
       <%= render 'admin/application/meta_description/show', about: @post %>
     </div>
   </div>
-  <%= render 'admin/communication/blocks/index_edit', about: @post %>
+  <%= render 'admin/communication/blocks/editor/editor', about: @post %>
 <% end %>
 
 <% content_for :action_bar_left do %>
diff --git a/app/views/admin/communication/websites/posts/show/_metadata.html.erb b/app/views/admin/communication/websites/posts/show/_metadata.html.erb
index 6e13f96c9..00644de83 100644
--- a/app/views/admin/communication/websites/posts/show/_metadata.html.erb
+++ b/app/views/admin/communication/websites/posts/show/_metadata.html.erb
@@ -1,15 +1,17 @@
-<%= osuny_label t('metadata') %><br>
-<% if @post.published %>
-  Publié le <%= l @post.published_at.to_date %>
-  <% if @post.pinned %>
-    et mis en avant
+<div class="mb-4">
+  <%= osuny_label t('metadata') %><br>
+  <% if @post.published %>
+    Publié le <%= l @post.published_at.to_date %>
+    <% if @post.pinned %>
+      et mis en avant
+    <% end %>
+  <% else %>
+    Brouillon
   <% end %>
-<% else %>
-  Brouillon
-<% end %>
-<% if @post.author %>
-  <br>par <%= @post.author %>
-<% end %>
-<% if @post.categories.any? %>
-  <br>dans <%= @post.categories.collect(&:to_s).join(', ') %>
-<% end %>
+  <% if @post.author %>
+    <br>par <%= @post.author %>
+  <% end %>
+  <% if @post.categories.any? %>
+    <br>dans <%= @post.categories.collect(&:to_s).join(', ') %>
+  <% end %>
+</div>
\ No newline at end of file
diff --git a/app/views/admin/education/diplomas/show.html.erb b/app/views/admin/education/diplomas/show.html.erb
index 66a4783f0..5a3743f6f 100644
--- a/app/views/admin/education/diplomas/show.html.erb
+++ b/app/views/admin/education/diplomas/show.html.erb
@@ -3,7 +3,7 @@
 <div class="row">
   <div class="col-xl-8">
     <%= render 'admin/application/summary/show', about: @diploma %>
-    <%= render 'admin/communication/blocks/index_edit', about: @diploma %>
+    <%= render 'admin/communication/blocks/editor/editor', about: @diploma %>
     <%= osuny_panel Education::Diploma.human_attribute_name('programs') do %>
       <%= render 'admin/education/programs/list', programs: @programs, hide_diploma: true %>
     <% end %>
diff --git a/app/views/admin/education/programs/preview.html.erb b/app/views/admin/education/programs/preview.html.erb
index 323ed783f..dc3cd6233 100644
--- a/app/views/admin/education/programs/preview.html.erb
+++ b/app/views/admin/education/programs/preview.html.erb
@@ -49,7 +49,7 @@
 </section>
 
 <div class="blocks">
-  <%= render 'admin/communication/blocks/index_show', about: @program %>
+  <%= render 'admin/communication/blocks/list', about: @program %>
 </div>
 
 <section id="pedagogy">
diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb
index 8aa046bd9..f59732de4 100644
--- a/app/views/admin/education/programs/show.html.erb
+++ b/app/views/admin/education/programs/show.html.erb
@@ -51,7 +51,7 @@
         </div>
       </div>
     <% end %>
-    <%= render 'admin/communication/blocks/index_edit', about: @program %>
+    <%= render 'admin/communication/blocks/editor/editor', about: @program %>
     <hr class="pure__separation">
     <%= render 'admin/education/programs/forms/part', part: :pedagogy, collapsed: true do %>
       <div class="row">
diff --git a/app/views/admin/research/journals/papers/show.html.erb b/app/views/admin/research/journals/papers/show.html.erb
index 444e6207a..c58219be8 100644
--- a/app/views/admin/research/journals/papers/show.html.erb
+++ b/app/views/admin/research/journals/papers/show.html.erb
@@ -22,7 +22,7 @@
           <%= sanitize @paper.references %>
         <% end %>
       <% end %>
-      <%= render 'admin/communication/blocks/index_edit', about: @paper %>
+      <%= render 'admin/communication/blocks/editor/editor', about: @paper %>
       <%= render 'admin/application/dependencies',
                   git_dependencies: @paper.git_dependencies(@paper.journal.websites.first),
                   active_storage_blobs: @paper.active_storage_blobs %>
diff --git a/app/views/admin/university/organizations/show.html.erb b/app/views/admin/university/organizations/show.html.erb
index 3995a9c11..decf2c83e 100644
--- a/app/views/admin/university/organizations/show.html.erb
+++ b/app/views/admin/university/organizations/show.html.erb
@@ -81,7 +81,7 @@
       </div>
     <% end %>
 
-    <%= render 'admin/communication/blocks/index_edit', about: @organization %>
+    <%= render 'admin/communication/blocks/editor/editor', about: @organization %>
   </div>
 
   <div class="col-md-4">
diff --git a/app/views/admin/university/people/_main_infos.html.erb b/app/views/admin/university/people/_main_infos.html.erb
index 2fadaf7c7..6c09d9ad4 100644
--- a/app/views/admin/university/people/_main_infos.html.erb
+++ b/app/views/admin/university/people/_main_infos.html.erb
@@ -69,7 +69,7 @@
       <% end %>
     <% end unless person.url.blank? && person.linkedin.blank? && person.twitter.blank? %>
 
-    <%= render 'admin/communication/blocks/index_edit', about: person %>
+    <%= render 'admin/communication/blocks/editor/editor', about: person %>
   </div>
   <div class="col-md-4 col-xl-3">
     <%= osuny_panel t('metadata') do %>
diff --git a/app/views/extranet/posts/posts/show.html.erb b/app/views/extranet/posts/posts/show.html.erb
index d7bac998f..bb7f6c728 100644
--- a/app/views/extranet/posts/posts/show.html.erb
+++ b/app/views/extranet/posts/posts/show.html.erb
@@ -23,5 +23,5 @@
 <% end %>
 
 </main>
-<%= render 'admin/communication/blocks/index_show', about: @post %>
+<%= render 'admin/communication/blocks/list', about: @post %>
 <main>
-- 
GitLab