{# Copyright (C) 2026 Front Matter. Invenio App RDM is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. The menubar search: on a community page, the community's works, people, organizations and containers; elsewhere all of them. See invenio_pidbox/search_form.html. #} {%- import "invenio_pidbox/search_form.html" as search with context %} {#- In a community (its pages, or a people, organization or container search for it, ?community=), the works, people, organizations and containers of that community, and no search of everything: the community's own records first, after its collection's. #} {%- set community_slug = community.slug if community else ((request.args.get("community") or None) if (request and request.args is defined) else None) %} {% if community_slug %} {%- set options = [] %} {% if community and collection %} {% set root_collection=collection[collection.root] %} {% set options = options + [ { "key": "collections", "text": _("In this collection"), "value": url_for("invenio_app_rdm_communities.community_collection", pid_value=community.slug, collection_slug=root_collection.slug, tree_slug=tree.slug) }] %} {% endif %} {%- set options = options + [ { "key": "communities", "text": _("Works"), "value": url_for("invenio_app_rdm_communities.communities_detail", pid_value=community_slug), }] %} {%- set options = options + (search.kind_options | rejectattr("key", "equalto", "records") | list) %} {% else %} {%- set options = search.kind_options %} {% endif %}