Skip to content

Commit 9e3b4b1

Browse files
authored
Merge branch 'master' into fix/mathjax-description-wrap
2 parents 35e787f + 1042d0a commit 9e3b4b1

File tree

17 files changed

+147
-49
lines changed

17 files changed

+147
-49
lines changed

invenio_app_rdm/communities_ui/templates/semantic-ui/invenio_communities/collections/collection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h1 class="ui medium header">
4141

4242
{% if root_collection.breadcrumbs %}
4343
{%- for breadcrumb in root_collection.breadcrumbs -%}
44-
<a class="section" href="{{ breadcrumb.link }}">
44+
<a class="section" href="{{ breadcrumb.link or url_for('invenio_app_rdm_communities.community_collection', pid_value=community.slug, tree_slug=tree.slug, collection_slug=breadcrumb.slug) }}">
4545
{{ breadcrumb.title }}
4646
</a>
4747
{% if not loop.last %}

invenio_app_rdm/communities_ui/templates/semantic-ui/invenio_communities/collections/macros.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66
<div class="ui grid">
77
<div class="twelve wide column middle aligned left floated">
88
<div class="flex align-items-center">
9-
<img class="computer only rel-mr-1" src="{{ logo_url }}" width="45" height="auto" alt=""
10-
onerror="null;"/>
9+
<div class="collection-logo-wrapper computer only">
10+
<img class="collection-logo"
11+
src="{{ logo_url }}"
12+
alt="{{ root_collection.title }}"
13+
onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';" />
14+
<div class="collection-logo-fallback" style="display:none;">
15+
<i class="folder open outline icon"></i>
16+
</div>
17+
</div>
1118
<h4 class="theme-primary-text mt-0">
1219
<a
1320
href='{{ url_for("invenio_app_rdm_communities.community_collection", pid_value=community.slug, collection_slug=root_collection.slug, tree_slug=tree.slug )}}'>

invenio_app_rdm/communities_ui/views/communities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def communities_browse(pid_value, community, community_ui):
129129
collections_service = current_collections.service
130130

131131
trees_ui = collections_service.list_trees(
132-
g.identity, community_id=community.id, depth=2
132+
g.identity, namespace_id=community.id, depth=2
133133
).to_dict()
134134
return render_community_theme_template(
135135
"invenio_communities/details/browse/index.html",
@@ -180,7 +180,7 @@ def community_collection(
180180
try:
181181
collection = collections_service.read(
182182
identity=g.identity,
183-
community_id=community.id,
183+
namespace_id=community.id,
184184
slug=collection_slug,
185185
tree_slug=tree_slug,
186186
)

invenio_app_rdm/communities_ui/views/ui.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# under the terms of the MIT License; see LICENSE file for more details.
1010
"""Communities UI blueprints module."""
1111

12-
from flask import Blueprint, current_app, request
12+
from flask import Blueprint, current_app, g, request
13+
from invenio_collections.proxies import current_collections
1314
from invenio_collections.searchapp import search_app_context as c_search_app_context
1415
from invenio_communities.errors import CommunityDeletedError
1516
from invenio_communities.views.ui import (
@@ -37,10 +38,29 @@
3738

3839
def _show_browse_page():
3940
"""Whether the browse page should be visible in the menu."""
40-
return (
41-
current_app.config.get("COMMUNITIES_SHOW_BROWSE_MENU_ENTRY", False)
42-
and request.community["children"]["allow"]
43-
)
41+
feature_enabled = current_app.config.get("COMMUNITIES_COLLECTIONS_ENABLED", True)
42+
if not feature_enabled:
43+
return False
44+
45+
community = getattr(request, "community", None)
46+
if not community:
47+
return False
48+
49+
subcommunities_enabled = community.get("children", {}).get("allow", False)
50+
51+
has_collections = False
52+
try:
53+
collections_service = current_collections.service
54+
community_id = community.get("id")
55+
if community_id:
56+
trees = collections_service.list_trees(
57+
g.identity, namespace_id=community_id, depth=0
58+
)
59+
has_collections = len(trees.to_dict()) > 0
60+
except Exception:
61+
has_collections = False
62+
63+
return subcommunities_enabled or has_collections
4464

4565

4666
def create_ui_blueprint(app):

invenio_app_rdm/config.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright (C) 2019-2025 CERN.
3+
# Copyright (C) 2019-2026 CERN.
44
# Copyright (C) 2019-2020 Northwestern University.
55
# Copyright (C) 2021-2025 Graz University of Technology.
66
# Copyright (C) 2022-2025 KTH Royal Institute of Technology.
@@ -80,7 +80,6 @@
8080
InvalidAccessRestrictions,
8181
InvalidCommunityVisibility,
8282
)
83-
from invenio_rdm_records.services.github.release import RDMGithubRelease
8483
from invenio_rdm_records.services.permissions import RDMRequestsPermissionPolicy
8584
from invenio_rdm_records.services.stats import permissions_policy_lookup_factory
8685
from invenio_rdm_records.services.tasks import StatsRDMReindexTask
@@ -1065,8 +1064,6 @@ def github_link_render(record):
10651064
}
10661065
"""Community requests search configuration (i.e list of community requests)"""
10671066

1068-
COMMUNITIES_SHOW_BROWSE_MENU_ENTRY = False
1069-
"""Toggle to show or hide the 'Browse' menu entry for communities."""
10701067

10711068
# Invenio-RDM-Records
10721069
# ===================
@@ -1480,13 +1477,6 @@ def github_link_render(record):
14801477
}
14811478

14821479

1483-
# Invenio-Github
1484-
# =================
1485-
#
1486-
GITHUB_RELEASE_CLASS = RDMGithubRelease
1487-
"""Default RDM release class."""
1488-
1489-
14901480
# Flask-Menu
14911481
# ==========
14921482
#
@@ -1564,3 +1554,11 @@ def github_link_render(record):
15641554
"is_open": {"facet": facets.is_open, "ui": {"field": "is_open"}},
15651555
}
15661556
"""Available facets defined for this module."""
1557+
1558+
# Invenio-VCS
1559+
# ===========
1560+
VCS_TEMPLATE_INDEX = "invenio_vcs/rdm-index.html"
1561+
VCS_TEMPLATE_INDEX_ITEM = "invenio_vcs/rdm-index-item.html"
1562+
VCS_TEMPLATE_VIEW = "invenio_vcs/rdm-view.html"
1563+
VCS_TEMPLATE_REPO_SWITCH = "invenio_vcs/rdm-repo-switch.html"
1564+
VCS_TEMPLATE_RELEASE_ITEM = "invenio_vcs/rdm-release-item.html"

invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/creatibutors.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h3 class="sr-only">{{ _('Authors/Creators') }}</h3>
3434
<h3>{{ _('Contributors') }}</h3>
3535
{%- for group in record_ui["ui"]["contributors"]["contributors"]|groupby('role.title')%}
3636
<div>
37-
<h3 class="creatibutors-header ui small header">{{group.grouper}}{%- if group.list|length > 1 -%}s{%- endif -%}:</h3>
37+
<h3 class="creatibutors-header ui small header">{{group.grouper}}{% if group.list|length > 1 %} ({{group.list|length}}){% endif %}:</h3>
3838
<ul class="creatibutors">
3939
{{ show_creatibutors(group.list, show_affiliations=True, type="contributors") }}
4040
</ul>

invenio_app_rdm/records_ui/views/records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def record_latest(record=None, **kwargs):
473473

474474
@pass_record_from_pid
475475
def record_from_pid(record=None, **kwargs):
476-
"""Redirect to record's latest version page."""
476+
"""Redirect to record's page."""
477477
return redirect(record["links"]["self_html"], code=302)
478478

479479

invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/community-invitation/user_dashboard.html

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,13 @@
22

33
This file is part of Invenio.
44
Copyright (C) 2022 CERN.
5+
Copyright (C) 2026 Northwestern University.
56

67
Invenio is free software; you can redistribute it and/or modify it
78
under the terms of the MIT License; see LICENSE file for more details.
89
#}
9-
{% set title = invenio_request.title %}
10-
{% extends "invenio_requests/details/index.html" %}
11-
{% from "invenio_requests/macros/request_header.html" import invitation_request_header %}
12-
13-
14-
{% block request_header %}
15-
{% set back_button_url = url_for("invenio_app_rdm_users.requests") %}
16-
{{
17-
invitation_request_header(
18-
back_button_url=back_button_url,
19-
back_button_text=_("Back to requests"),
20-
request=invenio_request,
21-
accepted=request_is_accepted
22-
)
23-
}}
24-
{% endblock %}
25-
26-
{% set active_dashboard_menu_item = 'requests' %}
10+
{#
11+
Kept as pure extension with no customization only to keep the call structure
12+
in the view for those who do have customization.
13+
#}
14+
{% extends "invenio_requests/user_dashboard.html" %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{# -*- coding: utf-8 -*-
2+
3+
Copyright (C) 2026 Northwestern University.
4+
5+
Invenio App RDM is free software; you can redistribute it and/or modify it
6+
under the terms of the MIT License; see LICENSE file for more details.
7+
#}
8+
9+
{#
10+
Kept as pure extension with no customization only to keep the call structure
11+
in the view for those who do have customization.
12+
#}
13+
{% extends "invenio_requests/user_dashboard.html" %}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{# -*- coding: utf-8 -*-
2+
3+
Copyright (C) 2026 Northwestern University.
4+
5+
Invenio App RDM is free software; you can redistribute it and/or modify it
6+
under the terms of the MIT License; see LICENSE file for more details.
7+
#}
8+
9+
{% extends "invenio_requests/details/index.html" %}
10+
11+
{% set title = invenio_request.title %}
12+
{% set active_dashboard_menu_item = 'requests' %}
13+
14+
{% block request_header %}
15+
<div class="flex wrap space-between">
16+
<div class="mb-10">
17+
<a href="{{ url_for('invenio_app_rdm_users.requests') }}" class="ui small button labeled icon rel-mr-1">
18+
<i class="ui icon left arrow" aria-hidden="true"></i>
19+
{{ _("Back to requests") }}
20+
</a>
21+
</div>
22+
23+
<div id="request-actions" class="flex align-items-center ml-auto mb-10">
24+
{% if is_accepted_request(invenio_request) %}
25+
<a href="{{ url_for('invenio_app_rdm_communities.communities_detail', pid_value=invenio_request.topic.community) }}"
26+
class="ui small button">
27+
{{ _("View Community") }}
28+
</a>
29+
{% endif %}
30+
</div>
31+
</div>
32+
33+
<h2 class="ui header">{{ invenio_request.title }}</h2>
34+
<p class="ui header">{{ invenio_request.description|safe }}</p>
35+
36+
<div class="ui divider"></div>
37+
{% endblock %}

0 commit comments

Comments
 (0)