Skip to content

Commit

Permalink
feature: add dashboard_organization fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Aug 29, 2023
1 parent bca2729 commit e65dc8c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ Use a fix name from the parentheses to disable it via `ckanext.core_fix.disable_
Add csrf token to a dataset group list form
Already in master

8. Fix dashboard organization tab org labels and link (`dashboard_organization`)
Already in master

## Config settings

# Provide a list of fixes names to disable it
Expand Down
2 changes: 2 additions & 0 deletions ckanext/core_fix/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ class Fixes(Enum):
mobile_layout_breakpoint = auto()
restyle_activity = auto()
group_list_csrf = auto()
dashboard_organization = auto()


FIXES_WITH_TEMPLATES = [
Fixes.mobile_layout_breakpoint,
Fixes.markdown_macro,
Fixes.restyle_activity,
Fixes.group_list_csrf,
Fixes.dashboard_organization,
]

FIXES_WITH_CSS = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% extends "user/dashboard.html" %}

{% set org_type = h.default_group_type('organization') %}

{% block page_primary_action %}
{% if h.check_access('organization_create') %}
{% link_for h.humanize_entity_type('organization', org_type, 'add link') or _('Add Organization'), named_route=org_type ~ '.new', class_="btn btn-primary", icon="plus-square" %}
{% endif %}
{% endblock %}

{% block primary_content_inner %}
<h2 class="hide-heading">{{ h.humanize_entity_type('organization', org_type, 'my label') or _('My Organizations') }}</h2>
{% set organizations = h.organizations_available(permission='manage_group',
include_dataset_count=True,
include_member_count=True) %}
{% if organizations %}
<div class="wide">
{% snippet "organization/snippets/organization_list.html", organizations=organizations, show_capacity=True %}
</div>
{% else %}
<p class="empty">
{{ h.humanize_entity_type('organization', org_type, 'you not member') or _('You are not a member of any organizations.') }}
{% if h.check_access('organization_create') %}
{% link_for _('Create one now?'), named_route=org_type ~ '.new' %}
{% endif %}
</p>
{% endif %}
{% endblock %}

0 comments on commit e65dc8c

Please sign in to comment.