diff --git a/templates/semantic-ui/invenio_app_rdm/records/detail.html b/templates/semantic-ui/invenio_app_rdm/records/detail.html new file mode 100644 index 0000000..6f43833 --- /dev/null +++ b/templates/semantic-ui/invenio_app_rdm/records/detail.html @@ -0,0 +1,412 @@ +{# + Copyright (C) 2023 CERN. + + Invenio RDM Records is free software; you can redistribute it and/or modify + it under the terms of the MIT License; see LICENSE file for more details. + #} + + {% if use_theme_basic_template|default(true) %} + {%- extends config.BASE_TEMPLATE %} + {% endif %} + + {%- from "invenio_app_rdm/records/macros/files.html" import file_list_box, preview_file_box %} + + {%- set title = record.metadata.title %} + {%- set metadata = record.metadata %} + + {%- set can_manage_record = permissions is defined and (permissions.can_edit or permissions.can_review) %} + + + {%- set is_preview_submission_request = preview_submission_request or false %} + {%- set show_record_management_menu = can_manage_record and (not is_preview or is_preview_submission_request) %} + + {%- if record.parent.access.settings %} + {%- set allow_user_requests = not current_user.is_anonymous and record.parent.access.settings.allow_user_requests %} + {%- set allow_guest_requests = current_user.is_anonymous and record.parent.access.settings.allow_guest_requests %} + {%- endif %} + + {%- block page_body %} +
+ + + {% if not is_preview_submission_request %} + {% if community %} + {% set is_community_restricted = community.access.visibility == 'restricted' %} +
+
+
+ +
+
+ {{ community.metadata.title }} + {% if is_community_restricted %} + + {{ _("Restricted") }} + + {% endif %} +
+
+
+ {% endif %} + {% endif %} + + + + {% if is_preview %} +
+
+
+ + {{ _ ("Preview") }} +
+

+ {% if not is_draft %} + {{ _("You are previewing a published record.") }} + {% elif record.is_published %} + {{ _("You are previewing changes that have not yet been published.") }} + {% elif not record.is_published and record.versions.index == 1 %} + {{ _("You are previewing a new record that has not yet been published.") }} + {% elif not record.is_published and record.versions.index > 1 %} + {{ _("You are previewing a new record version that has not yet been published.") }} + {% endif %} +

+
+
+ {% endif %} + + + {% if record.is_published and not record.versions.is_latest %} +
+
+
+
+
+

+ {% trans link_start=('')|safe, link_end=''|safe %} + There is a {{ link_start }}newer version{{ link_end }} of the record available. + {% endtrans %} +

+
+
+
+
+
+ {% endif %} +
+ + +
+
+
+ + {# Main content #} +
+ {% if record.access.record == 'restricted' %} +
+ + {{ record.ui.access_status.title_l10n }} + {{ record.ui.access_status.description_l10n }} + + {% if record.access.embargo.reason %} +

{{ _("Reason") }}: {{ record.access.embargo.reason }}

+ {% endif %} +
+ {% endif %} + + {%- block record_body -%} + + {%- block record_header -%} + + {%- block record_header_button -%} + + {% if is_preview and not is_preview_submission_request and can_manage_record and is_draft %} + + {% endif %} + + {% endblock record_header_button %} + + {% if show_record_management_menu %} +
+
+ +
+ + +
+ {% endif %} + +
+
+
+
+ + {{ _('Published') }} {{ record.ui.publication_date_l10n_long }} + + | {{ _('Version {version_number}').format(version_number=record.ui.version) }} +
+
+ {% if record.ui.resource_type %} + {{ record.ui.resource_type.title_l10n }} + {% endif %} + + {% if record.ui.access_status.icon %} + + {% endif %} + {{ record.ui.access_status.title_l10n }} + +
+
+
+
+ + + {%- endblock record_header -%} + + {# Title #} + {%- block record_title -%} +
+

{{ metadata.title }}

+ + {% if record.ui.creators or record.ui.contributors %} +
+ {%- include "invenio_app_rdm/records/details/creatibutors.html" %} +
+ {% endif %} +
+ {%- endblock record_title -%} + + {# Citation & Description #} + {%- block record_content -%} +
+ {%- include "invenio_app_rdm/records/details/citation.html" %} +
+ + {%- include "invenio_app_rdm/records/details/description.html" %} + {%- endblock record_content -%} + + {# Files #} + {%- block record_files -%} + {# record has files BUT passed files are empty. This happens when we display are request. #} + {%- if record.files.enabled -%} +
+

{{ _('Files') }}

+ {%- if permissions.can_read_files -%} + {# record has files AND user can see files #} + {%- set files = files|order_entries %} + + {%- if files|has_previewable_files -%} + {%-set preview_file = files|select_preview_file(default_preview=record.files.default_preview) %} + {{ preview_file_box(preview_file, record.id, is_preview, record) }} + {%- endif -%} + {{ file_list_box(files, record.id, is_preview, record) }} + {% else %} + {# record has files BUT user cannot see files #} +
+
+
+ {{ _("Files") }} + +
+
+
+ {{ record.ui.access_status.title_l10n }} +

{{ record.ui.access_status.description_l10n }}

+ + {% if record.access.embargo.reason %} +

{{ _("Reason") }}: {{ record.access.embargo.reason }}

+ {% endif %} + + {%- if allow_user_requests or allow_guest_requests %} +
+

+

+ {{ _("Request access") }} +

+

+ {{ _("If you would like to request access to these files, please fill out the form below.") }} +

+
+ {%- if record.parent.access.settings %}{%- set accept_conditions_text = record.parent.access.settings.accept_conditions_text %}{%- endif %} + {%- if accept_conditions_text %} +

+

{{ _("You need to satisfy these conditions in order for this request to be accepted:") }}
+ {{ accept_conditions_text | safe }} +

+ {%- endif %} +
+ {%- include "invenio_app_rdm/records/details/access-form.html" %} +

+ {%- endif %} + +
+
+
+
+ {%- endif %} +
+
+ {%- endif %} + {%- endblock record_files -%} + + {# Files #} + {%- block record_media_files -%} + {# record has files BUT passed files are empty. This happens when we display are request. #} + {%- if record.media_files.enabled -%} +
+

{{ _('Media files') }}

+ {%- if permissions.can_view -%} + {# record has files AND user can see files #} + {%- set media_files = media_files|order_entries %} + + {# {%- if media_files|has_previewable_files -%}#} + {# {%-set preview_file = media_files|select_preview_file(default_preview=record.media_files.default_preview) %}#} + {# {{ preview_file_box(preview_file, record.id, is_preview, record) }}#} + {# {%- endif -%}#} + {{ file_list_box(media_files, record.id, is_preview, record) }} + {% else %} + {# record has media_files BUT user cannot see media_files #} +
+
+
+ {{ _("Media files") }} + +
+
+
+ {{ record.ui.access_status.title_l10n }} +

{{ record.ui.access_status.description_l10n }}

+ + {% if record.access.embargo.reason %} +

{{ _("Reason") }}: {{ record.access.embargo.reason }}

+ {% endif %} + +
+
+
+
+ {%- endif %} +
+
+ {%- endif %} + {%- endblock record_media_files -%} + + {# Additional details #} + {%- block record_details -%} +
+ {%- include "invenio_app_rdm/records/details/details.html" %} +
+ {%- endblock record_details -%} + + {# Record footer #} + {%- block record_footer -%} + {%- endblock record_footer -%} + + {%- endblock record_body %} +
+ + {# Sidebar #} + +
+
+ +
+
+
+ + {# Upload info #} +
+
+
+
{{ _("Created") }}:
+
+ {{ record.ui.created_date_l10n_long }} +
+
+
+
{{ _("Modified") }}:
+
+ {{ record.ui.updated_date_l10n_long }} +
+
+
+
+
+
+ +
+
+ {# Jump up button #} + {%- block jump -%} + + {%- endblock jump -%} +
+
+
+ +
+ + {%- endblock page_body %} + + {%- block javascript %} + {% if use_theme_basic_template|default(true) %} + {{ super() }} + {% else %} + {% include config.THEME_JAVASCRIPT_TEMPLATE %} + {% endif %} + {{ webpack['invenio-app-rdm-landing-page-theme.js'] }} + {{ webpack['invenio-app-rdm-landing-page.js'] }} + {{ webpack['previewer_theme.js'] }} + {%- endblock javascript %} + \ No newline at end of file