diff --git a/app/assets/stylesheets/admin/pure/style.sass b/app/assets/stylesheets/admin/pure/style.sass index b0f661a69219b1d8deec0e69e0665e9cbec6a111..bff438e836df8fd9031e72ff2909135b2ac43bc6 100644 --- a/app/assets/stylesheets/admin/pure/style.sass +++ b/app/assets/stylesheets/admin/pure/style.sass @@ -1,3 +1,16 @@ +.pure + &__section + h2 + font-size: px2rem(18) + font-weight: bold + color: $color-text-alt + &__row--small + margin-left: calc(-.5 * #{$spacing1}) + margin-right: calc(-.5 * #{$spacing1}) + > * + padding-left: calc(.5 * #{$spacing1}) + padding-right: calc(.5 * #{$spacing1}) + .navbar position: absolute left: 0 @@ -53,8 +66,8 @@ main padding-right: var(--bs-gutter-x) padding-left: var(--bs-gutter-x) -h2 - font-weight: bold +p + color: $color-text .category border-bottom: 1px solid $color-border @@ -65,12 +78,6 @@ h2 padding-bottom: $spacing0 text-transform: uppercase -.pure__row--small - margin-left: calc(-.5 * #{$spacing1}) - margin-right: calc(-.5 * #{$spacing1}) - > * - padding-left: calc(.5 * #{$spacing1}) - padding-right: calc(.5 * #{$spacing1}) a text-decoration: none text-decoration-thickness: 1px @@ -131,9 +138,13 @@ a .filters position: absolute top: 0 - right: var(--bs-gutter-x) - margin-top: -6px !important - z-index: 10 + right: 0 + margin-top: 0 !important + +#collapseFilters + padding-top: 0 !important + + br + display: none .sdfi-deletable-file__preview margin-top: 10px @@ -144,6 +155,9 @@ a .table input[type=checkbox] margin-right: 10px + th + color: $color-text-alt + font-weight: normal footer min-height: 300px diff --git a/app/controllers/admin/communication/websites_controller.rb b/app/controllers/admin/communication/websites_controller.rb index ffdff0776096308f58e73c3975c52cc7a685a3eb..4b9c570dd2f28fa603324a9b730023dc5f8bb994 100644 --- a/app/controllers/admin/communication/websites_controller.rb +++ b/app/controllers/admin/communication/websites_controller.rb @@ -13,8 +13,8 @@ class Admin::Communication::WebsitesController < Admin::Communication::Applicati end def show - @pages = @website.pages.accessible_by(current_ability).published.recent - @posts = @website.posts.accessible_by(current_ability).published.recent + @pages = @website.pages.accessible_by(current_ability).recent + @posts = @website.posts.accessible_by(current_ability).recent breadcrumb end diff --git a/app/views/admin/application/a11y/_widget.html.erb b/app/views/admin/application/a11y/_widget.html.erb index 9064054eb5db0bd8587d2dbd147a387863c7e8de..a7521a758c073a1b05f8d7289479992a2fbf14d2 100644 --- a/app/views/admin/application/a11y/_widget.html.erb +++ b/app/views/admin/application/a11y/_widget.html.erb @@ -1,11 +1,8 @@ <% color = about.accessible? ? 'text-success' : 'text-danger' +action = "<i class=\"fas fa-universal-access fa-2x float-end #{ color}\"></i>" %> -<section class="mb-5"> - <i class="fas fa-universal-access fa-2x float-end <%= color %>"></i> - <h2 class="h3"> - <%= t('accessibility.label') %> - </h2> +<%= panel title: t('accessibility.label'), action: action do %> <% if about.accessibility_errors.any? %> <h3 class="h5 text-danger"> <%= t 'accessibility.errors', count: about.accessibility_errors.count %> @@ -40,4 +37,4 @@ color = about.accessible? ? 'text-success' : 'text-danger' <% end %> </ul> <% end %> -</section> +<% end %> \ No newline at end of file diff --git a/app/views/admin/application/featured_image/_edit.html.erb b/app/views/admin/application/featured_image/_edit.html.erb index 03293cfae48bafb6a984c895fc4d84c4f68f0bb3..64957e1386c26b6692ab5eb56a613ea6da11ed35 100644 --- a/app/views/admin/application/featured_image/_edit.html.erb +++ b/app/views/admin/application/featured_image/_edit.html.erb @@ -1,5 +1,4 @@ -<section class="mb-5"> - <h2 class="h3"><%= t('featured_image.title') %></h2> +<%= panel title: t('featured_image.title') do %> <%= f.input :featured_image, as: :single_deletable_file, direct_upload: true, @@ -18,4 +17,4 @@ data: { 'summernote-config' => 'link' } } %> <%= render 'admin/communication/unsplash/selector', about: about, f:f %> -</section> +<% end %> diff --git a/app/views/admin/application/featured_image/_show.html.erb b/app/views/admin/application/featured_image/_show.html.erb index 6e3c9ee6b76ad475e4090a4a14a7ac172f65e88b..2b86bdd89b03678986d5cd541b794ce00bdb250b 100644 --- a/app/views/admin/application/featured_image/_show.html.erb +++ b/app/views/admin/application/featured_image/_show.html.erb @@ -1,27 +1,16 @@ -<% if about.best_featured_image.attached? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0 h5"> - <%= about.class.human_attribute_name :featured_image %> - <% unless about.featured_image.attached? %> - (<%= t('admin.inheritance.sentence_without_link').downcase %>) - <% end %> - </h2> +<%= panel title: t('featured_image.title') do %> + <% image = about.best_featured_image.variable? ? about.best_featured_image.variant(resize: '600') + : about.best_featured_image %> + <%= image_tag image, class: 'img-fluid mb-2' %> + <% unless about.featured_image.attached? %> + <p class="small"><%= t('admin.inheritance.sentence_without_link').downcase %></p> + <% end %> + <% if about.best_featured_image_alt %> + <p class="mb-0"><%= about.best_featured_image_alt %></p> + <% end %> + <% if about.best_featured_image_credit %> + <div class="small mb-0"> + <%= sanitize about.best_featured_image_credit %> </div> - <div class="card-body"> - <% image = about.best_featured_image.variable? ? about.best_featured_image.variant(resize: '600') - : about.best_featured_image %> - <%= image_tag image, class: 'img-fluid mb-2' %> - <% if about.best_featured_image_alt %> - <p class="mb-0"> - <%= about.best_featured_image_alt %> - </p> - <% end %> - <% if about.best_featured_image_credit %> - <div class="small mb-0"> - <%= sanitize about.best_featured_image_credit %> - </div> - <% end %> - </div> - </div> -<% end %> + <% end %> +<% end if about.best_featured_image.attached? %> \ No newline at end of file diff --git a/app/views/admin/application/meta_description/_form.html.erb b/app/views/admin/application/meta_description/_form.html.erb index e9e67c6f16d0d8f70a8ac7cc7bc8c3ee21cd7657..137f6dff87eba83e1a09a327e7175944eec2ac18 100644 --- a/app/views/admin/application/meta_description/_form.html.erb +++ b/app/views/admin/application/meta_description/_form.html.erb @@ -1,9 +1,8 @@ -<section class="mb-5"> - <h2 class="h3"><%= t('seo') %></h2> +<%= panel title: t('admin.summary') do %> <%= f.input :meta_description, label: t('admin.meta_description.label'), hint: t('admin.meta_description.hint'), input_html: { value: about.meta_description&.gsub('&', '&') } %> -</section> \ No newline at end of file +<% end %> \ No newline at end of file diff --git a/app/views/admin/application/meta_description/_show.html.erb b/app/views/admin/application/meta_description/_show.html.erb index e40c22b2187abbad9b623f5658d150c9e03e6b80..9a8052df947464004d748a14b757e7c5669b14ea 100644 --- a/app/views/admin/application/meta_description/_show.html.erb +++ b/app/views/admin/application/meta_description/_show.html.erb @@ -1,9 +1,4 @@ -<% unless about.meta_description.blank? %> - <section class="mb-5"> - <h2 class="h3"><%= t('seo') %></h2> - <p class="lead"> - <h3 class="h5"><%= t('admin.meta_description.label') %></h3> - <%= sanitize about.meta_description %> - </p> - </section> -<% end %> +<%= panel title: t('seo') do %> + <h3 class="h5"><%= t('admin.meta_description.label') %></h3> + <p><%= sanitize about.meta_description %></p> +<% end unless about.meta_description.blank? %> diff --git a/app/views/admin/application/summary/_show.html.erb b/app/views/admin/application/summary/_show.html.erb index 96892814edbd35bd8115d0995c986822a8de5bbf..5ad53f6a0d9e3ceb7ea041f112a506b94117fa09 100644 --- a/app/views/admin/application/summary/_show.html.erb +++ b/app/views/admin/application/summary/_show.html.erb @@ -1,8 +1,3 @@ -<% unless about.summary.blank? %> - <section class="mb-5"> - <h2 class="h3"><%= t('admin.summary') %></h2> - <p class="lead"> - <%= sanitize about.summary %> - </p> - </section> -<% end %> +<%= panel title: t('admin.summary') do %> + <p class="lead"><%= sanitize about.summary %></p> +<% end unless about.summary.blank? %> diff --git a/app/views/admin/communication/blocks/_list.html.erb b/app/views/admin/communication/blocks/_list.html.erb index 4d494026bc7352fd09c503123580aba82d163544..43d3ec96845255615e06313472add3638447edf7 100644 --- a/app/views/admin/communication/blocks/_list.html.erb +++ b/app/views/admin/communication/blocks/_list.html.erb @@ -1,12 +1,10 @@ -<section class="mb-5"> - <div class="float-end"> - <%= link_to t('add'), - new_admin_communication_block_path(about_id: about.id, about_type: about.class.name), - class: button_classes if can? :create, Communication::Block %> - </div> - <h2 class="h3 mb-3"> - <%= Communication::Block.model_name.human(count: 2) %> - </h2> +<% +action = '' +action += link_to t('add'), + new_admin_communication_block_path(about_id: about.id, about_type: about.class.name), + class: button_classes if can? :create, Communication::Block +%> +<%= panel title: Communication::Block.model_name.human(count: 2), action: action do %> <% if about.blocks.any? %> <div class="table-responsive"> <table class="<%= table_classes %>"> @@ -37,4 +35,4 @@ </table> </div> <% end %> -</section> +<% end %> diff --git a/app/views/admin/communication/websites/pages/_form.html.erb b/app/views/admin/communication/websites/pages/_form.html.erb index 317d922e069be0add5fcfe4b0082e9a8fd627fb1..4935171c60766c53feb3dea9a42ad93c801543ab 100644 --- a/app/views/admin/communication/websites/pages/_form.html.erb +++ b/app/views/admin/communication/websites/pages/_form.html.erb @@ -8,14 +8,13 @@ url = page.new_record? ? admin_communication_website_pages_path <div class="row"> <div class="col-md-8"> - <section class="mb-5"> - <h2 class="h3"><%= t('content') %></h2> + <%= panel title: t('content') do %> <%= f.input :title %> <%= f.input :breadcrumb_title %> <%= render 'admin/application/summary/form', f: f, about: page %> <%= f.input :header_text, as: :string %> <%= f.input :text, as: :summernote if page.text&.to_plain_text.present? %> - </section> + <% end %> <%= render 'admin/application/meta_description/form', f: f, about: page %> </div> <div class="col-md-4"> diff --git a/app/views/admin/communication/websites/pages/_list.html.erb b/app/views/admin/communication/websites/pages/_list.html.erb index ebdbc91dba2129c7d714afd324de68ef1283a9d5..0134825491f823c2fc8039ab70e27ade5b1a12a5 100644 --- a/app/views/admin/communication/websites/pages/_list.html.erb +++ b/app/views/admin/communication/websites/pages/_list.html.erb @@ -3,6 +3,7 @@ <thead> <tr> <th class="ps-0"><%= Communication::Website::Page.human_attribute_name('title') %></th> + <th><%= Communication::Website::Page.human_attribute_name('parent') %></th> <th width="150"></th> </tr> </thead> @@ -14,6 +15,10 @@ admin_communication_website_page_path(website_id: page.website.id, id: page.id), class: "#{'draft' unless page.published?}" %> </td> + <td> + <%= link_to page.parent, + admin_communication_website_page_path(website_id: page.website.id, id: page.id) if page.parent %> + </td> <td class="text-end pe-0"> <div class="btn-group" role="group"> <%= link_to t('edit'), diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index b1cf768eeb1deca450bd8e7ff494dc3b78f67d75..1a7957147aea911ddfbf823c0e38d3b23f7cbc9d 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -4,84 +4,21 @@ <div class="row"> <div class="col-md-8"> - - <%= render 'admin/application/summary/show', about: @page %> - <%= render 'admin/communication/blocks/list', about: @page %> - <% if @page.is_special_page? %> <p> <%= t('admin.communication.website.pages.is_special_page') %> <b><%= t("communication.website.pages.defaults.#{@page.type_key}.title") %></b> </p> <% end %> - + <%= render 'admin/application/summary/show', about: @page %> + <%= render 'admin/communication/blocks/list', about: @page %> <%= render 'admin/application/dependencies', git_dependencies: @page.git_dependencies(@page.website), active_storage_blobs: @page.active_storage_blobs %> </div> <div class="col-md-4"> <%= render 'admin/application/a11y/widget', about: @page %> - - <section class="mb-5"> - <div class="float-end"> - <% if @page.url %> - <%= link_to t('open'), - @page.url, - target: :_blank, - class: 'btn btn-light' %> - <% end %> - </div> - <h2 class="h3 mb-3"><%= t('metadata') %></h2> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('published') %></h3> - <p><%= t @page.published %></p> - <% unless @page.slug.blank? %> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('slug') %></h3> - <p><%= @page.slug %></p> - <% end %> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('path') %></h3> - <p><%= @page.path %></p> - - <% if @page.parent %> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('parent') %></h3> - <p><%= link_to_if can?(:read, @page.parent), - @page.parent, - admin_communication_website_page_path( - website_id: @website.id, - id: @page.parent.id - ), - class: "#{'draft' unless @page.parent.published?}" %></p> - <% end %> - - <% if can?(:edit, @website) && @page.best_bodyclass %> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('bodyclass') %></h3> - <p> - <%= @page.best_bodyclass %> - <% if @page.bodyclass.blank? %> - <br> - <span class="small text-muted"> - <%= t 'admin.inheritance.sentence_without_link' %> - </span> - <% end %> - </p> - <% end %> - - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('full_width') %></h3> - <p><%= t @page.full_width %></p> - - <% if @page.children.any? %> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('children') %></h3> - <ul class="list-unstyled mb-0"> - <% @page.children.ordered.each do |child| %> - <li> - <%= link_to_if can?(:read, child), - child, - admin_communication_website_page_path( website_id: @website.id, id: child.id), - class: "#{'draft' unless child.published?}" %> - </li> - <% end %> - </ul> - <% end %> - </section> + <%= render 'admin/communication/websites/pages/show/metadata' %> <%= render 'admin/application/featured_image/show', about: @page %> <%= render 'admin/application/meta_description/show', about: @page %> </div> diff --git a/app/views/admin/communication/websites/pages/show/_metadata.html.erb b/app/views/admin/communication/websites/pages/show/_metadata.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..33de1e2523a4f31ff5c01b788fe2e2c796749422 --- /dev/null +++ b/app/views/admin/communication/websites/pages/show/_metadata.html.erb @@ -0,0 +1,55 @@ +<% +action = link_to t('open'), @page.url, target: :_blank, class: 'btn btn-light btn-xs' +%> +<%= panel title: t('metadata'), action: action do %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('published') %></h3> + <p><%= t @page.published %></p> + <% unless @page.slug.blank? %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('slug') %></h3> + <p><%= @page.slug %></p> + <% end %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('path') %></h3> + <p><%= @page.path %></p> + + <% if @page.parent %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('parent') %></h3> + <p><%= link_to_if can?(:read, @page.parent), + @page.parent, + admin_communication_website_page_path( + website_id: @website.id, + id: @page.parent.id + ), + class: "#{'draft' unless @page.parent.published?}" %></p> + <% end %> + + <% if can?(:edit, @website) && @page.best_bodyclass %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('bodyclass') %></h3> + <p> + <%= @page.best_bodyclass %> + <% if @page.bodyclass.blank? %> + <br> + <span class="small text-muted"> + <%= t 'admin.inheritance.sentence_without_link' %> + </span> + <% end %> + </p> + <% end %> + + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('full_width') %></h3> + <p><%= t @page.full_width %></p> + + <% if @page.children.any? %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('children') %></h3> + <ul class="list-unstyled mb-0"> + <% @page.children.ordered.each do |child| %> + <li> + <%= link_to_if can?(:read, child), + child, + admin_communication_website_page_path( website_id: @website.id, id: child.id), + class: "#{'draft' unless child.published?}" %> + </li> + <% end %> + </ul> + <% end %> + +<% end %> \ No newline at end of file diff --git a/app/views/admin/communication/websites/posts/_form.html.erb b/app/views/admin/communication/websites/posts/_form.html.erb index bec8f60e57e2e9bf819730ea3559f1b0cb566ef4..d556f65f05ab44b5d7f02967df8d5b8333beb995 100644 --- a/app/views/admin/communication/websites/posts/_form.html.erb +++ b/app/views/admin/communication/websites/posts/_form.html.erb @@ -4,22 +4,20 @@ <div class="row"> <div class="col-md-8"> - <section class="mb-5"> - <h2 class="h3"><%= t('content') %></h2> + <%= panel title: t('content') do %> <%= f.input :title %> <%= render 'admin/application/summary/form', f: f, about: post %> <%= f.input :text, as: :summernote if post.text&.to_plain_text.present? %> - </section> + <% end %> <div class="row pure__row--small"> <% if @website.categories.any? %> <div class="col-md-6"> - <h2 class="h3"> - <%= t('activerecord.attributes.communication/website/post.categories') %> - </h2> - <%= f.association :categories, - label_text: false, - as: :check_boxes, - collection: collection_tree_for_checkboxes(@website.categories) if @website.categories.any? %> + <%= panel title: t('activerecord.attributes.communication/website/post.categories') do %> + <%= f.association :categories, + label_text: false, + as: :check_boxes, + collection: collection_tree_for_checkboxes(@website.categories) if @website.categories.any? %> + <% end %> </div> <% end %> <div class="col-md-6"> @@ -28,8 +26,7 @@ </div> </div> <div class="col-md-4"> - <section class="mb-5"> - <h2 class="h3"><%= t('metadata') %></h2> + <%= panel title: t('metadata') do %> <% if can? :publish, post %> <div class="row pure__row--small"> <div class="col-6"> @@ -62,7 +59,7 @@ class: 'js-slug-input', data: { source: '#communication_website_post_title' } } %> - </section> + <% end %> <%= render 'admin/application/featured_image/edit', about: @post, f: f %> </div> </div> diff --git a/app/views/admin/communication/websites/posts/index.html.erb b/app/views/admin/communication/websites/posts/index.html.erb index 4031470aeea2e60f3091a0884127c7446ffc704d..93c6d7fd50de8bdd4c19d12ca881f502a17c285c 100644 --- a/app/views/admin/communication/websites/posts/index.html.erb +++ b/app/views/admin/communication/websites/posts/index.html.erb @@ -6,56 +6,57 @@ <% end %> <%= render 'admin/communication/websites/sidebar' do %> - <%= render 'filters', current_path: admin_communication_website_posts_path, filters: @filters if @filters.any? %> - - <div class="mb-5" data-batch-selectable> - <%= form_tag publish_admin_communication_website_posts_path do %> - <%= render 'admin/communication/websites/posts/list', posts: @posts, selectable: true %> - <div> - <% if @posts.total_pages > 1 %> - <div class="float-end mb-3"> - <%= paginate @posts, theme: 'bootstrap-5' %> - </div> - <% end %> - <div data-batch-selectable-role="actions-container"> - <div class="d-flex align-items-center"> - <div class="col-auto me-3"> - <%= t('batch_selectable.title') %> + <%= panel title: Communication::Website::Post.model_name.human(count: 2) do %> + <%= render 'filters', current_path: admin_communication_website_posts_path, filters: @filters if @filters.any? %> + <div data-batch-selectable> + <%= form_tag publish_admin_communication_website_posts_path do %> + <%= render 'admin/communication/websites/posts/list', posts: @posts, selectable: true %> + <div> + <% if @posts.total_pages > 1 %> + <div class="float-end mb-3"> + <%= paginate @posts, theme: 'bootstrap-5' %> </div> - <div class="col-auto me-3"> - <select name="published" class="form-select"> - <option value="false"><%= t('communication.website.posts.unpublished') %></option> - <option value="true"><%= t('communication.website.posts.published') %></option> - </select> - </div> - <div class="col-auto me-3"> - <%= submit_tag t("save"), class: "btn btn-primary" %> + <% end %> + <div data-batch-selectable-role="actions-container"> + <div class="d-flex align-items-center"> + <div class="col-auto me-3"> + <%= t('batch_selectable.title') %> + </div> + <div class="col-auto me-3"> + <select name="published" class="form-select"> + <option value="false"><%= t('communication.website.posts.unpublished') %></option> + <option value="true"><%= t('communication.website.posts.published') %></option> + </select> + </div> + <div class="col-auto me-3"> + <%= submit_tag t("save"), class: "btn btn-primary" %> + </div> </div> </div> </div> - </div> - <% end %> - </div> + <% end %> + </div> + <% end %> <div class="row"> <% if can?(:create, Communication::Website::Category) || (@root_categories.any? && can?(:edit, @root_categories.first)) %> <div class="col-md-6"> - <div class="float-end"> - <%= create_link Communication::Website::Category %> - </div> - <h2 class="h3"><%= Communication::Website::Category.model_name.human(count: 2) %></h2> - <ul class="list-unstyled treeview treeview--sortable js-treeview js-treeview-sortable js-treeview-sortable-container" - data-id="" - data-sort-url="<%= reorder_admin_communication_website_categories_path %>"> - <%= render 'admin/communication/websites/categories/treebranch', categories: @root_categories %> - </ul> + <% action = create_link Communication::Website::Category %> + <%= panel title: Communication::Website::Category.model_name.human(count: 2), action: action do %> + <ul class="list-unstyled treeview treeview--sortable js-treeview js-treeview-sortable js-treeview-sortable-container" + data-id="" + data-sort-url="<%= reorder_admin_communication_website_categories_path %>"> + <%= render 'admin/communication/websites/categories/treebranch', categories: @root_categories %> + </ul> + <% end %> </div> <% end %> <% if @authors.any? %> <div class="col-md-6"> - <h2 class="h3"><%= t('communication.authors', count: 2) %></h2> - <%= render 'admin/communication/websites/authors/list', authors: @authors %> - <% if @authors.total_pages > 1 %> - <%= paginate @authors, theme: 'bootstrap-5', param_name: :authors_page %> + <%= panel title: t('communication.authors', count: 2) do %> + <%= render 'admin/communication/websites/authors/list', authors: @authors %> + <% if @authors.total_pages > 1 %> + <%= paginate @authors, theme: 'bootstrap-5', param_name: :authors_page %> + <% end %> <% end %> </div> <% end %> diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb index de5f9051a1f145414d0b9ba506145b933aef3bcd..3c945df0408fb896fc868524fb88b3841e692a1a 100644 --- a/app/views/admin/communication/websites/posts/show.html.erb +++ b/app/views/admin/communication/websites/posts/show.html.erb @@ -15,35 +15,36 @@ class: 'btn btn-light' %> <% end %> </div> - <h2 class="h3"><%= t('metadata') %></h2> - <div class="row pure__row--small"> - <div class="col-6"> - <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('published') %></h3> - <p> - <%= t @post.published %><% if @post.published & @post.published_at %>, - <%= l @post.published_at.to_date, format: :long if @post.published_at %> - <% end %> - </p> - </div> - <div class="col-6"> - <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('pinned') %></h3> - <p><%= t @post.pinned %></p> + <%= panel title: t('metadata') do %> + <div class="row pure__row--small"> + <div class="col-6"> + <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('published') %></h3> + <p> + <%= t @post.published %><% if @post.published & @post.published_at %>, + <%= l @post.published_at.to_date, format: :long if @post.published_at %> + <% end %> + </p> + </div> + <div class="col-6"> + <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('pinned') %></h3> + <p><%= t @post.pinned %></p> + </div> </div> - </div> - <% if @post.author %> - <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('author') %></h3> - <p><%= link_to_if can?(:read, @post.author), @post.author, admin_communication_website_author_path(@post.author) %></p> - <% end %> - <% if @post.categories.any? %> - <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('categories') %></h3> - <ul class="list-unstyled"> - <% @post.categories.each do |category| %> - <li><%= link_to_if can?(:read, category), category, [:admin, category] %></li> - <% end %> - </ul> + <% if @post.author %> + <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('author') %></h3> + <p><%= link_to_if can?(:read, @post.author), @post.author, admin_communication_website_author_path(@post.author) %></p> + <% end %> + <% if @post.categories.any? %> + <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('categories') %></h3> + <ul class="list-unstyled"> + <% @post.categories.each do |category| %> + <li><%= link_to_if can?(:read, category), category, [:admin, category] %></li> + <% end %> + </ul> + <% end %> + <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('slug') %></h3> + <p><%= @post.slug %></p> <% end %> - <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('slug') %></h3> - <p><%= @post.slug %></p> <%= render 'admin/application/featured_image/show', about: @post %> <%= render 'admin/application/meta_description/show', about: @post %> </div> diff --git a/app/views/admin/communication/websites/show/_pages.html.erb b/app/views/admin/communication/websites/show/_pages.html.erb index 4d673e418dd49696635866370851212889202fa1..db7b021af8e4979ac9b3c334eacca490395ddc66 100644 --- a/app/views/admin/communication/websites/show/_pages.html.erb +++ b/app/views/admin/communication/websites/show/_pages.html.erb @@ -1,11 +1,9 @@ -<section class="mb-5"> - <div class="float-end"> - <%= link_to t('create'), - new_admin_communication_website_page_path(website_id: @website), - class: button_classes if can?(:create, Communication::Website::Page) %> - </div> - <h2 class="h3"><%= t('communication.website.last_pages') %></h2> - <p><%= link_to t('communication.website.see_all', number: @website.pages.accessible_by(current_ability).count), - admin_communication_website_pages_path(website_id: @website) %></p> +<% +action = '' +action += link_to t('create'), + new_admin_communication_website_page_path(website_id: @website), + class: button_classes if can?(:create, Communication::Website::Page) +%> +<%= panel title: t('communication.website.last_pages'), action: action do %> <%= render 'admin/communication/websites/pages/list', pages: @pages %> -</section> +<% end %> \ No newline at end of file diff --git a/app/views/admin/communication/websites/show/_posts.html.erb b/app/views/admin/communication/websites/show/_posts.html.erb index 23200846b0b38b913acbfdf131ff1a7aff7a6717..b4afb45972e2ca9eab0b60d481782cdc2f1c7a7f 100644 --- a/app/views/admin/communication/websites/show/_posts.html.erb +++ b/app/views/admin/communication/websites/show/_posts.html.erb @@ -1,17 +1,15 @@ -<section class="mb-5"> - <div class="float-end"> - <%= link_to t('communication.website.posts.new_curation'), - new_admin_communication_website_post_curation_path(website_id: @website.id), - class: button_classes if can?(:create, Communication::Website::Post) %> - <%= link_to t('create'), - new_admin_communication_website_post_path(website_id: @website), - class: button_classes if can?(:create, Communication::Website::Post) %> - </div> - <h2 class="h3"><%= t('communication.website.last_posts') %></h2> - <p><%= link_to t('communication.website.see_all', number: @website.posts.accessible_by(current_ability).count), - admin_communication_website_posts_path(website_id: @website) %></p> +<% +action = '' +action += link_to t('communication.website.posts.new_curation'), + new_admin_communication_website_post_curation_path(website_id: @website.id), + class: button_classes if can?(:create, Communication::Website::Post) +action += link_to t('create'), + new_admin_communication_website_post_path(website_id: @website), + class: button_classes('ms-1') if can?(:create, Communication::Website::Post) +%> +<%= panel title: t('communication.website.last_posts'), action: action do %> <%= render 'admin/communication/websites/posts/list', posts: @posts, hide_author: true, hide_category: true %> -</section> +<% end %> \ No newline at end of file diff --git a/app/views/admin/layouts/themes/_pure.html.erb b/app/views/admin/layouts/themes/_pure.html.erb index c93f9af8a3b2617534ecf9d87925218603018da1..94278bc16ad345cd06b157a15f23fa90ab84c5b4 100644 --- a/app/views/admin/layouts/themes/_pure.html.erb +++ b/app/views/admin/layouts/themes/_pure.html.erb @@ -12,7 +12,9 @@ </div> </div> <% end %> - <%= yield %> + <div class="position-relative"> + <%= yield %> + </div> <%= render 'admin/application/preview' %> </main> <%= render "admin/layouts/themes/pure/commands" %> diff --git a/app/views/admin/layouts/themes/pure/_panel.html.erb b/app/views/admin/layouts/themes/pure/_panel.html.erb index 1db841f05ec13a5506e77e7b96c7360217c5dd83..7841e16c5f84988ad7c516f4d0ec1bdfb16f0ffa 100644 --- a/app/views/admin/layouts/themes/pure/_panel.html.erb +++ b/app/views/admin/layouts/themes/pure/_panel.html.erb @@ -1,9 +1,9 @@ -<section class="flex-fill position-relative"> +<section class="pure__section flex-fill position-relative mb-5"> <% if action %> <div class="float-end"><%= raw action %></div> <% end %> <% if title %> - <h2 class="h4"><%= title %></h2> + <h2><%= title %></h2> <% end %> <%= yield %> </section> \ No newline at end of file