From 417955d07e1b41ea68f1075c83a22a22a7a18b0c Mon Sep 17 00:00:00 2001 From: Craig Williams Date: Thu, 19 May 2022 15:04:34 +0100 Subject: [PATCH] Changed the organisation navigation menu slightly to better handle single organisation mode --- locale/en_US/messages.php | 5 ++- templates/navigation/sidebar-menu.html.twig | 34 ++++++++++++++------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/locale/en_US/messages.php b/locale/en_US/messages.php index c434359..9fcde3b 100644 --- a/locale/en_US/messages.php +++ b/locale/en_US/messages.php @@ -54,7 +54,10 @@ return [ 'MEMBER_COUNT' => '# Members (excl admins)', 'ADMIN_COUNT' => '# Admins', - 'SELF' => 'My Organisations', + 'SELF' => [ + 1 => 'My Organisation', + 2 => 'My Organisations', + ], 'MANAGE' => 'Manage Organisations', 'ASSIGN_NEW' => 'Assign to organisation', diff --git a/templates/navigation/sidebar-menu.html.twig b/templates/navigation/sidebar-menu.html.twig index 87007ab..b08d4bb 100644 --- a/templates/navigation/sidebar-menu.html.twig +++ b/templates/navigation/sidebar-menu.html.twig @@ -1,25 +1,37 @@ {% extends "@admin/navigation/sidebar-menu.html.twig" %} -{% block navigation %} - {{ parent() }} - +{% block organisations_nav %} {% if checkAccess('uri_organisations') %}
  • {{ translate("ORGANISATION", 2) }}
  • {% endif %} {% if current_user.organisations.count() > 0 %} -
  • - - -
  • + {% endif %} {% endif %} {% endblock %} + +{% block navigation %} + {{ parent() }} + {{ block('organisations_nav') }} +{% endblock %}