From e726abe318bf9c0076cd7f5a34ceb2dd1ffa37cb Mon Sep 17 00:00:00 2001 From: blagoja Date: Tue, 18 Jun 2024 14:51:09 +0200 Subject: [PATCH 1/4] Set orgs_available in user read_base template --- ckan/templates/user/read_base.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ckan/templates/user/read_base.html b/ckan/templates/user/read_base.html index 223ba814351..a34ee576249 100644 --- a/ckan/templates/user/read_base.html +++ b/ckan/templates/user/read_base.html @@ -1,6 +1,16 @@ {% extends "page.html" %} {% set user = user_dict %} +{% set orgs_available = h.organizations_available(permission='manage_group', + include_dataset_count=True, + include_member_count=True, + user=user['name']) +%} +{% set groups_available = h.groups_available(am_member=True, + include_dataset_count=True, + include_member_count=True, + user=user['name']) +%} {% set dataset_type = h.default_package_type() %} {% set org_type = h.default_group_type('organization') %} {% set group_type = h.default_group_type('group') %} From f2ffa463a7a95cb22c4841982dfdbc5b2f221be7 Mon Sep 17 00:00:00 2001 From: blagoja Date: Tue, 25 Jun 2024 20:54:29 +0200 Subject: [PATCH 2/4] Reverse changes to read_base.html --- ckan/templates/user/read_base.html | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ckan/templates/user/read_base.html b/ckan/templates/user/read_base.html index a34ee576249..223ba814351 100644 --- a/ckan/templates/user/read_base.html +++ b/ckan/templates/user/read_base.html @@ -1,16 +1,6 @@ {% extends "page.html" %} {% set user = user_dict %} -{% set orgs_available = h.organizations_available(permission='manage_group', - include_dataset_count=True, - include_member_count=True, - user=user['name']) -%} -{% set groups_available = h.groups_available(am_member=True, - include_dataset_count=True, - include_member_count=True, - user=user['name']) -%} {% set dataset_type = h.default_package_type() %} {% set org_type = h.default_group_type('organization') %} {% set group_type = h.default_group_type('group') %} From 0270dd4b1668ff027f43dddba55af56bf99e8adc Mon Sep 17 00:00:00 2001 From: blagoja Date: Tue, 25 Jun 2024 21:01:27 +0200 Subject: [PATCH 3/4] Add orgs_available to read user organizations template --- ckan/templates/user/read_organizations.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ckan/templates/user/read_organizations.html b/ckan/templates/user/read_organizations.html index c7f5e6ad01a..3b607a3ecfa 100644 --- a/ckan/templates/user/read_organizations.html +++ b/ckan/templates/user/read_organizations.html @@ -1,6 +1,12 @@ {% extends "user/read_base.html" %} +{% set user = user_dict %} {% set group_type = h.default_group_type('organization') %} +{% set orgs_available = h.organizations_available(permission='manage_group', + include_dataset_count=True, + include_member_count=True, + user=user['name']) +%} {% block primary_content_inner %}

{{ h.humanize_entity_type('organization', group_type, 'facet label') or _('Organizations') }}

From 65734cc5458eb779e473de1de8527101f66e70ae Mon Sep 17 00:00:00 2001 From: blagoja Date: Tue, 25 Jun 2024 21:03:39 +0200 Subject: [PATCH 4/4] Add groups_available to read user groups template --- ckan/templates/user/read_groups.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ckan/templates/user/read_groups.html b/ckan/templates/user/read_groups.html index 8e7b78b53dd..f3c54e7b067 100644 --- a/ckan/templates/user/read_groups.html +++ b/ckan/templates/user/read_groups.html @@ -1,6 +1,12 @@ {% extends "user/read_base.html" %} +{% set user = user_dict %} {% set group_type = h.default_group_type('group') %} +{% set groups_available = h.groups_available(am_member=True, + include_dataset_count=True, + include_member_count=True, + user=user['name']) +%} {% block primary_content_inner %}

{{ h.humanize_entity_type('group', group_type, 'facet label') or _('Groups') }}