diff --git a/rero_ils/config.py b/rero_ils/config.py
index 35a8eb4faf..f280a33204 100644
--- a/rero_ils/config.py
+++ b/rero_ils/config.py
@@ -549,7 +549,8 @@ def _(x):
'https://www.google-analytics.com',
'https://services.test.rero.ch',
'https://services.rero.ch',
- 'https://cdn.jsdelivr.net'
+ 'https://cdn.jsdelivr.net',
+ 'https://www.babelio.com'
]
},
'content_security_policy_report_uri': None,
@@ -3984,3 +3985,9 @@ def search_type(field):
}
},
]
+
+# Babeltheque Configuration
+# ========================
+RERO_ILS_APP_BABELTHEQUE_CONFIG = {
+ 'enabled_views': ['global', 'vs']
+}
diff --git a/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html b/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html
index dad7691285..7636ae01f5 100644
--- a/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html
+++ b/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html
@@ -1,7 +1,7 @@
{# -*- coding: utf-8 -*-
RERO ILS
- Copyright (C) 2019-2023 RERO
+ Copyright (C) 2019-2024 RERO
Copyright (C) 2019-2023 UCLouvain
This program is free software: you can redistribute it and/or modify
@@ -20,6 +20,8 @@
{%- extends 'rero_ils/page.html' %}
{% from 'rero_ils/macros/macro.html' import div, dict_values, div_list, dl, dl_row, dl_dict, dl_list, div_json %}
+{% set isbn = record|get_first_isbn %}
+
{%- block css %}
{{ super() }}
{{ node_assets('@rero/rero-ils-ui/dist/public-holdings-items', ['styles.*css'], 'css') }}
@@ -277,6 +279,15 @@
{% endif %}
+ {% if viewcode | babeltheque_enabled_view and isbn is not undefined %}
+
+
+
+
ETIQUETTES
+
SUGGESTIONS
+
CITATIONS
+
+ {% endif %}
{%- block record_body %}
@@ -293,6 +304,15 @@
{{ _('Description') }}
+ {% if viewcode | babeltheque_enabled_view %}
+
+
+ {{ _('More infos') }}
+
+
+ {% endif %}
@@ -322,6 +342,15 @@
{{ _('Description') }}
+ {% if viewcode | babeltheque_enabled_view %}
+
+
+ {{ _('More infos') }}
+
+
+ {% endif %}
@@ -344,6 +373,17 @@
{% include('rero_ils/_documents_description.html') %}
+ {% if viewcode | babeltheque_enabled_view %}
+
+
+
LITT
+
CRIT
+
AUTEUR
+
VIDEO
+
PODCAST
+
+
+ {% endif %}
{% endif %}
@@ -372,4 +412,7 @@ {{ _('Export Formats') }}:
{%- block javascript %}
{{ super() }}
{{ node_assets('@rero/rero-ils-ui/dist/public-holdings-items', tags='defer') }}
+{% if viewcode | babeltheque_enabled_view %}
+
+{% endif %}
{% endblock javascript %}
diff --git a/rero_ils/modules/documents/views.py b/rero_ils/modules/documents/views.py
index 2ae9d4ae6f..5139809676 100644
--- a/rero_ils/modules/documents/views.py
+++ b/rero_ils/modules/documents/views.py
@@ -28,6 +28,7 @@
from flask_babel import gettext as _
from flask_login import current_user
from invenio_records_ui.signals import record_viewed
+from jinja2 import Undefined
from rero_ils.modules.collections.api import CollectionsSearch
from rero_ils.modules.entities.api import Entity
@@ -117,6 +118,23 @@ def doc_item_view_method(pid, record, template=None, **kwargs):
static_folder='static',
)
+@blueprint.app_template_filter()
+def babeltheque_enabled_view(view):
+ """Check if the view is activated for babeltheque."""
+ enabled_views = current_app.config.get(
+ 'RERO_ILS_APP_BABELTHEQUE_CONFIG', {}).get('enabled_views', [])
+ return view in enabled_views
+
+@blueprint.app_template_filter()
+def get_first_isbn(record):
+ """Get first isbn result."""
+ # ISBN
+ isbns = [
+ identified_by.get('value')
+ for identified_by in record.get('identifiedBy', [])
+ if identified_by.get('type') == 'bf:Isbn'
+ ]
+ return isbns[0] if isbns else Undefined
@blueprint.app_template_filter()
def note_general(notes):