Skip to content

Commit

Permalink
in progress
Browse files Browse the repository at this point in the history
Signed-off-by: Johnny Mariéthoz <[email protected]>
  • Loading branch information
jma committed Nov 28, 2024
1 parent c9f901d commit 1255584
Show file tree
Hide file tree
Showing 19 changed files with 329 additions and 424 deletions.
10 changes: 6 additions & 4 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,13 +999,15 @@ def _(x):
record_serializers={
"application/json": "rero_ils.modules.serializers:json_v1_response"
},
record_serializers_aliases={
"json": "application/json",
},
record_serializers_aliases={"json": "application/json"},
search_serializers={
"application/json": "rero_ils.modules.serializers:json_v1_search",
"application/rero+json": "rero_ils.modules.holdings.serializers:json_holdings_search",
},
search_serializers_aliases={
"json": "application/json",
"rero+json": "application/json",
},
list_route="/holdings/",
record_loaders={
"application/json": lambda: Holding(request.get_json()),
Expand Down Expand Up @@ -4382,7 +4384,7 @@ def search_type(field):

# Babeltheque Configuration
# =========================
RERO_ILS_APP_BABELTHEQUE_ENABLED_VIEWS = []
RERO_ILS_APP_BABELTHEQUE_ENABLED_VIEWS = ["highlands"]

FILES_REST_STORAGE_CLASS_LIST = {"L": "Local"}

Expand Down
6 changes: 5 additions & 1 deletion rero_ils/jsonschemas/common/countries-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@
"widget": {
"formlyConfig": {
"props": {
"placeholder": "Select an option…",
"sort": true,
"sortOrder": "asc",
"filter": true,
"itemCssClass": "col-lg-4",
"options": [
{
Expand Down Expand Up @@ -1887,4 +1891,4 @@
}
}
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -296,112 +296,34 @@ <h3>
{%- block record_body %}
<section>
<article class="mt-4">
{% if not(holdings_count > 0 or es_record.files) %}
<header>
<nav>
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" href="#documents-description" data-toggle="tab"
id="documents-description-tab" title="{{ _('Description') }}" role="tab"
aria-controls="documents-description" aria-selected="false">
<i class="fa fa-bars"></i> {{ _('Description') }}
</a>
</li>
{% if viewcode | babeltheque_enabled_view and isbn is not none %}
<li class="nav-item">
<a class="nav-link" href="#documents-more-infos" data-toggle="tab"
id="documents-more-infos-tab" title="{{ _('More info') }}" role="tab"
aria-controls="documents-description" aria-selected="false">
<i class="fa fa-bars"></i> {{ _('More info') }}
</a>
</li>
{% endif %}
</ul>
</nav>
</header>
<article class="tab-content">
<section class="tab-pane p-4" id="documents-get" role="tabpanel" aria-labelledby="documents-get-tab"></section>
<section class="tab-pane container show active" id="documents-description" role="tabpanel" aria-labelledby="documents-description-tab">
{% include('rero_ils/_documents_description.html') %}
</section>
</article>
{% else %}
<header>
<nav>
<ul class="nav nav-tabs" role="tablist">
{% if holdings_count > 0 or es_record.files%}
<li class="nav-item">
<a class="nav-link active" href="#documents-get" data-toggle="tab"
id="documents-get-tab" title="{{ _('Get') }}" role="tab"
aria-controls="documents-get" aria-selected="true">
<i class="fa fa-list-ul"></i> {{ _('Get') }}
</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="#documents-description" data-toggle="tab"
id="documents-description-tab" title="{{ _('Description') }}" role="tab"
aria-controls="documents-description" aria-selected="false">
<i class="fa fa-bars"></i> {{ _('Description') }}
</a>
</li>
{% if viewcode | babeltheque_enabled_view and isbn is not none %}
<li class="nav-item">
<a class="nav-link" href="#documents-more-infos" data-toggle="tab"
id="documents-more-infos-tab" title="{{ _('More info') }}" role="tab"
aria-controls="documents-more-infos" aria-selected="false">
<i class="fa fa-bars"></i> {{ _('More info') }}
</a>
</li>
{% endif %}
</ul>
</nav>
</header>
<article class="tab-content">
{% if holdings_count > 0 or es_record.files %}
<section class="tab-pane show active p-1" id="documents-get" role="tabpanel" aria-labelledby="documents-get-tab">
{% if holdings_count > 0 %}
{% include('rero_ils/_anonymous_button.html') %}
{% endif %}
{% if record.harvested and record|n_electronic_holdings %}
{% include('rero_ils/_document_online.html') %}
{% else %}
<public-search-holdings
documentpid="{{ record.pid }}"
viewcode="{{ viewcode }}"
></public-search-holdings>
{% endif %}
<!-- ILL REQUEST ON GLOBAL VIEW-->
{% if holdings_count > 0 %}
{% include('rero_ils/_ill_request_button.html') %}
{% endif %}
</section>
{% endif %}
<section class="tab-pane container" id="documents-description" role="tabpanel" aria-labelledby="documents-description-tab">
{% include('rero_ils/_documents_description.html') %}
</section>
{% if viewcode | babeltheque_enabled_view %}
<section class="tab-pane container" id="documents-more-infos" role="tabpanel" aria-labelledby="documents-more-infos-tab">
<!-- BABELTHEQUE -->
<aside class="mt-3">Babelio</aside>
<div class="babelio-block">
<div>
<div id="BW_critiques"></div>
<div id="BW_notes">{{ _('No additionnal information yet.') }}</div>
<div class="rero-ils-ui">
<public-search-document
documentpid="{{ record.pid }}"
showinfo="viewcode | babeltheque_enabled_view and isbn is not none"
viewcode="{{ viewcode }}"
>
{% if viewcode | babeltheque_enabled_view and isbn is not none %}
<more-info>
<!-- BABELTHEQUE -->
<aside class="mt-3">Babelio</aside>
<div class="babelio-block">
<div>
<div id="BW_critiques"></div>
<div id="BW_notes">{{ _('No additionnal information yet.') }}</div>
</div>
<div id="BW_citations"></div>
< div id="BW_critiques_pro"></div>
<div id="BW_prix_litt"></div>
</div>
<div id="BW_citations"></div>
<div id="BW_critiques_pro"></div>
<div id="BW_prix_litt"></div>
</div>
<div id="BW_bio_auteur"></div>
<div class="babelio-block mt-3">
<div id="BW_videos"></div>
<div id="BW_podcasts"></div>
</div>
</section>
{% endif %}
</article>
{% endif %}
<div id="BW_bio_auteur"></div>
<div class="babelio-block mt-3">
<div id="BW_videos"></div>
<div id="BW_podcasts"></div>
</div>
</more-info>
{% endif %}
</public-search-document>
</div>
</article>
</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,4 @@ <h5 class="modal-title">{{ _('Document is available') }}</h5>
</div>
</div>
</div>

{%- endblock body %}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@
#}
{% extends 'rero_ils/page.html' %}

{%- block css %}
{{ super() }}
{{ node_assets('@rero/rero-ils-ui/dist/public-patron-profile', ['styles.*css'], 'css') }}
{%- endblock css %}

{%- block body %}
<public-patron-profile language="{{ current_i18n.locale.language[:2] }}" viewcode="{{ viewcode }}"></public-patron-profile>
<public-patron-profile language="{{ current_i18n.locale.language[:2] }}" viewcode="{{ viewcode }}" class="rero-ils-ui"/>
{%- endblock body %}

{%- block javascript %}
Expand Down
4 changes: 2 additions & 2 deletions rero_ils/modules/patrons/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ def get_messages(patron_pid):
for note in patron.get("notes", []):
if note.get("type") == "public_note":
messages.append({"type": "warning", "content": note.get("content")})
bootstrap_alert_mapping = {"error": "danger"}
prime_alert_mapping = {"warning": "warn"}
for message in messages:
msg_type = message["type"]
message["type"] = bootstrap_alert_mapping.get(msg_type, msg_type)
message["type"] = prime_alert_mapping.get(msg_type, msg_type)
return jsonify(messages)


Expand Down
14 changes: 8 additions & 6 deletions rero_ils/modules/users/jsonschemas/users/user-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"gender": {
"title": "Gender",
"type": "string",
"enum": [
"male",
"female",
Expand All @@ -86,15 +87,16 @@
"widget": {
"formlyConfig": {
"props": {
"placeholder": "Select an option…",
"options": [
{
"label": "male",
"value": "male"
},
{
"label": "female",
"value": "female"
},
{
"label": "male",
"value": "male"
},
{
"label": "other",
"value": "other"
Expand Down Expand Up @@ -162,7 +164,7 @@
"widget": {
"formlyConfig": {
"props": {
"itemCssClass": "col-lg-12"
"itemCssClass": "col-12"
}
}
}
Expand Down Expand Up @@ -294,4 +296,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

{%- block body %}
<h1 class="mt-2">{{ _('Change password') }}</h1>
<public-user-password-change referer="{{ request.referrer }}"></public-user-password-change>
<public-user-password-change referer="{{ request.referrer }}" class="rero-ils-ui" />
{%- endblock body %}

{%- block javascript %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

{%- block body %}
<h1 class="mt-2">{{ _('Profile') }}</h1>
<public-user-profile-edit referer="{{ request.referrer }}"></public-user-profile-edit>
<public-user-profile-edit referer="{{ request.referrer }}" class="rero-ils-ui"/>
{%- endblock body %}

{%- block javascript %}
Expand Down
Loading

0 comments on commit 1255584

Please sign in to comment.