Skip to content

Commit

Permalink
collections: added search in collection
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo committed Oct 15, 2024
1 parent 4da11f8 commit 12aace4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h1 class="ui medium header">
<div class="ui divider mt-0 mb-0" aria-hidden="true"></div>
<!-- Collection record search -->
<div id="collection-search"
data-invenio-search-config='{{search_app_collection_config(app_id="InvenioAppRDM.CollectionsSearch", endpoint=root_collection["links"]["search"], hidden_params=[["q", root_collection["query"]]]) | tojson }}'
data-invenio-search-config='{{search_app_collection_config(app_id="InvenioAppRDM.CollectionsSearch", endpoint=root_collection["links"]["search"], hidden_params=[["collection_id", root_collection["id"]]]) | tojson }}'
data-permissions='{{ permissions | tojson }}'>
</div>
{%- endblock page_body %}
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@

{% if community %}
{% set options = [
{
"key": "communities",
"text": _("In this community"),
"value": url_for("invenio_app_rdm_communities.communities_detail", pid_value=community.slug),
},
{
"key": "records",
"text": _("All") + " " + config.THEME_SITENAME,
"value": url_for("invenio_search_ui.search"),
}]
%}
{% if collection %}
{% set root_collection=collection[collection.root] %}
{% set 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)
},
{
"key": "communities",
"text": _("In this community"),
"value": url_for("invenio_app_rdm_communities.communities_detail", pid_value=community.slug),
},
{
"key": "records",
"text": _("All") + " " + config.THEME_SITENAME,
"value": url_for("invenio_search_ui.search"),
}]
%}
{% else %}
{% set options = [
{
"key": "communities",
"text": _("In this community"),
"value": url_for("invenio_app_rdm_communities.communities_detail", pid_value=community.slug),
},
{
"key": "records",
"text": _("All") + " " + config.THEME_SITENAME,
"value": url_for("invenio_search_ui.search"),
}]
%}
{% endif %}
{% else %}
{% set options = [
{
Expand Down

0 comments on commit 12aace4

Please sign in to comment.