From 12665a03832defd7f920362f55bbc2cd62fdf68a Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Fri, 3 Feb 2023 15:07:35 +0100
Subject: [PATCH] panels

---
 app/views/admin/communication/blocks/new.html.erb    |  4 ++--
 app/views/admin/education/programs/show.html.erb     |  7 ++-----
 .../admin/education/programs/show/_cohorts.html.erb  | 12 +++---------
 3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/app/views/admin/communication/blocks/new.html.erb b/app/views/admin/communication/blocks/new.html.erb
index 0676c2d09..248ef51bb 100644
--- a/app/views/admin/communication/blocks/new.html.erb
+++ b/app/views/admin/communication/blocks/new.html.erb
@@ -14,9 +14,9 @@
         %>
         <% next unless template.allowed_for_about? %>
         <div class="col-xxl-2 col-lg-3 col-md-4 d-flex">
-          <div class="<%= 'card' if current_admin_theme == 'appstack' %> flex-fill position-relative js-validate-form-click">
+          <div class="<%= if_appstack 'card' %> flex-fill position-relative js-validate-form-click">
             <%= image_tag "communication/blocks/templates/#{kind}.jpg", alt: '', class:"card-img-top block__image" %>
-            <div class="<%= 'card-body' if current_admin_theme == 'appstack' %>">
+            <div class="<%= if_appstack 'card-body' %>">
                 <h3 class="h4 block__title"><%= t "enums.communication.block.template_kind.#{kind}" %></h4>
                 <p class="mb-0 block__description">
                   <%= t "admin.communication.blocks.templates.#{kind}.description" %>
diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb
index 9a06e4265..8fd6930ba 100644
--- a/app/views/admin/education/programs/show.html.erb
+++ b/app/views/admin/education/programs/show.html.erb
@@ -117,12 +117,9 @@
     <% end %>
 
     <% if @program.children.any? %>
-      <div class="card flex-fill w-100">
-        <div class="card-header">
-          <h5 class="card-title mb-0"><%= Education::Program.model_name.human(count: 2) %></h5>
-        </div>
+      <%= osuny_panel Education::Program.model_name.human(count: 2) do %>
         <%= render 'admin/education/programs/list', programs: @program.children %>
-      </div>
+      <% end %>
     <% end %>
 
     <%= render 'admin/education/programs/show/cohorts' %>
diff --git a/app/views/admin/education/programs/show/_cohorts.html.erb b/app/views/admin/education/programs/show/_cohorts.html.erb
index 2abde6f5b..7fe9783c8 100644
--- a/app/views/admin/education/programs/show/_cohorts.html.erb
+++ b/app/views/admin/education/programs/show/_cohorts.html.erb
@@ -1,12 +1,6 @@
 <% if @program.cohorts.any? %>
-  <div class="card flex-fill w-100">
-    <div class="card-header">
-      <div class="float-end">
-        <%= @program.alumni.count %>
-        <%= University::Person::Alumnus.model_name.human(count: 2).downcase %>
-      </div>
-      <h5 class="card-title mb-0"><%= Education::Cohort.model_name.human(count: 2) %></h5>
-    </div>
+  <%= osuny_panel Education::Cohort.model_name.human(count: 2),
+                  subtitle: "#{@program.alumni.count} #{University::Person::Alumnus.model_name.human(count: @program.alumni.count).downcase}" do %>
     <div class="table-responsive">
       <table class="<%= table_classes %>">
         <thead>
@@ -32,5 +26,5 @@
         </tbody>
       </table>
     </div>
-  </div>
+  <% end %>
 <% end %>
-- 
GitLab