From ae4fea7118c050ec7227d31648e783813cd7956f Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Wed, 18 Oct 2023 21:44:22 +0200 Subject: [PATCH] category UI coherence --- .../websites/categories/_treebranch.html.erb | 13 +++++++++-- .../websites/categories/index.html.erb | 23 ++++++++----------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/app/views/admin/communication/websites/categories/_treebranch.html.erb b/app/views/admin/communication/websites/categories/_treebranch.html.erb index b1a0cb7ef..77ea107f3 100644 --- a/app/views/admin/communication/websites/categories/_treebranch.html.erb +++ b/app/views/admin/communication/websites/categories/_treebranch.html.erb @@ -13,8 +13,17 @@ <span class="close_text"><%= t 'folder.close' %></span> <% end %> <div class="btn-group ms-auto" role="group"> - <%= edit_link category %> - <%= destroy_link category %> + <%= link_to t('show'), + admin_communication_website_category_path(website_id: @website.id, id: category.id), + class: 'action ps-3' %> + <%= link_to t('edit'), + edit_admin_communication_website_category_path(website_id: @website.id, id: category.id), + class: 'action ps-3' %> + <%= link_to t('delete'), + admin_communication_website_category_path(website_id: @website.id, id: category.id), + method: :delete, + data: { confirm: t('please_confirm') }, + class: 'action text-danger ps-3' %> </div> </div> <ul class="list-unstyled treeview__children js-treeview-children js-treeview-sortable-container ms-4" data-id="<%= category.id %>"> diff --git a/app/views/admin/communication/websites/categories/index.html.erb b/app/views/admin/communication/websites/categories/index.html.erb index 37c76d8b7..6a78ae52c 100644 --- a/app/views/admin/communication/websites/categories/index.html.erb +++ b/app/views/admin/communication/websites/categories/index.html.erb @@ -1,17 +1,14 @@ <% content_for :title, "#{Communication::Website::Category.model_name.human(count: 2)} (#{@categories.count})" %> <%= render 'admin/communication/websites/sidebar' do %> - <div class="card"> - <div class="card-body"> - <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 'treebranch', categories: @root_categories %> - </ul> - </div> - </div> -<% end %> - -<% content_for :action_bar_right do %> - <%= create_link Communication::Website::Category %> + <% + action = create_link Communication::Website::Category + %> + <%= osuny_panel 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 'treebranch', categories: @root_categories %> + </ul> + <% end %> <% end %> -- GitLab