diff --git a/app/assets/stylesheets/admin/appstack/style.sass b/app/assets/stylesheets/admin/appstack/style.sass index d0c9e8f1e2a46a76709b6d74798a105955c25e44..207823f0709c5b38e9fad68fc66c895cb186a228 100644 --- a/app/assets/stylesheets/admin/appstack/style.sass +++ b/app/assets/stylesheets/admin/appstack/style.sass @@ -22,6 +22,10 @@ main.content @include media-breakpoint-up(lg) left: 260px +.category + font-size: 16px + margin-bottom: 24px + margin-top: 48px .card-footer .pagination diff --git a/app/assets/stylesheets/admin/pure/style.sass b/app/assets/stylesheets/admin/pure/style.sass index 2200d7a0fb31d5e23bb1ee937cdd543e3f50e5cc..b0f661a69219b1d8deec0e69e0665e9cbec6a111 100644 --- a/app/assets/stylesheets/admin/pure/style.sass +++ b/app/assets/stylesheets/admin/pure/style.sass @@ -56,7 +56,7 @@ main h2 font-weight: bold -.section +.category border-bottom: 1px solid $color-border font-size: $h5-font-size font-weight: normal @@ -65,7 +65,7 @@ h2 padding-bottom: $spacing0 text-transform: uppercase -.row-small +.pure__row--small margin-left: calc(-.5 * #{$spacing1}) margin-right: calc(-.5 * #{$spacing1}) > * diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index 81df5fccd9cee15bd8b449d22719afbd2d905ef7..976bd721d258bf514b36e017f3dbc8fa983b8d05 100644 --- a/app/helpers/admin/application_helper.rb +++ b/app/helpers/admin/application_helper.rb @@ -45,6 +45,17 @@ module Admin::ApplicationHelper aria-controls=\"preview\">#{ t 'preview.button'}</button>" end + def panel(title: nil, subtitle: nil, action: nil, &block) + render layout: "admin/layouts/themes/#{current_admin_theme}/panel", + locals: { + title: title, + subtitle: subtitle, + action: action + } do + capture(&block) + end + end + def duplicate_link(object) return unless can?(:update, object) link_to t('admin.duplicate'), diff --git a/app/views/admin/communication/blocks/components/layout/_edit.html.erb b/app/views/admin/communication/blocks/components/layout/_edit.html.erb index 61cfd7982da4dd2b0bc76da6d1a297c5b5046bcd..a6b572ac9892da9356ffc4ebc5b4b57e058c3430 100644 --- a/app/views/admin/communication/blocks/components/layout/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/layout/_edit.html.erb @@ -15,7 +15,7 @@ layouts = template.class.layouts </a> </p> -<div class="row row-small collapse" id="layouts"> +<div class="row pure__row--small collapse" id="layouts"> <% layouts.each do |layout| %> <% i18n = "admin.communication.blocks.templates.#{template.kind}.layouts.#{layout}" @@ -25,7 +25,7 @@ layouts = template.class.layouts <div class="col-xxl-6"> <div class="card mb-4"> <label for="layout-<%= layout %>"> - <div class="row row-small"> + <div class="row pure__row--small"> <div class="col-8 col-xxl-6"> <div class="card-body"> <div class="form-check"> diff --git a/app/views/admin/communication/blocks/edit.html.erb b/app/views/admin/communication/blocks/edit.html.erb index b88d674bfd550b32169e9a73bd75096eb8ea5a72..e537888e3063a5b7e4515bbdfe133783668f4b68 100644 --- a/app/views/admin/communication/blocks/edit.html.erb +++ b/app/views/admin/communication/blocks/edit.html.erb @@ -9,7 +9,7 @@ <div class="row"> <div class="col-xxl-9 col-lg-8"> - <div class="row row-small"> + <div class="row pure__row--small"> <div class="col-lg-6"> <%= f.input :title %> </div> diff --git a/app/views/admin/communication/blocks/new.html.erb b/app/views/admin/communication/blocks/new.html.erb index bfe43bae6732920d0dee5d981450474f09e945eb..975d546fd8c4b96de1158cab645b5371e2419ff9 100644 --- a/app/views/admin/communication/blocks/new.html.erb +++ b/app/views/admin/communication/blocks/new.html.erb @@ -7,7 +7,7 @@ <p class="text-end lead"><%= t "admin.communication.blocks.categories.#{category}.description" %></p> </div> <hr class="mt-0"> - <div class="row row-small"> + <div class="row pure__row--small"> <% kinds.each do |kind| %> <% @block.template_reset! diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb index d49dca48fa5926e92e49ffdaed1cec32fce37b07..8536cd91acfdbdded821b40802678761ed59b405 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small mb-5"> +<div class="row pure__row--small mb-5"> <div class="col-md-6"> <div class="summernote"> <%= block_component_edit :text, diff --git a/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb b/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb index c815514dc61d4176f0f071448b3fda148b2b7dd6..bd17197b00a13b5aba56ee63ecca98b15017d087 100644 --- a/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb @@ -1,6 +1,6 @@ <%= block_component_edit :layout %> -<div class="row row-small mb-4"> +<div class="row pure__row--small mb-4"> <div class="col-xxl-8"> <%= block_component_edit :text %> <%= block_component_edit :notes %> diff --git a/app/views/admin/communication/blocks/templates/contact/_edit.html.erb b/app/views/admin/communication/blocks/templates/contact/_edit.html.erb index 00ad2614796b23237de396b470793f8aede45146..4b5d8277cc6f4bafc9c1290c8c0dad86a63d27ea 100644 --- a/app/views/admin/communication/blocks/templates/contact/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/contact/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> diff --git a/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb b/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb index 7686558bf5885ea4ad17d3561d5a95deaa9fc6ad..546c3eaa3fb8f86e7253fd23949ec2bfd4a35d14 100644 --- a/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> diff --git a/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb b/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb index 6b669d85c6866b340edab9835085220e74e1fc4b..acf892a73e2e6eea8ea5c2fd740d94d23b04d0ad 100644 --- a/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> diff --git a/app/views/admin/communication/blocks/templates/embed/_edit.html.erb b/app/views/admin/communication/blocks/templates/embed/_edit.html.erb index c66f6ae0acbd200de8eb35fc94b7100e3343992b..b653c9f7346ec2574797192fdb6c3ec4fb97dbd6 100644 --- a/app/views/admin/communication/blocks/templates/embed/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/embed/_edit.html.erb @@ -1,9 +1,9 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-md-6"> <p class="text-danger lead"><%= t '.warning' %></p> </div> </div> -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-md-6"> <%= block_component_edit :code %> </div> diff --git a/app/views/admin/communication/blocks/templates/files/_edit.html.erb b/app/views/admin/communication/blocks/templates/files/_edit.html.erb index b7cf262a2498b06a71017039cabb9592684d5bf9..dd7c974b6f0273f86a2a06b7b664548a65164673 100644 --- a/app/views/admin/communication/blocks/templates/files/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/files/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> @@ -6,7 +6,7 @@ <%= block_component_add_element t('.add_file') %> -<draggable :list="data.elements" handle=".dragHandle" class="row row-small"> +<draggable :list="data.elements" handle=".dragHandle" class="row pure__row--small"> <div v-for="(element, index) in data.elements" class="col-md-4"> <div class="card"> <div class="card-header border-bottom"> diff --git a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb index 555dfbaaef15d788e703f67d8d5ca94ad102c900..f3a67262ffd83aa59d8686fd05757949e19c7497 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> @@ -11,7 +11,7 @@ <p>Déplacer les images ci-dessous pour les mettre dans l'ordre souhaité</p> - <draggable :list="data.elements" class="row row-small"> + <draggable :list="data.elements" class="row pure__row--small"> <div v-for="(element, index) in data.elements" class="col-xxl-1 col-lg-2 col-4"> <div class="card"> <div class="card-header p-1 text-center"> diff --git a/app/views/admin/communication/blocks/templates/image/_edit.html.erb b/app/views/admin/communication/blocks/templates/image/_edit.html.erb index 107fd237fe5e1328fad41297cda22fba92e01b0a..e4a5433e6477ec1f69b3767cff16b8f808fc39d6 100644 --- a/app/views/admin/communication/blocks/templates/image/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/image/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-md-6"> <%= block_component_edit :image %> </div> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb index b0b070e009395ccb9a65557fdabfa94e3fa8c678..d3326874eea26998e8bccb4ec468c811d0855a12 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> diff --git a/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb b/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb index 1814ee1a5b7e56c4934ed41c66f3ec374df3082f..5997f3dcebf51be5f0ad6bcfbb8a735cca8b06b7 100644 --- a/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> diff --git a/app/views/admin/communication/blocks/templates/pages/_edit.html.erb b/app/views/admin/communication/blocks/templates/pages/_edit.html.erb index eef4145c861c02b6118d807f9900f83a4f8c27f8..115ca7b2936d2fd00a0a329c671781bcf016fd00 100644 --- a/app/views/admin/communication/blocks/templates/pages/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/pages/_edit.html.erb @@ -2,7 +2,7 @@ <%= block_component_edit :layout %> -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-lg-6"> <div class="mb-5"> <%= block_component_edit :mode %> diff --git a/app/views/admin/communication/blocks/templates/partners/_edit.html.erb b/app/views/admin/communication/blocks/templates/partners/_edit.html.erb index 552fee473ecfe476cbc16cd5f360f06439038134..8decbfa3caaddeebce784f87c7586e08808659a4 100644 --- a/app/views/admin/communication/blocks/templates/partners/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/partners/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-xl-6"> <%= block_component_edit :description %> </div> 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 5d81b6649d056b27086ee0f0c8c5f7abcf4b64d6..bfaa46d91ff1aeb8ace74b158f4df59f9d011fdc 100644 --- a/app/views/admin/communication/blocks/templates/posts/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/posts/_edit.html.erb @@ -4,7 +4,7 @@ <div class="mb-3"> <%= block_component_edit :mode %> - <div class="row row-small"> + <div class="row pure__row--small"> <div v-if="data.mode === 'category' || data.mode === 'all'" class="col-lg-3"> <%= block_component_edit :posts_quantity %> </div> diff --git a/app/views/admin/communication/blocks/templates/programs/_edit.html.erb b/app/views/admin/communication/blocks/templates/programs/_edit.html.erb index 3dd1978b5e56057d5131e0ac82d4f812937ad3cb..16b83310392d5b0cff88581abfbd659faa7456df 100644 --- a/app/views/admin/communication/blocks/templates/programs/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/programs/_edit.html.erb @@ -1,6 +1,6 @@ <% pages = collection_tree(@block.university.programs) %> -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-lg-6"> <div class="mb-4"> <%= block_component_add_element t('.add') %> diff --git a/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb b/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb index e5e4e16e41a7e493b0045ee5a3791f118843d563..c31511b79de89dc7b42349cd1518639dcafc31d7 100644 --- a/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb @@ -1,6 +1,6 @@ <%= block_component_add_element t('.add_testimonial') %> -<draggable :list="data.elements" handle=".dragHandle" class="row row-small"> +<draggable :list="data.elements" handle=".dragHandle" class="row pure__row--small"> <div v-for="(element, index) in data.elements" class="list-group-item"> <div class="d-flex"> <div> diff --git a/app/views/admin/communication/blocks/templates/video/_edit.html.erb b/app/views/admin/communication/blocks/templates/video/_edit.html.erb index 58e2a9d648297a6cc15f69d508bd75dfe2046bc0..33fb783148a95d9e5d4a1bb56871b0bed8905c97 100644 --- a/app/views/admin/communication/blocks/templates/video/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/video/_edit.html.erb @@ -1,4 +1,4 @@ -<div class="row row-small"> +<div class="row pure__row--small"> <div class="col-md-6"> <%= block_component_edit :url %> <%= block_component_edit :video_title %> diff --git a/app/views/admin/communication/websites/menus/items/_form.html.erb b/app/views/admin/communication/websites/menus/items/_form.html.erb index 2a1fce91e29fa47b238ca2c854ad246a875e800e..fd977e794c0002efccc44992949e1f295bc0d0ad 100644 --- a/app/views/admin/communication/websites/menus/items/_form.html.erb +++ b/app/views/admin/communication/websites/menus/items/_form.html.erb @@ -6,7 +6,7 @@ <%= f.input :parent_id, as: :hidden, wrapper: false %> <h2 class="h3"><%= t('content') %></h2> <div class="card-body"> - <div class="row row-small"> + <div class="row pure__row--small"> <div class="col-lg-6"> <%= f.input :title %> </div> @@ -57,7 +57,7 @@ <%= Communication::Website::Menu::Item.human_attribute_name('kind') %> <abbr title="required">*</abbr> </label> - <div class="row row-small"> + <div class="row pure__row--small"> <% @website.menu_item_kinds.keys.each do |kind| %> <div class="col-6 col-lg-4 col-xl-3 col-xxl-2"> <div class="card kind" data-kind="<%= kind %>"> diff --git a/app/views/admin/communication/websites/posts/_form.html.erb b/app/views/admin/communication/websites/posts/_form.html.erb index 92e1a03b2810c456fa7761d3201501d807848e80..bec8f60e57e2e9bf819730ea3559f1b0cb566ef4 100644 --- a/app/views/admin/communication/websites/posts/_form.html.erb +++ b/app/views/admin/communication/websites/posts/_form.html.erb @@ -10,7 +10,7 @@ <%= render 'admin/application/summary/form', f: f, about: post %> <%= f.input :text, as: :summernote if post.text&.to_plain_text.present? %> </section> - <div class="row row-small"> + <div class="row pure__row--small"> <% if @website.categories.any? %> <div class="col-md-6"> <h2 class="h3"> @@ -31,7 +31,7 @@ <section class="mb-5"> <h2 class="h3"><%= t('metadata') %></h2> <% if can? :publish, post %> - <div class="row row-small"> + <div class="row pure__row--small"> <div class="col-6"> <%= f.input :published %> </div> diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb index de65b65c6747cf5b9d0d9c0406a314d3aa870e2b..de5f9051a1f145414d0b9ba506145b933aef3bcd 100644 --- a/app/views/admin/communication/websites/posts/show.html.erb +++ b/app/views/admin/communication/websites/posts/show.html.erb @@ -16,7 +16,7 @@ <% end %> </div> <h2 class="h3"><%= t('metadata') %></h2> - <div class="row row-small"> + <div class="row pure__row--small"> <div class="col-6"> <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('published') %></h3> <p> diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index b53917cc0b9eacaf1957dc47698bb0d591f8ea24..c851cdfd760438b39406f5dbadba6f34dac636ce 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -3,87 +3,67 @@ <div class="row mb-5"> <div class="col-md-6 pb-4"> - <h2 class="h4"><%= t('hello', name: current_user.first_name) %></h2> - <% if current_university.logo.attached? %> - <%= image_tag current_university.logo, width: 120, class: 'float-end' %> - <% else %> - <p><%= current_university %></p> + <%= panel title: t('hello', name: current_user.first_name) do %> + <div class="text-end"> + <% if current_university.logo.attached? %> + <%= image_tag current_university.logo, width: 120 %> + <% else %> + <%= current_university %> + <% end %> + </div> <% end %> </div> <div class="col-md-6 pb-4"> - <div class="d-flex align-items-start"> - <div class="flex-grow-1"> - <h2 class="h4 mb-2"><%= Delayed::Job.all.length %></h2> - <p class="mb-0"><%= t 'admin.pending_tasks.label' %></p> - <p class="mb-0 small"><%= t 'admin.pending_tasks.hint' %></p> - </div> - <div class="d-inline-block ms-3"> - <div class="stat stat-sm"> - <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock align-baseline"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg> - </div> - </div> - </div> + <%= panel title: Delayed::Job.all.length, + action: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock align-baseline"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>' do %> + <p class="mb-0"><%= t 'admin.pending_tasks.label' %></p> + <p class="mb-0 small"><%= t 'admin.pending_tasks.hint' %></p> + <% end %> </div> </div> <% if current_university.communication_websites.any? && can?(:read, Communication::Website) %> - <h2 class="section"><%= Communication::Website.model_name.human(count: 2) %></h2> - <div class="row row-small"> + <h2 class="category"><%= Communication::Website.model_name.human(count: 2) %></h2> + <div class="row"> <% current_university.communication_websites.each do |website| %> <% next unless can?(:read, website) %> <div class="<%= classes %>"> - <div class="card flex-fill"> - <div class="card-body"> - <span class="float-end"> - <i class="fas fa-<%= Icon::COMMUNICATION_WEBSITE %>"></i> - </span> - <h3 class="card-title"><%= website %></h3> - <p class="small"><%= website.url %></p> - <%= link_to t('show'), [:admin, website], class: button_classes('stretched-link') %> - </div> - </div> + <%= panel title: website, + action: "<i class=\"fas fa-#{ Icon::COMMUNICATION_WEBSITE }\"></i>" do %> + <p class="small"><%= website.url %></p> + <%= link_to t('show'), [:admin, website], class: button_classes('stretched-link') %> + <% end %> </div> <% end %> </div> <% end %> <% if current_university.communication_extranets.any? && can?(:read, Communication::Extranet) %> - <h2 class="section"><%= Communication::Extranet.model_name.human(count: 2) %></h2> - <div class="row row-small"> + <h2 class="category"><%= Communication::Extranet.model_name.human(count: 2) %></h2> + <div class="row"> <% current_university.communication_extranets.each do |extranet| %> <% next unless can?(:read, extranet) %> <div class="<%= classes %>"> - <div class="card flex-fill"> - <div class="card-body"> - <span class="float-end"> - <i class="fas fa-<%= Icon::COMMUNICATION_EXTRANET %>"></i> - </span> - <h3 class="card-title"><%= extranet %></h3> - <p class="small"><%= extranet.url %></p> - <%= link_to t('show'), [:admin, extranet], class: button_classes('stretched-link') %> - </div> - </div> + <%= panel title: extranet, + action: "<i class=\"fas fa-#{ Icon::COMMUNICATION_EXTRANET }\"></i>" do %> + <p class="small"><%= extranet.url %></p> + <%= link_to t('show'), [:admin, extranet], class: button_classes('stretched-link') %> + <% end %> </div> <% end %> </div> <% end %> <% if current_university.research_journals.any? && can?(:read, Research::Journal) %> - <h2 class="section"><%= Research::Journal.model_name.human(count: 2) %></h2> - <div class="row row-small"> + <h2 class="category"><%= Research::Journal.model_name.human(count: 2) %></h2> + <div class="row pure__row--small"> <% current_university.research_journals.each do |journal| %> <% next unless can?(:read, journal) %> <div class="<%= classes %>"> - <div class="card flex-fill"> - <div class="card-body"> - <span class="float-end"> - <i class="fas fa-<%= Icon::RESEARCH_JOURNAL %>"></i> - </span> - <h3 class="card-title"><%= journal %></h3> - <p> </p> - <%= link_to t('show'), [:admin, journal], class: button_classes('stretched-link') %> - </div> - </div> + <%= panel title: journal, + action: "<i class=\"fas fa-#{ Icon::RESEARCH_JOURNAL }\"></i>" do %> + <%= link_to t('show'), [:admin, journal], class: button_classes('stretched-link') %> + <% end %> </div> <% end %> </div> diff --git a/app/views/admin/layouts/themes/appstack/_panel.html.erb b/app/views/admin/layouts/themes/appstack/_panel.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..7fd6e84c2cc23698790e06dfde368ba6b10843b8 --- /dev/null +++ b/app/views/admin/layouts/themes/appstack/_panel.html.erb @@ -0,0 +1,13 @@ +<div class="card flex-fill"> + <% if title %> + <div class="card-header"> + <% if action %> + <div class="float-end"><%= raw action %></div> + <% end %> + <h2 class="card-title mb-0"><%= title %></h2> + </div> + <% end %> + <div class="card-body"> + <%= yield %> + </div> +</div> \ No newline at end of file diff --git a/app/views/admin/layouts/themes/pure/_panel.html.erb b/app/views/admin/layouts/themes/pure/_panel.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..1db841f05ec13a5506e77e7b96c7360217c5dd83 --- /dev/null +++ b/app/views/admin/layouts/themes/pure/_panel.html.erb @@ -0,0 +1,9 @@ +<section class="flex-fill position-relative"> + <% if action %> + <div class="float-end"><%= raw action %></div> + <% end %> + <% if title %> + <h2 class="h4"><%= title %></h2> + <% end %> + <%= yield %> +</section> \ No newline at end of file