Skip to content

Commit b4d97f8

Browse files
committed
templates: separate record detail content
1 parent af193c7 commit b4d97f8

File tree

2 files changed

+285
-270
lines changed

2 files changed

+285
-270
lines changed

invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html

Lines changed: 1 addition & 270 deletions
Original file line numberDiff line numberDiff line change
@@ -147,277 +147,8 @@
147147
</section>
148148

149149

150-
<div class="ui container">
151-
<div class="ui relaxed grid mt-5">
152-
<div class="two column row top-padded">
150+
{% include "invenio_app_rdm/records/record_content.html" %}
153151

154-
{# Main content #}
155-
<article
156-
class="sixteen wide tablet eleven wide computer column main-record-content">
157-
{% if record.access.record == 'restricted' %}
158-
<section id="record-access-status"
159-
class="ui {{ record.ui.access_status.message_class }} message rel-mt-1"
160-
aria-label="{{ _('Record access information') }}"
161-
>
162-
<i class="{{ record.ui.access_status.icon }} icon" aria-hidden="true"></i>
163-
<strong>{{ record.ui.access_status.title_l10n }}</strong>
164-
{{ record.ui.access_status.description_l10n }}
165-
166-
{% if record.access.embargo.reason %}
167-
<p>{{ _("Reason") }}: {{ record.access.embargo.reason }}</p>
168-
{% endif %}
169-
</section>
170-
{% endif %}
171-
172-
{%- block record_body -%}
173-
174-
{%- block record_header -%}
175-
176-
{%- block record_header_button -%}
177-
178-
{% if is_preview and not is_preview_submission_request and can_manage_record and is_draft %}
179-
<nav class="back-navigation rel-pb-2 pl-0"
180-
aria-label="{{ _('Back-navigation') }}">
181-
{%- set back_page = url_for('invenio_app_rdm_records.deposit_edit', pid_value=record.id) -%}
182-
{%- set back_btn_label = _('Back to edit') -%}
183-
<a class="ui button labeled icon small compact"
184-
href="{{ back_page }}">
185-
<i class="ui icon angle left"></i> {{ back_btn_label }}</a>
186-
</nav>
187-
{% endif %}
188-
189-
{% endblock record_header_button %}
190-
191-
{% if show_record_management_menu %}
192-
<section id="mobile-record-management"
193-
class="ui grid tablet only mobile only">
194-
<div class="sixteen wide column right aligned">
195-
<button id="manage-record-btn"
196-
class="ui small basic icon button m-0"
197-
aria-haspopup="dialog"
198-
aria-expanded="false"
199-
>
200-
<i class="cog icon"></i> {{ _('Manage record') }}
201-
</button>
202-
</div>
203-
204-
<div id="recordManagementMobile"
205-
role="dialog"
206-
class="ui flowing popup transition hidden"
207-
data-record='{{ record | tojson }}'
208-
data-permissions='{{ permissions | tojson }}'
209-
data-is-draft="{{ is_draft | tojson }}"
210-
>
211-
</div>
212-
</section>
213-
{% endif %}
214-
215-
<section id="record-info"
216-
aria-label="{{ _('Publication date and version number') }}">
217-
<div class="ui grid middle aligned">
218-
<div class="two column row">
219-
<div class="left floated left aligned column">
220-
<span class="ui" title="{{ _('Publication date') }}">
221-
{{ _('Published') }} {{ record.ui.publication_date_l10n_long }}
222-
</span>
223-
<span
224-
class="label text-muted"> | {{ _('Version {version_number}').format(version_number=record.ui.version) }}</span>
225-
</div>
226-
<div class="right floated right aligned column">
227-
228-
{% if record.ui.resource_type %}
229-
<span role="note"
230-
class="ui label horizontal small neutral mb-5"
231-
aria-label="{{ _('Resource type') }}"
232-
>
233-
{{ record.ui.resource_type.title_l10n }}
234-
</span>
235-
{% endif %}
236-
237-
<span role="note"
238-
class="ui label horizontal small access-status {{ record.ui.access_status.id }} mb-5"
239-
data-tooltip="{{ record.ui.access_status.description_l10n }}"
240-
data-inverted=""
241-
aria-label="{{ _('Access status') }}"
242-
>
243-
{% if record.ui.access_status.icon %}
244-
<i class="icon {{ record.ui.access_status.icon }}"
245-
aria-hidden="true"></i>
246-
{% endif %}
247-
<span
248-
aria-label="{{ record.ui.access_status.description_l10n }}">
249-
{{ record.ui.access_status.title_l10n }}
250-
</span>
251-
</span>
252-
</div>
253-
</div>
254-
</div>
255-
</section>
256-
<div class="ui divider hidden"></div>
257-
258-
{%- endblock record_header -%}
259-
260-
{# Title #}
261-
{%- block record_title -%}
262-
<section id="record-title-section"
263-
aria-label="{{ _('Record title and creators') }}">
264-
<h1 id="record-title"
265-
class="wrap-overflowing-text">{{ metadata.title }}</h1>
266-
267-
{% if record.ui.creators or record.ui.contributors %}
268-
<section id="creatibutors"
269-
aria-label="{{ _('Creators and contributors') }}">
270-
{%- include "invenio_app_rdm/records/details/creatibutors.html" %}
271-
</section>
272-
{% endif %}
273-
</section>
274-
{%- endblock record_title -%}
275-
276-
{# Description #}
277-
{%- block record_content -%}
278-
{%- include "invenio_app_rdm/records/details/description.html" %}
279-
{%- endblock record_content -%}
280-
281-
{# Files #}
282-
{%- block record_files -%}
283-
{# record has files BUT passed files are empty. This happens when we display are request. #}
284-
{%- if record.files.enabled -%}
285-
<section id="record-files" class="rel-mt-2 rel-mb-3"
286-
aria-label="{{ _('Files') }}">
287-
{%- if permissions.can_read_files -%}
288-
{# record has files AND user can see files #}
289-
{%- set files = files | order_entries | selectattr("status", "==", "completed") | list %}
290-
{%- if files|length > 0 -%}
291-
<h2 id="files-heading">{{ _('Files') }}</h2>
292-
{%- if files|has_previewable_files -%}
293-
{%-set preview_file = files|select_preview_file(default_preview=record.files.default_preview) %}
294-
{{ preview_file_box(preview_file, record.id, is_preview, record, include_deleted) }}
295-
{%- endif -%}
296-
{{ file_list_box(files, record.id, is_preview, include_deleted, record, permissions) }}
297-
{% endif %}
298-
{% else %}
299-
{# record has files BUT user does not have permission to see files #}
300-
<div
301-
class="ui accordion panel mb-10 {{ record.ui.access_status.id }}"
302-
href="#files-preview-accordion-panel">
303-
<h3
304-
class="active title panel-heading {{ record.ui.access_status.id }} m-0">
305-
<div role="button" id="files-preview-accordion-trigger"
306-
tabindex="0" class="trigger"
307-
aria-controls="files-preview-accordion-panel">
308-
{{ _("Files") }}
309-
<i class="angle right icon" aria-hidden="true"></i>
310-
</div>
311-
</h3>
312-
<div role="region" id="files-preview-accordion-panel"
313-
aria-labelledby="files-preview-accordion-trigger"
314-
class="active content preview-container pt-0">
315-
<div
316-
class="ui {{ record.ui.access_status.message_class }} message file-box-message rel-pl-1 rel-pr-1">
317-
<i class="ui {{ record.ui.access_status.icon }} icon"
318-
aria-hidden="true"></i>
319-
<h4
320-
class="inline">{{ record.ui.access_status.title_l10n }}</h4>
321-
<p>{{ record.ui.access_status.description_l10n }}</p>
322-
323-
{% if record.access.embargo.reason %}
324-
<p>{{ _("Reason") }}: {{ record.access.embargo.reason }}</p>
325-
{% endif %}
326-
327-
{% block record_files_access_request %}
328-
{%- if allow_user_requests or allow_guest_requests %}
329-
<div class="ui divider"></div>
330-
<h4>{{ _("Request access") }}</h4>
331-
<p>
332-
{{ _("If you would like to request access to these files, please fill out the form below.") }}
333-
</p>
334-
{%- if record.parent.access.settings %}
335-
{%- set accept_conditions_text = record.parent.access.settings.accept_conditions_text %}
336-
{%- endif %}
337-
338-
{%- if accept_conditions_text %}
339-
<p class="ui small header rel-mt-2 rel-mb-1">
340-
{{ _("You need to satisfy these conditions in order for this request to be accepted:") }}
341-
</p>
342-
<div class="rel-mt-2 rich-input-content">
343-
{{ accept_conditions_text | safe }}
344-
</div>
345-
{%- endif %}
346-
347-
{%- include "invenio_app_rdm/records/details/access-form.html" %}
348-
{%- endif %}
349-
{% endblock record_files_access_request %}
350-
</div>
351-
</div>
352-
</div>
353-
{%- endif %}
354-
</section>
355-
{%- endif %}
356-
{%- endblock record_files -%}
357-
358-
{# Media files #}
359-
{%- block record_media_files -%}
360-
{# record has media files AND user can see files #}
361-
{# can_media_read_files is false when record is fully restricted and users can't see the landing page at all #}
362-
{%- if media_files and media_files.enabled and media_files.entries and permissions.can_media_read_files -%}
363-
{%- set any_visible = media_files.entries | selectattr('access.hidden', 'equalto', false) | list | length > 0 %}
364-
{%- if any_visible %}
365-
<section id="record-media-files" aria-label="{{ _('System files') }}">
366-
{%- set media_files = media_files | order_entries | selectattr("status", "==", "completed") | list %}
367-
{%- if media_files|length > 0 -%}
368-
{{ media_file_list_box(media_files, record.id, is_preview, include_deleted, record, permissions) }}
369-
{%- endif %}
370-
</section>
371-
{%- endif %}
372-
{%- endif %}
373-
{%- endblock record_media_files -%}
374-
375-
{# Additional details #}
376-
{%- block record_details -%}
377-
<section id="additional-details" class="rel-mt-2"
378-
aria-label="{{ _('Additional record details') }}">
379-
{%- include "invenio_app_rdm/records/details/details.html" %}
380-
</section>
381-
{%- endblock record_details -%}
382-
383-
{# Record footer #}
384-
{%- block record_footer -%}
385-
{%- endblock record_footer -%}
386-
387-
{%- endblock record_body %}
388-
</article>
389-
390-
{# Sidebar #}
391-
<aside class="sixteen wide tablet five wide computer column sidebar"
392-
aria-label="{{ _('Record details') }}">
393-
{% block record_sidebar %}
394-
{%- include "invenio_app_rdm/records/details/side_bar.html" %}
395-
{% endblock record_sidebar %}
396-
</aside>
397-
</div>
398-
</div>
399-
400-
<div class="ui container">
401-
<div class="ui relaxed grid">
402-
<div class="two column row">
403-
<div class="sixteen wide tablet eleven wide computer column">
404-
{# Jump up button #}
405-
{%- block jump -%}
406-
<div class="ui grid">
407-
<div class="centered row rel-mt-1">
408-
<button id="jump-btn" class="jump-to-top ui button labeled icon"
409-
aria-label="{{ _('Jump to top of page') }}">
410-
<i class="arrow alternate circle up outline icon"></i>
411-
{{ _("Jump up") }}
412-
</button>
413-
</div>
414-
</div>
415-
{%- endblock jump -%}
416-
</div>
417-
</div>
418-
</div>
419-
</div>
420-
</div>
421152

422153
{%- endblock page_body %}
423154

0 commit comments

Comments
 (0)