{# -*- coding: utf-8 -*- This file is part of Invenio. Copyright (C) 2016-2024 CERN. Copyright (C) 2024-2026 Northwestern University. Copyright (C) 2025 Graz University of Technology. Invenio is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. #} {%- from "invenio_theme/macros/truncate.html" import truncate_text %} {%- from "invenio_communities/details/macros/access-status-label.html" import access_status_label -%} {% macro button_for_membership(community_ui) %} {# Macro to display the button related to membership (request or discussion) #} {# Ths conditionals try hard to reduce the need for a DB hit #} {% if config.COMMUNITIES_ALLOW_MEMBERSHIP_REQUESTS %} {% if community_ui["access"]["member_policy"] == "open" %} {# The below permission check includes the above checks among other checks, so it was not enough on its own to prevent a large swath of cases where the DB could be hit. #} {% if permissions.can_request_membership %}
{% else %} {% set request_id_of_pending_member = get_request_id_of_pending_member(g.identity, community_ui["id"]) %} {# None if no pending membership or invitation request #} {% if request_id_of_pending_member %} {{ _("Membership discussion") }} {% endif %} {% endif %} {% endif %} {% endif %} {% endmacro %} {% macro community_title(community_ui) %}
{{ community_ui["metadata"]["title"] }} {% if community_ui['parent'] %}

{% endif %}
{% endmacro %}
{{community_title(community_ui)}}
{{community_title(community_ui)}} {% if community_ui["access"]["visibility"] == 'restricted' %}
{{ access_status_label() }}
{% endif %}
{% if community_ui["access"]["visibility"] == 'restricted' %}
{{ access_status_label() }}
{% endif %} {% if community_ui['parent'] %} {% endif %} {% if community_ui["metadata"]["website"] %} {% endif %} {% if community_ui["metadata"]["type"] is defined %}
{{ community_ui["ui"]["type"]["title_l10n"] }}
{% endif %} {% if community_ui["metadata"]["organizations"] %}
{% endif %}
{{ button_for_membership(community_ui) }} {%- if not community_use_jinja_header %} {%- if not permissions.can_submit_record %}
{% endif %} {{ _("New upload") }} {% endif %} {% if permissions.can_moderate %} {{ _("Manage community") }} {% endif %}