invenio-app-rdm 13.0.0b3.dev16__py2.py3-none-any.whl → 13.0.0b3.dev18__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- invenio_app_rdm/__init__.py +1 -1
- invenio_app_rdm/communities_ui/sitemap.py +63 -0
- invenio_app_rdm/communities_ui/views/communities.py +9 -8
- invenio_app_rdm/communities_ui/views/ui.py +1 -1
- invenio_app_rdm/config.py +14 -0
- invenio_app_rdm/records_ui/sitemap.py +44 -0
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html +46 -47
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/access-form.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/citation.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/creatibutors.html +9 -9
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/description.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/details.html +22 -22
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/meta.html +8 -8
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/communities.html +6 -6
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/details.html +8 -8
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/export.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/keywords_subjects.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/licenses.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/locations.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/manage_menu.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/metrics.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/technical_metadata.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/versions.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/stats.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/subjects.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/doi.html +2 -2
- invenio_app_rdm/records_ui/views/records.py +2 -1
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/community-submission/index.html +2 -2
- invenio_app_rdm/requests_ui/views/requests.py +6 -3
- invenio_app_rdm/theme/{static → templates/semantic-ui/invenio_app_rdm}/robots.txt +4 -0
- invenio_app_rdm/theme/views.py +6 -2
- {invenio_app_rdm-13.0.0b3.dev16.dist-info → invenio_app_rdm-13.0.0b3.dev18.dist-info}/METADATA +16 -3
- {invenio_app_rdm-13.0.0b3.dev16.dist-info → invenio_app_rdm-13.0.0b3.dev18.dist-info}/RECORD +41 -38
- {invenio_app_rdm-13.0.0b3.dev16.dist-info → invenio_app_rdm-13.0.0b3.dev18.dist-info}/WHEEL +1 -1
- tests/conftest.py +126 -8
- tests/ui/conftest.py +6 -8
- tests/ui/test_robotstxt.py +35 -0
- tests/ui/test_sitemaps.py +85 -0
- tests/ui/test_static.py +0 -25
- {invenio_app_rdm-13.0.0b3.dev16.dist-info → invenio_app_rdm-13.0.0b3.dev18.dist-info}/entry_points.txt +0 -0
- {invenio_app_rdm-13.0.0b3.dev16.dist-info → invenio_app_rdm-13.0.0b3.dev18.dist-info}/licenses/LICENSE +0 -0
- {invenio_app_rdm-13.0.0b3.dev16.dist-info → invenio_app_rdm-13.0.0b3.dev18.dist-info}/top_level.txt +0 -0
invenio_app_rdm/__init__.py
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2025 CERN.
|
|
4
|
+
# Copyright (C) 2025 Northwestern University.
|
|
5
|
+
#
|
|
6
|
+
# Invenio-App-RDM is free software; you can redistribute it and/or modify it
|
|
7
|
+
# under the terms of the MIT License; see LICENSE file for more details.
|
|
8
|
+
|
|
9
|
+
"""Community sitemap content."""
|
|
10
|
+
|
|
11
|
+
from invenio_base import invenio_url_for
|
|
12
|
+
from invenio_communities.proxies import current_communities
|
|
13
|
+
from invenio_search.api import RecordsSearchV2
|
|
14
|
+
from invenio_sitemap import SitemapSection, format_to_w3c
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SitemapSectionOfCommunities(SitemapSection):
|
|
18
|
+
"""Defines the Sitemap entries for Communities."""
|
|
19
|
+
|
|
20
|
+
def iter_entities(self):
|
|
21
|
+
"""Iterate over objects."""
|
|
22
|
+
communities_scan = (
|
|
23
|
+
RecordsSearchV2(index=current_communities.service.record_cls.index._name)
|
|
24
|
+
.filter("term", **{"access.visibility": "public"})
|
|
25
|
+
.filter("term", deletion_status="P")
|
|
26
|
+
.sort("-updated")
|
|
27
|
+
# Using preserve_order is fine.
|
|
28
|
+
# Using Point in Time is a recommended alternative but not
|
|
29
|
+
# particularly better than this one for our needs. See
|
|
30
|
+
# https://opensearch.org/docs/latest/search-plugins/searching-data/point-in-time/
|
|
31
|
+
.params(preserve_order=True)
|
|
32
|
+
# In keeping with original: only page is looked for
|
|
33
|
+
# (curation policy is not most relevant)
|
|
34
|
+
.source(["slug", "updated", "metadata.page"])
|
|
35
|
+
.scan()
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
for community in communities_scan:
|
|
39
|
+
yield {
|
|
40
|
+
"slug": community.slug,
|
|
41
|
+
"updated": community.updated,
|
|
42
|
+
"loc": invenio_url_for(
|
|
43
|
+
"invenio_app_rdm_communities.communities_detail",
|
|
44
|
+
pid_value=community.slug,
|
|
45
|
+
),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if "page" in community.get("metadata", {}):
|
|
49
|
+
yield {
|
|
50
|
+
"slug": community.slug,
|
|
51
|
+
"updated": community.updated,
|
|
52
|
+
"loc": invenio_url_for(
|
|
53
|
+
"invenio_communities.communities_about",
|
|
54
|
+
pid_value=community.slug,
|
|
55
|
+
),
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
def to_dict(self, entity):
|
|
59
|
+
"""To dict used in sitemap."""
|
|
60
|
+
return {
|
|
61
|
+
"loc": entity["loc"],
|
|
62
|
+
"lastmod": format_to_w3c(entity["updated"]),
|
|
63
|
+
}
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
"""Request views module."""
|
|
10
10
|
|
|
11
11
|
from flask import abort, g, redirect, request, url_for
|
|
12
|
+
from invenio_collections.errors import (
|
|
13
|
+
CollectionNotFound,
|
|
14
|
+
CollectionTreeNotFound,
|
|
15
|
+
LogoNotFoundError,
|
|
16
|
+
)
|
|
17
|
+
from invenio_collections.proxies import current_collections
|
|
12
18
|
from invenio_communities.views.communities import (
|
|
13
19
|
HEADER_PERMISSIONS,
|
|
14
20
|
_get_roles_can_invite,
|
|
@@ -18,11 +24,6 @@ from invenio_communities.views.communities import (
|
|
|
18
24
|
from invenio_communities.views.decorators import pass_community
|
|
19
25
|
from invenio_pages.proxies import current_pages_service
|
|
20
26
|
from invenio_pages.records.errors import PageNotFoundError
|
|
21
|
-
from invenio_rdm_records.collections import (
|
|
22
|
-
CollectionNotFound,
|
|
23
|
-
CollectionTreeNotFound,
|
|
24
|
-
LogoNotFoundError,
|
|
25
|
-
)
|
|
26
27
|
from invenio_rdm_records.proxies import (
|
|
27
28
|
current_community_records_service,
|
|
28
29
|
current_rdm_records,
|
|
@@ -54,7 +55,7 @@ def communities_detail(pid_value, community, community_ui):
|
|
|
54
55
|
def communities_home(pid_value, community, community_ui):
|
|
55
56
|
"""Community home page."""
|
|
56
57
|
query_params = request.args
|
|
57
|
-
collections_service =
|
|
58
|
+
collections_service = current_collections.service
|
|
58
59
|
permissions = community.has_permissions_to(HEADER_PERMISSIONS)
|
|
59
60
|
if not permissions["can_read"]:
|
|
60
61
|
raise PermissionDeniedError()
|
|
@@ -124,7 +125,7 @@ def communities_browse(pid_value, community, community_ui):
|
|
|
124
125
|
"""Community browse page."""
|
|
125
126
|
permissions = community.has_permissions_to(HEADER_PERMISSIONS)
|
|
126
127
|
|
|
127
|
-
collections_service =
|
|
128
|
+
collections_service = current_collections.service
|
|
128
129
|
|
|
129
130
|
trees_ui = collections_service.list_trees(
|
|
130
131
|
g.identity, community_id=community.id, depth=2
|
|
@@ -167,7 +168,7 @@ def community_collection(
|
|
|
167
168
|
community, community_ui, pid_value, tree_slug=None, collection_slug=None
|
|
168
169
|
):
|
|
169
170
|
"""Render a community collection page."""
|
|
170
|
-
collections_service =
|
|
171
|
+
collections_service = current_collections.service
|
|
171
172
|
try:
|
|
172
173
|
collection = collections_service.read(
|
|
173
174
|
identity=g.identity,
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"""Communities UI blueprints module."""
|
|
11
11
|
|
|
12
12
|
from flask import Blueprint, current_app, request
|
|
13
|
+
from invenio_collections.searchapp import search_app_context as c_search_app_context
|
|
13
14
|
from invenio_communities.errors import CommunityDeletedError
|
|
14
15
|
from invenio_communities.views.ui import (
|
|
15
16
|
not_found_error,
|
|
@@ -17,7 +18,6 @@ from invenio_communities.views.ui import (
|
|
|
17
18
|
record_tombstone_error,
|
|
18
19
|
)
|
|
19
20
|
from invenio_pidstore.errors import PIDDeletedError, PIDDoesNotExistError
|
|
20
|
-
from invenio_rdm_records.collections import search_app_context as c_search_app_context
|
|
21
21
|
from invenio_records_resources.services.errors import (
|
|
22
22
|
PermissionDeniedError,
|
|
23
23
|
RecordPermissionDeniedError,
|
invenio_app_rdm/config.py
CHANGED
|
@@ -167,6 +167,8 @@ from invenio_vocabularies.contrib.subjects.datastreams import (
|
|
|
167
167
|
)
|
|
168
168
|
from werkzeug.local import LocalProxy
|
|
169
169
|
|
|
170
|
+
from .communities_ui.sitemap import SitemapSectionOfCommunities
|
|
171
|
+
from .records_ui.sitemap import SitemapSectionOfRDMRecords
|
|
170
172
|
from .theme.views import notification_settings
|
|
171
173
|
from .users.schemas import NotificationsUserSchema, UserPreferencesNotificationsSchema
|
|
172
174
|
|
|
@@ -485,6 +487,10 @@ CELERY_BEAT_SCHEDULE = {
|
|
|
485
487
|
"task": "invenio_jobs.logging.tasks.delete_logs",
|
|
486
488
|
"schedule": crontab(minute=5, hour=0),
|
|
487
489
|
},
|
|
490
|
+
"update_sitemap": {
|
|
491
|
+
"task": "invenio_sitemap.tasks.update_sitemap_cache",
|
|
492
|
+
"schedule": crontab(minute=0, hour=2),
|
|
493
|
+
},
|
|
488
494
|
}
|
|
489
495
|
"""Scheduled tasks configuration (aka cronjobs)."""
|
|
490
496
|
|
|
@@ -1479,3 +1485,11 @@ APP_RDM_SUBCOMMUNITIES_LABEL = "Subcommunities"
|
|
|
1479
1485
|
|
|
1480
1486
|
RDM_DETAIL_SIDE_BAR_MANAGE_ATTRIBUTES_EXTENSION_TEMPLATE = None
|
|
1481
1487
|
"""Side bar manage attributes extension template."""
|
|
1488
|
+
|
|
1489
|
+
# Invenio-Sitemap
|
|
1490
|
+
# ===============
|
|
1491
|
+
# See https://github.com/inveniosoftware/invenio-sitemap/blob/master/invenio_sitemap/config.py # noqa
|
|
1492
|
+
SITEMAP_SECTIONS = [
|
|
1493
|
+
SitemapSectionOfRDMRecords(),
|
|
1494
|
+
SitemapSectionOfCommunities(),
|
|
1495
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2025 CERN.
|
|
4
|
+
# Copyright (C) 2025 Northwestern University.
|
|
5
|
+
#
|
|
6
|
+
# Invenio-App-RDM is free software; you can redistribute it and/or modify it
|
|
7
|
+
# under the terms of the MIT License; see LICENSE file for more details.
|
|
8
|
+
|
|
9
|
+
"""RDMRecords sitemap content."""
|
|
10
|
+
|
|
11
|
+
from invenio_base import invenio_url_for
|
|
12
|
+
from invenio_rdm_records.proxies import current_rdm_records_service
|
|
13
|
+
from invenio_search.api import RecordsSearchV2
|
|
14
|
+
from invenio_sitemap import SitemapSection, format_to_w3c
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SitemapSectionOfRDMRecords(SitemapSection):
|
|
18
|
+
"""Defines the Sitemap entries for Records."""
|
|
19
|
+
|
|
20
|
+
def iter_entities(self):
|
|
21
|
+
"""Iterate over objects."""
|
|
22
|
+
records_scan = (
|
|
23
|
+
RecordsSearchV2(index=current_rdm_records_service.record_cls.index._name)
|
|
24
|
+
.filter("term", **{"access.record": "public"})
|
|
25
|
+
.filter("term", deletion_status="P")
|
|
26
|
+
.sort("-updated")
|
|
27
|
+
# Using preserve_order is fine.
|
|
28
|
+
# Using Point in Time is a recommended alternative but not
|
|
29
|
+
# particularly better than this one for our needs. See
|
|
30
|
+
# https://opensearch.org/docs/latest/search-plugins/searching-data/point-in-time/
|
|
31
|
+
.params(preserve_order=True)
|
|
32
|
+
.source(["id", "updated"])
|
|
33
|
+
.scan()
|
|
34
|
+
)
|
|
35
|
+
return records_scan
|
|
36
|
+
|
|
37
|
+
def to_dict(self, entity):
|
|
38
|
+
"""To dict used in sitemap."""
|
|
39
|
+
return {
|
|
40
|
+
"loc": invenio_url_for(
|
|
41
|
+
"invenio_app_rdm_records.record_detail", pid_value=entity["id"]
|
|
42
|
+
),
|
|
43
|
+
"lastmod": format_to_w3c(entity["updated"]),
|
|
44
|
+
}
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
{%- from "invenio_app_rdm/records/macros/files.html" import file_list_box, preview_file_box, media_file_list_box %}
|
|
25
25
|
|
|
26
|
-
{%- set title =
|
|
27
|
-
{%- set metadata =
|
|
26
|
+
{%- set title = record_ui["metadata"]["title"] %}
|
|
27
|
+
{%- set metadata = record_ui["metadata"] %}
|
|
28
28
|
|
|
29
29
|
{%- set can_curate_record = permissions is defined and (permissions.can_edit or permissions.can_review) %}
|
|
30
30
|
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
{%- set is_preview_submission_request = preview_submission_request or false %}
|
|
33
33
|
{%- set show_record_management_menu = can_curate_record and (not is_preview or is_preview_submission_request) %}
|
|
34
34
|
|
|
35
|
-
{%- if
|
|
36
|
-
{%- set allow_user_requests = not current_user.is_anonymous and
|
|
37
|
-
{%- set allow_guest_requests = current_user.is_anonymous and
|
|
35
|
+
{%- if record_ui["parent"]["access"]["settings"] %}
|
|
36
|
+
{%- set allow_user_requests = not current_user.is_anonymous and record_ui["parent"]["access"]["settings"]["allow_user_requests"] %}
|
|
37
|
+
{%- set allow_guest_requests = current_user.is_anonymous and record_ui["parent"]["access"]["settings"]["allow_guest_requests"] %}
|
|
38
38
|
{%- endif %}
|
|
39
39
|
|
|
40
40
|
{%- block head_meta %}
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
|
|
50
50
|
{%- block page_body %}
|
|
51
51
|
<section id="banners" class="banners" aria-label="{{ _('Information banner') }}">
|
|
52
|
-
|
|
53
52
|
<!-- COMMUNITY HEADER: hide it when displaying the submission request -->
|
|
54
53
|
{% if not is_preview_submission_request %}
|
|
55
54
|
{% if community %}
|
|
@@ -114,11 +113,11 @@
|
|
|
114
113
|
<p>
|
|
115
114
|
{% if not is_draft %}
|
|
116
115
|
{{ _("You are previewing a published record.") }}
|
|
117
|
-
{% elif
|
|
116
|
+
{% elif record_ui["is_published"] %}
|
|
118
117
|
{{ _("You are previewing changes that have not yet been published.") }}
|
|
119
|
-
{% elif not
|
|
118
|
+
{% elif not record_ui["is_published"] and record_ui["versions"]["index"] == 1 %}
|
|
120
119
|
{{ _("You are previewing a new record that has not yet been published.") }}
|
|
121
|
-
{% elif not
|
|
120
|
+
{% elif not record_ui["is_published"] and record_ui["versions"]["index"] > 1 %}
|
|
122
121
|
{{ _("You are previewing a new record version that has not yet been published.") }}
|
|
123
122
|
{% endif %}
|
|
124
123
|
</p>
|
|
@@ -127,14 +126,14 @@
|
|
|
127
126
|
{% endif %}
|
|
128
127
|
<!-- /PREVIEW HEADER -->
|
|
129
128
|
|
|
130
|
-
{% if
|
|
129
|
+
{% if record_ui["is_published"] and record_ui["links"]["latest_html"] and not record_ui["versions"]["is_latest"] %}
|
|
131
130
|
<div class="ui warning flashed bottom attached manage message">
|
|
132
131
|
<div class="ui container">
|
|
133
132
|
<div class="ui relaxed grid">
|
|
134
133
|
<div class="column">
|
|
135
134
|
<div class="row">
|
|
136
135
|
<p>
|
|
137
|
-
{% trans link_start=('<a href="' +
|
|
136
|
+
{% trans link_start=('<a href="' + record_ui["links"]["latest_html"] + '"><b>')|safe, link_end='</b></a>'|safe %}
|
|
138
137
|
There is a {{ link_start }}newer version{{ link_end }} of the record
|
|
139
138
|
available.
|
|
140
139
|
{% endtrans %}
|
|
@@ -155,17 +154,17 @@
|
|
|
155
154
|
{# Main content #}
|
|
156
155
|
<article
|
|
157
156
|
class="sixteen wide tablet eleven wide computer column main-record-content">
|
|
158
|
-
{% if
|
|
157
|
+
{% if record_ui["access"]["record"] == 'restricted' %}
|
|
159
158
|
<section id="record-access-status"
|
|
160
|
-
class="ui {{
|
|
159
|
+
class="ui {{ record_ui["ui"]["access_status"]["message_class"] }} message rel-mt-1"
|
|
161
160
|
aria-label="{{ _('Record access information') }}"
|
|
162
161
|
>
|
|
163
|
-
<i class="{{
|
|
164
|
-
<strong>{{
|
|
165
|
-
{{
|
|
162
|
+
<i class="{{ record_ui["ui"]["access_status"]["icon"] }} icon" aria-hidden="true"></i>
|
|
163
|
+
<strong>{{ record_ui["ui"]["access_status"]["title_l10n"] }}</strong>
|
|
164
|
+
{{ record_ui["ui"]["access_status"]["description_l10n"] }}
|
|
166
165
|
|
|
167
|
-
{% if
|
|
168
|
-
<p>{{ _("Reason") }}: {{
|
|
166
|
+
{% if record_ui["access"]["embargo"]["reason"] %}
|
|
167
|
+
<p>{{ _("Reason") }}: {{ record_ui["access"]["embargo"]["reason"] }}</p>
|
|
169
168
|
{% endif %}
|
|
170
169
|
</section>
|
|
171
170
|
{% endif %}
|
|
@@ -179,7 +178,7 @@
|
|
|
179
178
|
{% if is_preview and not is_preview_submission_request and can_curate_record and is_draft %}
|
|
180
179
|
<nav class="back-navigation rel-pb-2 pl-0"
|
|
181
180
|
aria-label="{{ _('Back-navigation') }}">
|
|
182
|
-
{%- set back_page = url_for('invenio_app_rdm_records.deposit_edit', pid_value=
|
|
181
|
+
{%- set back_page = url_for('invenio_app_rdm_records.deposit_edit', pid_value=record_ui.id) -%}
|
|
183
182
|
{%- set back_btn_label = _('Back to edit') -%}
|
|
184
183
|
<a class="ui button labeled icon small compact"
|
|
185
184
|
href="{{ back_page }}">
|
|
@@ -204,7 +203,7 @@
|
|
|
204
203
|
<div id="recordManagementMobile"
|
|
205
204
|
role="dialog"
|
|
206
205
|
class="ui flowing popup transition hidden"
|
|
207
|
-
data-record='{{
|
|
206
|
+
data-record='{{ record_ui | tojson }}'
|
|
208
207
|
data-permissions='{{ permissions | tojson }}'
|
|
209
208
|
data-is-draft="{{ is_draft | tojson }}"
|
|
210
209
|
{% if config.RDM_DETAIL_SIDE_BAR_MANAGE_ATTRIBUTES_EXTENSION_TEMPLATE %}
|
|
@@ -221,35 +220,35 @@
|
|
|
221
220
|
<div class="two column row">
|
|
222
221
|
<div class="left floated left aligned column">
|
|
223
222
|
<span class="ui" title="{{ _('Publication date') }}">
|
|
224
|
-
{{ _('Published') }} {{
|
|
223
|
+
{{ _('Published') }} {{ record_ui["ui"]["publication_date_l10n_long"] }}
|
|
225
224
|
</span>
|
|
226
225
|
<span
|
|
227
|
-
class="label text-muted"> | {{ _('Version {version_number}').format(version_number=
|
|
226
|
+
class="label text-muted"> | {{ _('Version {version_number}').format(version_number=record_ui["ui"]["version"]) }}</span>
|
|
228
227
|
</div>
|
|
229
228
|
<div class="right floated right aligned column">
|
|
230
229
|
|
|
231
|
-
{% if
|
|
230
|
+
{% if record_ui["ui"]["resource_type"] %}
|
|
232
231
|
<span role="note"
|
|
233
232
|
class="ui label horizontal small neutral mb-5"
|
|
234
233
|
aria-label="{{ _('Resource type') }}"
|
|
235
234
|
>
|
|
236
|
-
{{
|
|
235
|
+
{{ record_ui["ui"]["resource_type"]["title_l10n"] }}
|
|
237
236
|
</span>
|
|
238
237
|
{% endif %}
|
|
239
238
|
|
|
240
239
|
<span role="note"
|
|
241
|
-
class="ui label horizontal small access-status {{
|
|
242
|
-
data-tooltip="{{
|
|
240
|
+
class="ui label horizontal small access-status {{ record_ui["ui"]["access_status"]["id"] }} mb-5"
|
|
241
|
+
data-tooltip="{{ record_ui["ui"]["access_status"]["description_l10n"] }}"
|
|
243
242
|
data-inverted=""
|
|
244
243
|
aria-label="{{ _('Access status') }}"
|
|
245
244
|
>
|
|
246
|
-
{% if
|
|
247
|
-
<i class="icon {{
|
|
245
|
+
{% if record_ui["ui"]["access_status"]["icon"] %}
|
|
246
|
+
<i class="icon {{ record_ui["ui"]["access_status"]["icon"] }}"
|
|
248
247
|
aria-hidden="true"></i>
|
|
249
248
|
{% endif %}
|
|
250
249
|
<span
|
|
251
|
-
aria-label="{{
|
|
252
|
-
{{
|
|
250
|
+
aria-label="{{ record_ui["ui"]["access_status"]["description_l10n"] }}">
|
|
251
|
+
{{ record_ui["ui"]["access_status"]["title_l10n"] }}
|
|
253
252
|
</span>
|
|
254
253
|
</span>
|
|
255
254
|
</div>
|
|
@@ -267,7 +266,7 @@
|
|
|
267
266
|
<h1 id="record-title"
|
|
268
267
|
class="wrap-overflowing-text">{{ metadata.title }}</h1>
|
|
269
268
|
|
|
270
|
-
{% if
|
|
269
|
+
{% if record_ui["ui"]["creators"] or record_ui["ui"]["contributors"] %}
|
|
271
270
|
<section id="creatibutors"
|
|
272
271
|
aria-label="{{ _('Creators and contributors') }}">
|
|
273
272
|
{%- include "invenio_app_rdm/records/details/creatibutors.html" %}
|
|
@@ -284,7 +283,7 @@
|
|
|
284
283
|
{# Files #}
|
|
285
284
|
{%- block record_files -%}
|
|
286
285
|
{# record has files BUT passed files are empty. This happens when we display are request. #}
|
|
287
|
-
{%- if
|
|
286
|
+
{%- if record_ui["files"]["enabled"] -%}
|
|
288
287
|
<section id="record-files" class="rel-mt-2 rel-mb-3"
|
|
289
288
|
aria-label="{{ _('Files') }}">
|
|
290
289
|
{%- if permissions.can_read_files -%}
|
|
@@ -293,18 +292,18 @@
|
|
|
293
292
|
{%- if files|length > 0 -%}
|
|
294
293
|
<h2 id="files-heading">{{ _('Files') }}</h2>
|
|
295
294
|
{%- if files|has_previewable_files -%}
|
|
296
|
-
{%-set preview_file = files|select_preview_file(default_preview=
|
|
297
|
-
{{ preview_file_box(preview_file,
|
|
295
|
+
{%-set preview_file = files|select_preview_file(default_preview=record_ui["files"]["default_preview"]) %}
|
|
296
|
+
{{ preview_file_box(preview_file, record_ui["id"], is_preview, record, include_deleted) }}
|
|
298
297
|
{%- endif -%}
|
|
299
|
-
{{ file_list_box(files,
|
|
298
|
+
{{ file_list_box(files, record_ui["id"], is_preview, include_deleted, record, permissions) }}
|
|
300
299
|
{% endif %}
|
|
301
300
|
{% else %}
|
|
302
301
|
{# record has files BUT user does not have permission to see files #}
|
|
303
302
|
<div
|
|
304
|
-
class="ui accordion panel mb-10 {{
|
|
303
|
+
class="ui accordion panel mb-10 {{ record_ui["ui"]["access_status"]["id"] }}"
|
|
305
304
|
href="#files-preview-accordion-panel">
|
|
306
305
|
<h3
|
|
307
|
-
class="active title panel-heading {{
|
|
306
|
+
class="active title panel-heading {{ record_ui["ui"]["access_status"]["id"] }} m-0">
|
|
308
307
|
<div role="button" id="files-preview-accordion-trigger"
|
|
309
308
|
tabindex="0" class="trigger"
|
|
310
309
|
aria-controls="files-preview-accordion-panel">
|
|
@@ -316,15 +315,15 @@
|
|
|
316
315
|
aria-labelledby="files-preview-accordion-trigger"
|
|
317
316
|
class="active content preview-container pt-0">
|
|
318
317
|
<div
|
|
319
|
-
class="ui {{
|
|
320
|
-
<i class="ui {{
|
|
318
|
+
class="ui {{ record_ui["ui"]["access_status"]["message_class"] }} message file-box-message rel-pl-1 rel-pr-1">
|
|
319
|
+
<i class="ui {{ record_ui["ui"]["access_status"]["icon"] }} icon"
|
|
321
320
|
aria-hidden="true"></i>
|
|
322
321
|
<h4
|
|
323
|
-
class="inline">{{
|
|
324
|
-
<p>{{
|
|
322
|
+
class="inline">{{ record_ui["ui"]["access_status"]["title_l10n"] }}</h4>
|
|
323
|
+
<p>{{ record_ui["ui"]["access_status"]["description_l10n"] }}</p>
|
|
325
324
|
|
|
326
|
-
{% if
|
|
327
|
-
<p>{{ _("Reason") }}: {{
|
|
325
|
+
{% if record_ui["access"]["embargo"]["reason"] %}
|
|
326
|
+
<p>{{ _("Reason") }}: {{ record_ui["access"]["embargo"]["reason"] }}</p>
|
|
328
327
|
{% endif %}
|
|
329
328
|
|
|
330
329
|
{% block record_files_access_request %}
|
|
@@ -334,8 +333,8 @@
|
|
|
334
333
|
<p>
|
|
335
334
|
{{ _("If you would like to request access to these files, please fill out the form below.") }}
|
|
336
335
|
</p>
|
|
337
|
-
{%- if
|
|
338
|
-
{%- set accept_conditions_text =
|
|
336
|
+
{%- if record_ui["parent"]["access"]["settings"] %}
|
|
337
|
+
{%- set accept_conditions_text = record_ui["parent"]["access"]["settings"]["accept_conditions_text"] %}
|
|
339
338
|
{%- endif %}
|
|
340
339
|
|
|
341
340
|
{%- if accept_conditions_text %}
|
|
@@ -368,7 +367,7 @@
|
|
|
368
367
|
<section id="record-media-files" aria-label="{{ _('System files') }}">
|
|
369
368
|
{%- set media_files = media_files | order_entries | selectattr("status", "==", "completed") | list %}
|
|
370
369
|
{%- if media_files|length > 0 -%}
|
|
371
|
-
{{ media_file_list_box(media_files,
|
|
370
|
+
{{ media_file_list_box(media_files, record_ui["id"], is_preview, include_deleted, record, permissions) }}
|
|
372
371
|
{%- endif %}
|
|
373
372
|
</section>
|
|
374
373
|
{%- endif %}
|
|
@@ -431,7 +430,7 @@
|
|
|
431
430
|
{% include config.THEME_JAVASCRIPT_TEMPLATE %}
|
|
432
431
|
{% endif %}
|
|
433
432
|
{%- block record_jsonld %}
|
|
434
|
-
{% set jsonld_serialization =
|
|
433
|
+
{% set jsonld_serialization = record_ui | transform_record('SchemaorgJSONLDSerializer', throws=False) %}
|
|
435
434
|
{%- if jsonld_serialization %}
|
|
436
435
|
<script type='application/ld+json'>{{ jsonld_serialization | tojson }}</script>
|
|
437
436
|
{%- endif %}
|
invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/access-form.html
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
{% endif %}
|
|
35
35
|
<div id="access-request-form-root"
|
|
36
|
-
data-record='{{
|
|
36
|
+
data-record='{{ record_ui | tojson }}'
|
|
37
37
|
data-user-anonymous='{{ current_user.is_anonymous | tojson }}'
|
|
38
38
|
data-user-full-name='{{ full_name | tojson }}'
|
|
39
39
|
data-user-email='{{ email | tojson }}'>
|
invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/citation.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
it under the terms of the MIT License; see LICENSE file for more details.
|
|
8
8
|
#}
|
|
9
9
|
|
|
10
|
-
<div id="recordCitation" data-record='{{
|
|
10
|
+
<div id="recordCitation" data-record='{{ record_ui | tojson }}'
|
|
11
11
|
data-styles='{{ config.get("RDM_CITATION_STYLES") | tojson }}'
|
|
12
12
|
data-defaultstyle='{{ config.get("RDM_CITATION_STYLES_DEFAULT") | tojson }}'
|
|
13
13
|
data-include-deleted='{{ include_deleted | tojson }}'>
|
invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/creatibutors.html
CHANGED
|
@@ -10,29 +10,29 @@
|
|
|
10
10
|
{%- from "invenio_app_rdm/records/macros/creatibutors.html" import affiliations_accordion, show_creatibutors %}
|
|
11
11
|
|
|
12
12
|
<div class="ui grid">
|
|
13
|
-
{% if
|
|
13
|
+
{% if record_ui["ui"]["creators"] and record_ui["ui"]["creators"]["creators"] %}
|
|
14
14
|
<div class="row ui accordion affiliations">
|
|
15
15
|
<div class="sixteen wide mobile twelve wide tablet thirteen wide computer column">
|
|
16
16
|
<h3 class="sr-only">{{ _('Creators') }}</h3>
|
|
17
17
|
<ul class="creatibutors">
|
|
18
|
-
{{ show_creatibutors(
|
|
18
|
+
{{ show_creatibutors(record_ui["ui"]["creators"]["creators"], show_affiliations=True, show_role=True) }}
|
|
19
19
|
</ul>
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
{# Todo: get full list of all affiliations (both creators & contributors) e.g.
|
|
23
|
-
|
|
24
|
-
{% if
|
|
25
|
-
{{ affiliations_accordion('creators',
|
|
23
|
+
record_ui["ui"]["affiliation"] and merge to one accordion #}
|
|
24
|
+
{% if record_ui["ui"]["creators"] and record_ui["ui"]["creators"]["affiliations"] %}
|
|
25
|
+
{{ affiliations_accordion('creators', record_ui["ui"]["creators"]["affiliations"])}}
|
|
26
26
|
{% endif %}
|
|
27
27
|
|
|
28
28
|
</div>
|
|
29
29
|
{% endif %}
|
|
30
30
|
|
|
31
|
-
{% if
|
|
31
|
+
{% if record_ui["ui"]["contributors"] and record_ui["ui"]["contributors"]["contributors"] %}
|
|
32
32
|
<div class="row ui accordion affiliations">
|
|
33
33
|
<div class="sixteen wide mobile twelve wide tablet thirteen wide computer column">
|
|
34
34
|
<h3>{{ _('Contributors') }}</h3>
|
|
35
|
-
{%- for group in
|
|
35
|
+
{%- for group in record_ui["ui"]["contributors"]["contributors"]|groupby('role.title')%}
|
|
36
36
|
<div>
|
|
37
37
|
<h3 class="creatibutors-header ui small header">{{group.grouper}}{%- if group.list|length > 1 -%}s{%- endif -%}:</h3>
|
|
38
38
|
<ul class="creatibutors">
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
{%- endfor %}
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
|
-
{% if
|
|
46
|
-
{{ affiliations_accordion('contributors',
|
|
45
|
+
{% if record_ui["ui"]["contributors"] and record_ui["ui"]["contributors"]["affiliations"] %}
|
|
46
|
+
{{ affiliations_accordion('contributors', record_ui["ui"]["contributors"]["affiliations"])}}
|
|
47
47
|
{% endif %}
|
|
48
48
|
|
|
49
49
|
</div>
|