diff --git a/app/assets/stylesheets/admin/appstack/style.sass b/app/assets/stylesheets/admin/appstack/style.sass index 21d18f7cc2e805e9e3bf2b221f10aa411643189c..4c310a33dca0a60f6bf317f81769716043b70b47 100644 --- a/app/assets/stylesheets/admin/appstack/style.sass +++ b/app/assets/stylesheets/admin/appstack/style.sass @@ -76,6 +76,10 @@ p .sidebar-item.active > .sidebar-link color: white +.website__sidebar + .list-group-item.active + color: $primary + #topbar padding-left: $grid-gutter-width padding-right: $grid-gutter-width diff --git a/app/assets/stylesheets/admin/commons/style.sass b/app/assets/stylesheets/admin/commons/style.sass index 6792bc31581b7fba2aee808547acca2856526b8e..7b0183f498222788e2a7192a544a6ca79598f731 100644 --- a/app/assets/stylesheets/admin/commons/style.sass +++ b/app/assets/stylesheets/admin/commons/style.sass @@ -4,4 +4,9 @@ &:last-of-type // Buttons opacity: 1 .handle - cursor: move \ No newline at end of file + cursor: move + +.a11y + &__status + &__icon + vertical-align: sub \ No newline at end of file diff --git a/app/views/admin/application/a11y/_status.html.erb b/app/views/admin/application/a11y/_status.html.erb index 0f06d6502912431c3dd2c14bcc79eafbddeb5b09..20ae8394f155e52ec7d84c369b01434f13e31765 100644 --- a/app/views/admin/application/a11y/_status.html.erb +++ b/app/views/admin/application/a11y/_status.html.erb @@ -1,4 +1,7 @@ -<p class="m-0"> - <i class="lead fas fa-universal-access <%= about.accessible? ? 'text-success' : 'text-danger'%>"></i> - <%= t "accessibility.status.#{about.accessible?}" %> -</p> +<% +$color = about.accessible? ? 'text-success' : 'text-danger' +%> +<span class="small a11y__status"> + <i class="a11y__status__icon lead fas fa-universal-access <%= $color %>"></i> + <%= t "accessibility.status.#{about.accessible?}" %> +</span> diff --git a/app/views/admin/communication/blocks/_list.html.erb b/app/views/admin/communication/blocks/_list.html.erb index aa96b020f1ef35bfd748ec6110a33c51568107f2..e31d2ba014f37fe42dcd451d822f53d5fb496bdc 100644 --- a/app/views/admin/communication/blocks/_list.html.erb +++ b/app/views/admin/communication/blocks/_list.html.erb @@ -17,12 +17,12 @@ action += link_to t('add'), <td> <%= block.to_s.truncate(50) %><br> <span class="small"><%= block.template_kind_i18n %></span> + <%= render 'admin/application/a11y/status', about: block %> </td> <td class="p-0"> <%= image_tag "communication/blocks/templates/#{block.template_kind}.jpg", height: "100px", alt: '', style:"max-height: 75px" %> </td> - <td><%= render 'admin/application/a11y/status', about: block %></td> <td> <div class="btn-group"> <%= duplicate_link block %> diff --git a/app/views/admin/communication/websites/_sidebar.html.erb b/app/views/admin/communication/websites/_sidebar.html.erb index cc2b8e98a722c5d6a351d747b796da84a79726da..0698c734baf612a77ad9a3b5ef49f1762dc809e9 100644 --- a/app/views/admin/communication/websites/_sidebar.html.erb +++ b/app/views/admin/communication/websites/_sidebar.html.erb @@ -1,58 +1,56 @@ -<div class="row mt-2"> +<div class="row mt-2 website__sidebar"> <div class="col-lg-3 col-xl-2"> - <div class="card"> - <div class="list-group list-group-flush" role="tablist"> - <% - navigation = [ - { - title: Communication::Website.model_name.human, - path: admin_communication_website_path(id: @website, website_id: nil), - icon: Icon::COMMUNICATION_WEBSITE_HOME, - ability: can?(:read, @website) - }, - { - title: Communication::Website::Post.model_name.human(count: 2), - path: admin_communication_website_posts_path(website_id: @website), - icon: Icon::COMMUNICATION_WEBSITE_POST, - ability: can?(:read, Communication::Website::Post) - }, - { - title: t('admin.communication.website.pages.structure'), - path: admin_communication_website_pages_path(website_id: @website), - icon: Icon::COMMUNICATION_WEBSITE_PAGES, - ability: can?(:read, Communication::Website::Page) - }, - { - title: Communication::Website::Menu.model_name.human(count: 2), - path: admin_communication_website_menus_path(website_id: @website), - icon: Icon::COMMUNICATION_WEBSITE_MENUS, - ability: can?(:read, Communication::Website::Category) - } - ] - - navigation << { - title: t('communication.website.analytics'), - path: analytics_admin_communication_website_path(@website.id, website_id: nil), - icon: Icon::COMMUNICATION_WEBSITE_ANALYTICS, + <div class="list-group list-group-flush" role="tablist"> + <% + navigation = [ + { + title: Communication::Website.model_name.human, + path: admin_communication_website_path(id: @website, website_id: nil), + icon: Icon::COMMUNICATION_WEBSITE_HOME, ability: can?(:read, @website) - } if @website.plausible_url.present? + }, + { + title: Communication::Website::Post.model_name.human(count: 2), + path: admin_communication_website_posts_path(website_id: @website), + icon: Icon::COMMUNICATION_WEBSITE_POST, + ability: can?(:read, Communication::Website::Post) + }, + { + title: t('admin.communication.website.pages.structure'), + path: admin_communication_website_pages_path(website_id: @website), + icon: Icon::COMMUNICATION_WEBSITE_PAGES, + ability: can?(:read, Communication::Website::Page) + }, + { + title: Communication::Website::Menu.model_name.human(count: 2), + path: admin_communication_website_menus_path(website_id: @website), + icon: Icon::COMMUNICATION_WEBSITE_MENUS, + ability: can?(:read, Communication::Website::Category) + } + ] + + navigation << { + title: t('communication.website.analytics'), + path: analytics_admin_communication_website_path(@website.id, website_id: nil), + icon: Icon::COMMUNICATION_WEBSITE_ANALYTICS, + ability: can?(:read, @website) + } if @website.plausible_url.present? - navigation.each_with_index do |object, index| - next unless object[:ability] - active = index.zero? ? object[:path] == request.path - : object[:path].in?(request.path) - %> - <a class="list-group-item list-group-item-action<%= ' active' if active %>" href="<%= object[:path] %>"> - <%= object[:title].html_safe %> - <span class="float-end"> - <i class="fas fa-<%= object[:icon] %>"></i> - </span> - </a> - <% end %> - </div> + navigation.each_with_index do |object, index| + next unless object[:ability] + active = index.zero? ? object[:path] == request.path + : object[:path].in?(request.path) + %> + <a class="list-group-item bg-transparent px-0 list-group-item-action<%= ' active' if active %>" href="<%= object[:path] %>"> + <%= object[:title].html_safe %> + <span class="float-end"> + <i class="fas fa-<%= object[:icon] %>"></i> + </span> + </a> + <% end %> </div> </div> - <div class="col-lg-9 col-xl-10 offset-xxl-1 col-xxl-9"> + <div class="col-lg-9 col-xl-10"> <%= yield %> </div> </div>