From cd38ed6f00e57a842e29b23ef1a124ca10d00896 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Fri, 17 Mar 2023 16:00:39 +0100 Subject: [PATCH] button --- .../admin/communication/websites/posts/index.html.erb | 10 ++++++---- .../admin/communication/websites/show/_posts.html.erb | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/views/admin/communication/websites/posts/index.html.erb b/app/views/admin/communication/websites/posts/index.html.erb index 5b8d75f41..a007077e0 100644 --- a/app/views/admin/communication/websites/posts/index.html.erb +++ b/app/views/admin/communication/websites/posts/index.html.erb @@ -6,7 +6,12 @@ <% end %> <%= render 'admin/communication/websites/sidebar' do %> - <% action = create_link Communication::Website::Post %> + <% + action = create_link Communication::Website::Post + action += link_to t('communication.website.posts.new_curation'), + new_admin_communication_website_post_curation_path(website_id: @website.id), + class: button_classes('ms-2 btn-light') if can?(:create, Communication::Website::Post) + %> <%= osuny_panel Communication::Website::Post.model_name.human(count: 2), action: action do %> <%= render 'filters', current_path: admin_communication_website_posts_path, filters: @filters %> <div data-batch-selectable class="mb-5"> @@ -33,9 +38,6 @@ </div> <% end %> </div> - <%= link_to t('communication.website.posts.new_curation'), - new_admin_communication_website_post_curation_path(website_id: @website.id), - class: button_classes('btn-light') if can?(:create, Communication::Website::Post) %> <% end %> <% if can?(:create, Communication::Website::Category) || (@root_categories.any? && can?(:edit, @root_categories.first)) %> <% action = create_link Communication::Website::Category %> diff --git a/app/views/admin/communication/websites/show/_posts.html.erb b/app/views/admin/communication/websites/show/_posts.html.erb index 6a58f6573..e46152ab6 100644 --- a/app/views/admin/communication/websites/show/_posts.html.erb +++ b/app/views/admin/communication/websites/show/_posts.html.erb @@ -1,11 +1,11 @@ <% 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) + class: button_classes if can?(:create, Communication::Website::Post) +action += link_to t('communication.website.posts.new_curation'), + new_admin_communication_website_post_curation_path(website_id: @website.id), + class: button_classes('ms-2 btn-light') if can?(:create, Communication::Website::Post) subtitle = link_to t('communication.website.see_all', number: @all_posts.size), admin_communication_website_posts_path(website_id: @website) %> <%= osuny_panel t('communication.website.last_posts'), -- GitLab