diff --git a/app/components/management/menu_component.html.erb b/app/components/management/menu_component.html.erb index f544ad0b2..5c125bf08 100644 --- a/app/components/management/menu_component.html.erb +++ b/app/components/management/menu_component.html.erb @@ -1,19 +1 @@ -
+<%= link_list(*links, id: "admin_menu", data: { "accordion-menu": true }) %> diff --git a/app/components/management/menu_component.rb b/app/components/management/menu_component.rb index 5890fde08..67a31c790 100644 --- a/app/components/management/menu_component.rb +++ b/app/components/management/menu_component.rb @@ -1,6 +1,15 @@ class Management::MenuComponent < ApplicationComponent use_helpers :managed_user, :link_list + def links + [ + user_links, + (print_investments_link if Setting["process.budgets"]), + print_proposals_link, + user_invites_link + ] + end + private def user_links @@ -73,6 +82,33 @@ class Management::MenuComponent < ApplicationComponent ] end + def print_investments_link + [ + t("management.menu.print_budget_investments"), + print_investments_management_budgets_path, + print_investments?, + class: "print-investments-link" + ] + end + + def print_proposals_link + [ + t("management.menu.print_proposals"), + print_management_proposals_path, + print_proposals?, + class: "print-proposals-link" + ] + end + + def user_invites_link + [ + t("management.menu.user_invites"), + new_management_user_invite_path, + user_invites?, + class: "invitations-link" + ] + end + def users? ["users", "email_verifications", "document_verifications"].include?(controller_name) end