{# -*- 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 %}
{% endif %}