diff --git a/RELEASE-NOTES.rst b/RELEASE-NOTES.rst index d6bbb9b519..5a863f98f0 100644 --- a/RELEASE-NOTES.rst +++ b/RELEASE-NOTES.rst @@ -2411,7 +2411,7 @@ Metadata others). - Renames person module into contribution module. - Sorts the contribution roles in the document editor (with - ``selectWithSort`` form option). + ``select`` form option). - Updates the conversion of documents with contribution references from IdRef. - Corrects MARC to JSON conversion for subjects. diff --git a/rero_ils/config.py b/rero_ils/config.py index 7ce7b5ec4d..50bafb2dd8 100644 --- a/rero_ils/config.py +++ b/rero_ils/config.py @@ -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()), diff --git a/rero_ils/jsonschemas/common/cantons-v0.0.1.json b/rero_ils/jsonschemas/common/cantons-v0.0.1.json index b856bf82aa..285f87872d 100644 --- a/rero_ils/jsonschemas/common/cantons-v0.0.1.json +++ b/rero_ils/jsonschemas/common/cantons-v0.0.1.json @@ -36,7 +36,10 @@ "hide": "field?.parent?.model?.country !== 'sz'" }, "props": { - "itemCssClass": "col-lg-4", + "sort": true, + "placeholder": "Select an option…", + "sortOrder": "asc", + "filter": true, "options": [ { "label": "canton_ag", diff --git a/rero_ils/jsonschemas/common/countries-v0.0.1.json b/rero_ils/jsonschemas/common/countries-v0.0.1.json index 241eaed228..0167a0c4e2 100644 --- a/rero_ils/jsonschemas/common/countries-v0.0.1.json +++ b/rero_ils/jsonschemas/common/countries-v0.0.1.json @@ -381,7 +381,10 @@ "widget": { "formlyConfig": { "props": { - "itemCssClass": "col-lg-4", + "sort": true, + "placeholder": "Select an option…", + "sortOrder": "asc", + "filter": true, "options": [ { "label": "country_aa", @@ -1887,4 +1890,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/jsonschemas/common/currency-v0.0.1.json b/rero_ils/jsonschemas/common/currency-v0.0.1.json index 9a74b7e58c..d2abbe2651 100644 --- a/rero_ils/jsonschemas/common/currency-v0.0.1.json +++ b/rero_ils/jsonschemas/common/currency-v0.0.1.json @@ -14,8 +14,11 @@ "pattern": "^[A-Z]{3}$", "widget": { "formlyConfig": { - "type": "selectWithSort" + "type": "select", + "props": { + "sort": true + } } } } -} \ No newline at end of file +} diff --git a/rero_ils/jsonschemas/common/languages-v0.0.1.json b/rero_ils/jsonschemas/common/languages-v0.0.1.json index 0f7373fa60..ee35b81d5e 100644 --- a/rero_ils/jsonschemas/common/languages-v0.0.1.json +++ b/rero_ils/jsonschemas/common/languages-v0.0.1.json @@ -491,8 +491,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-6", "options": [ { diff --git a/rero_ils/jsonschemas/common/ui-languages-v0.0.1.json b/rero_ils/jsonschemas/common/ui-languages-v0.0.1.json index 6199a43645..8f76183c47 100644 --- a/rero_ils/jsonschemas/common/ui-languages-v0.0.1.json +++ b/rero_ils/jsonschemas/common/ui-languages-v0.0.1.json @@ -10,8 +10,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-2", "options": [ { @@ -35,4 +36,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/acquisition/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json b/rero_ils/modules/acquisition/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json index 8c428e61ed..d381790aab 100644 --- a/rero_ils/modules/acquisition/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json +++ b/rero_ils/modules/acquisition/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json @@ -137,11 +137,9 @@ "default": "in progress", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { - "selectWithSortOptions": { - "order": "label" - }, + "sort": true, "options": [ { "value": "in_progress", @@ -167,7 +165,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -206,11 +204,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { - "selectWithSortOptions": { - "order": "label" - }, + "sort": true, "options": [ { "value": "shipping_and_handling", diff --git a/rero_ils/modules/acquisition/acq_order_lines/jsonschemas/acq_order_lines/acq_order_line-v0.0.1.json b/rero_ils/modules/acquisition/acq_order_lines/jsonschemas/acq_order_lines/acq_order_line-v0.0.1.json index 7c11125ddf..bc00fb95f4 100644 --- a/rero_ils/modules/acquisition/acq_order_lines/jsonschemas/acq_order_lines/acq_order_line-v0.0.1.json +++ b/rero_ils/modules/acquisition/acq_order_lines/jsonschemas/acq_order_lines/acq_order_line-v0.0.1.json @@ -126,8 +126,9 @@ "default": "staff_note", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "vendor_note", @@ -191,7 +192,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "expressions": { "props.required": "field?.parent?.model?.status === 'ordered' || field?.parent?.model?.status === 'received'", "hide": "field?.parent?.model?.status !== 'ordered' && field?.parent?.model?.status !== 'received'" @@ -214,7 +215,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "expressions": { "props.required": "field?.parent?.model?.status === 'received'", "hide": "field?.parent?.model?.status !== 'received'" @@ -278,13 +279,14 @@ "pattern": "^https://bib.rero.ch/api/documents/.+?$", "widget": { "formlyConfig": { + "type": "remoteAutoComplete", "props": { "validation": { "messages": { "patternMessage": "Should be in the following format: https://bib.rero.ch/api/documents/." } }, - "remoteTypeahead": { + "queryOptions": { "type": "documents", "filter": "NOT harvested:true" } diff --git a/rero_ils/modules/acquisition/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json b/rero_ils/modules/acquisition/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json index 1aad6a4864..96b21fd5d3 100644 --- a/rero_ils/modules/acquisition/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json +++ b/rero_ils/modules/acquisition/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json @@ -49,8 +49,9 @@ "default": "monograph", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "value": "monograph", @@ -112,8 +113,9 @@ "default": "staff_note", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "vendor_note", diff --git a/rero_ils/modules/acquisition/acq_receipt_lines/jsonschemas/acq_receipt_lines/acq_receipt_line-v0.0.1.json b/rero_ils/modules/acquisition/acq_receipt_lines/jsonschemas/acq_receipt_lines/acq_receipt_line-v0.0.1.json index 45358b8d00..e9680f2691 100644 --- a/rero_ils/modules/acquisition/acq_receipt_lines/jsonschemas/acq_receipt_lines/acq_receipt_line-v0.0.1.json +++ b/rero_ils/modules/acquisition/acq_receipt_lines/jsonschemas/acq_receipt_lines/acq_receipt_line-v0.0.1.json @@ -119,7 +119,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -162,8 +162,9 @@ "default": "staff_note", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "staff_note", diff --git a/rero_ils/modules/acquisition/acq_receipts/jsonschemas/acq_receipts/acq_receipt-v0.0.1.json b/rero_ils/modules/acquisition/acq_receipts/jsonschemas/acq_receipts/acq_receipt-v0.0.1.json index fdc4511e5d..2731a3ab60 100644 --- a/rero_ils/modules/acquisition/acq_receipts/jsonschemas/acq_receipts/acq_receipt-v0.0.1.json +++ b/rero_ils/modules/acquisition/acq_receipts/jsonschemas/acq_receipts/acq_receipt-v0.0.1.json @@ -166,8 +166,9 @@ "default": "staff_note", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "staff_note", diff --git a/rero_ils/modules/acquisition/budgets/jsonschemas/budgets/budget-v0.0.1.json b/rero_ils/modules/acquisition/budgets/jsonschemas/budgets/budget-v0.0.1.json index d4cf6cbdd8..0dc3aef581 100644 --- a/rero_ils/modules/acquisition/budgets/jsonschemas/budgets/budget-v0.0.1.json +++ b/rero_ils/modules/acquisition/budgets/jsonschemas/budgets/budget-v0.0.1.json @@ -59,7 +59,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -77,7 +77,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { diff --git a/rero_ils/modules/collections/jsonschemas/collections/collection-v0.0.1.json b/rero_ils/modules/collections/jsonschemas/collections/collection-v0.0.1.json index ae60b7bd49..1e39bf582d 100644 --- a/rero_ils/modules/collections/jsonschemas/collections/collection-v0.0.1.json +++ b/rero_ils/modules/collections/jsonschemas/collections/collection-v0.0.1.json @@ -60,14 +60,12 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "wrappers": [ "form-field" ], "props": { - "selectWithSortOptions": { - "order": "label" - }, + "sort": true, "options": [ { "label": "course", @@ -161,17 +159,17 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { "patternMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).", - "dateMustBeLessThan": "The start date must be less than the end date." + "datesGreaterThan": "The start date must be less than the end date." }, "validators": { - "dateMustBeLessThan": { - "startDate": "start_date", - "endDate": "end_date", + "datesGreaterThan": { + "dateFirst": "start_date", + "dateLast": "end_date", "strict": true } } @@ -187,17 +185,17 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { "patternMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).", - "datesMustBeGreaterThan": "The end date must be greater than the start date." + "datesGreaterThan": "The end date must be greater than the start date." }, "validators": { - "dateMustBeGreaterThan": { - "startDate": "start_date", - "endDate": "end_date", + "datesGreaterThan": { + "dateFirst": "start_date", + "dateLast": "end_date", "strict": true } } @@ -257,8 +255,9 @@ "pattern": "^https://bib.rero.ch/api/items/.*?$", "widget": { "formlyConfig": { + "type": "remoteAutoComplete", "props": { - "remoteTypeahead": { + "queryOptions": { "type": "items" } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_admin_metadata-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_admin_metadata-v0.0.1.json index e1152a0acb..dded8f6b27 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_admin_metadata-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_admin_metadata-v0.0.1.json @@ -51,9 +51,10 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "itemCssClass": "col-lg-6", + "sort": true, "options": [ { "label": "Full level", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_color_content-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_color_content-v0.0.1.json index 55156ccdbd..9a45f4850c 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_color_content-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_color_content-v0.0.1.json @@ -13,11 +13,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { - "selectWithSortOptions": { - "order": "label" - }, + "sort": true, "cssClass": "w-md-50", "options": [ { @@ -41,4 +39,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json index 137771e272..4f08698787 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json @@ -72,8 +72,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1002", @@ -168,8 +169,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1021", @@ -267,8 +269,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1011", @@ -355,8 +358,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1030", @@ -423,8 +427,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1032", @@ -516,8 +521,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1042", @@ -585,8 +591,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1045", @@ -668,8 +675,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdact:1051", @@ -739,8 +747,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "unspecified", @@ -803,8 +812,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdaco:1002", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_entity_link-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_entity_link-v0.0.1.json index 577fcc18a4..3725a46a71 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_entity_link-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_entity_link-v0.0.1.json @@ -17,12 +17,12 @@ "pattern": "^(https://mef.rero.ch/api/agents/(gnd|idref|rero)/.*|https://bib.rero.ch/api/local_entities/.*?)$", "widget": { "formlyConfig": { - "type": "entityTypeahead", - "wrappers": [ - "form-field-horizontal" - ], + "type": "entity-autocomplete", "props": { + "scrollHeight": "600px", + "group": true, "filters": { + "selected": "bf:Person", "options": [ { "label": "Person", @@ -34,7 +34,9 @@ } ] }, - "itemCssClass": "col-12" + "queryOptions": { + "type": "mef" + } } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_local-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_local-v0.0.1.json index c2a970b2a3..1604fc5fa4 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_local-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_local-v0.0.1.json @@ -24,8 +24,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "bf:Person", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_role-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_role-v0.0.1.json index b87f1e7186..6d0251fbe7 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_role-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_role-v0.0.1.json @@ -162,8 +162,10 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "filter": true, + "sort": true, "itemCssClass": "col-lg-6", "options": [ { @@ -771,4 +773,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json index 8878457cdb..e8d83b0774 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json @@ -266,13 +266,15 @@ "pattern": "^https://bib.rero.ch/api/documents/.*?$", "widget": { "formlyConfig": { + "type": "remoteAutoComplete", "props": { + "scrollHeight": "400px", "validation": { "messages": { "patternMessage": "Should be in the following format: https://bib.rero.ch/api/documents/." } }, - "remoteTypeahead": { + "queryOptions": { "type": "documents", "filter": "NOT harvested:true" }, @@ -305,4 +307,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json index bae81becce..5d8b16bba9 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json @@ -52,8 +52,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-6", "options": [ { @@ -117,8 +118,10 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, + "filter": true, "itemCssClass": "col-lg-6", "options": [ { @@ -280,4 +283,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_entity_local-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_entity_local-v0.0.1.json index 208bb2304a..a9d1bc89e5 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_entity_local-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_entity_local-v0.0.1.json @@ -30,8 +30,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-6", "options": [ { @@ -177,8 +178,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-6", "options": [ { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_genre_form_link-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_genre_form_link-v0.0.1.json index 7eec87c149..b225fe07ba 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_genre_form_link-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_genre_form_link-v0.0.1.json @@ -16,12 +16,12 @@ "pattern": "^(https://mef.rero.ch/api/concepts/(gnd|idref|rero)/.*|https://bib.rero.ch/api/local_entities/.*?)$", "widget": { "formlyConfig": { - "type": "entityTypeahead", - "wrappers": [ - "form-field-horizontal" - ], + "type": "entity-autocomplete", "props": { + "scrollHeight": "600px", + "group": true, "filters": { + "selected": "concepts_genreForm", "options": [ { "label": "Genre, form", @@ -29,7 +29,9 @@ } ] }, - "itemCssClass": "col-12" + "queryOptions": { + "type": "mef" + } } } } @@ -39,12 +41,5 @@ "type": "string", "minLength": 1 } - }, - "widget": { - "formlyConfig": { - "props": { - "containerCssClass": "row" - } - } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json index 5f078f8767..9095997766 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json @@ -50,8 +50,10 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, + "filter": true, "itemCssClass": "col-lg-6", "options": [ { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json index e5ab70d30a..6b7e834aba 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json @@ -69,8 +69,10 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, + "filter": true, "itemCssClass": "col-lg-6", "options": [ { @@ -233,8 +235,10 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, + "filter": true, "options": [ { "label": "target_school_harmos1", @@ -342,8 +346,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "pegi_3", @@ -414,8 +419,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "from the age of 18", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_note-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_note-v0.0.1.json index 32371ae772..51d0df1e7f 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_note-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_note-v0.0.1.json @@ -28,8 +28,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-12", "options": [ { @@ -85,4 +86,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_part_of-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_part_of-v0.0.1.json index 8c8bb6c04a..d341782697 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_part_of-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_part_of-v0.0.1.json @@ -33,13 +33,14 @@ "pattern": "^https://bib.rero.ch/api/documents/.*?$", "widget": { "formlyConfig": { + "type": "remoteAutoComplete", "props": { "validation": { "messages": { "patternMessage": "Should be in the following format: https://bib.rero.ch/api/documents/." } }, - "remoteTypeahead": { + "queryOptions": { "type": "documents", "filter": "NOT harvested:true" } @@ -147,4 +148,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_production_method-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_production_method-v0.0.1.json index 80017d7164..d1560156f4 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_production_method-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_production_method-v0.0.1.json @@ -31,8 +31,10 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, + "filter": true, "cssClass": "w-md-50", "options": [ { @@ -128,4 +130,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json index f7c85c80e4..f700fd44fe 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json @@ -37,8 +37,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemcCssClass": "col", "options": [ { @@ -154,8 +155,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-4", "options": [ { @@ -278,4 +280,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json index f68b2979c9..4de8c84a5a 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json @@ -24,8 +24,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "Linear scale", @@ -211,4 +212,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_subjects_entity_link-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_subjects_entity_link-v0.0.1.json index 0e92a9f41d..3742113ee9 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_subjects_entity_link-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_subjects_entity_link-v0.0.1.json @@ -17,13 +17,12 @@ "pattern": "^(https://mef.rero.ch/api/(agents|concepts|places)/(gnd|idref|rero)/.*|https://bib.rero.ch/api/local_entities/.*?)$", "widget": { "formlyConfig": { - "type": "entityTypeahead", - "wrappers": [ - "form-field-horizontal" - ], + "type": "entity-autocomplete", "props": { + "scrollHeight": "600px", + "group": true, "filters": { - "default": "bf:Topic", + "selected": "bf:Topic", "options": [ { "label": "Topic", @@ -51,7 +50,9 @@ } ] }, - "itemCssClass": "col-12" + "queryOptions": { + "type": "mef" + } } } } @@ -61,12 +62,5 @@ "type": "string", "minLength": 1 } - }, - "widget": { - "formlyConfig": { - "props": { - "containerCssClass": "row" - } - } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_title-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_title-v0.0.1.json index aea15a3182..528bcc80e9 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_title-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_title-v0.0.1.json @@ -31,8 +31,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "cssClass": "w-md-50", "options": [ { @@ -143,4 +144,4 @@ } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/templates/rero_ils/_anonymous_button.html b/rero_ils/modules/documents/templates/rero_ils/_anonymous_button.html deleted file mode 100644 index 6a2aa26d3c..0000000000 --- a/rero_ils/modules/documents/templates/rero_ils/_anonymous_button.html +++ /dev/null @@ -1,23 +0,0 @@ -{# -*- coding: utf-8 -*- - - RERO ILS - Copyright (C) 2019-2022 RERO - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -#} -{%- if current_user.is_anonymous %} - - {{ _('Log in (to see request options)') }} - -{%- endif %} diff --git a/rero_ils/modules/documents/templates/rero_ils/_document_online.html b/rero_ils/modules/documents/templates/rero_ils/_document_online.html deleted file mode 100644 index 0f68c32f3e..0000000000 --- a/rero_ils/modules/documents/templates/rero_ils/_document_online.html +++ /dev/null @@ -1,67 +0,0 @@ -{# -*- coding: utf-8 -*- - - RERO ILS - Copyright (C) 2019-2022 RERO - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -#} -{% set holdings = record.pid|online_holdings(viewcode) %} -{% for library,accesses in holdings.items() %} -
- -
-
-
- {{ library }} -
-
- {{ _('Online') }} -
-
-
- -
-
-
    - {% for access in accesses %} -
  • - {% for elocation in access.electronic_location %} - - {% endfor %} - {% if access.enumerationAndChronology %} -
    -
    {{ _('Unit') }}
    -
    {{ access.enumerationAndChronology }}
    -
    - {% endif %} - - {% for note in access.notes %} -
    -
    {{ _(note.type) }}
    -
    {{ note.content}}
    -
    - {% endfor %} -
  • - {% endfor %} -
-
-
-
-{% endfor %} diff --git a/rero_ils/modules/documents/templates/rero_ils/_documents_description.html b/rero_ils/modules/documents/templates/rero_ils/_documents_description.html deleted file mode 100644 index 08305fb527..0000000000 --- a/rero_ils/modules/documents/templates/rero_ils/_documents_description.html +++ /dev/null @@ -1,553 +0,0 @@ -{# -*- coding: utf-8 -*- - - RERO ILS - Copyright (C) 2019-2022 RERO - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -#} -
- - - - {% if record.fiction_statement %} -
-
{{ _('Fiction statement') }}
-
- {{ _(record.fiction_statement) }} -
-
- {% endif %} - - - {% with fieldLabel=_('Supplement'), data=record.supplement, header=false %} - {% include 'rero_ils/_other_edition.html' %} - {% endwith %} - - {% with fieldLabel=_('Related to'), data=record.relatedTo, header=false %} - {% include 'rero_ils/_other_edition.html' %} - {% endwith %} - - - {% if record.note %} - {% set noteGeneral = record.note | note_general %} - {% if noteGeneral %} -
-
{{ _('General note') }}
-
-
    - {% for note in noteGeneral.general %} -
  • {{ note }}
  • - {% endfor %} -
-
-
- {% endif %} - {% endif %} - - - {% if record.credits %} -
-
{{ _('Other responsibilities') }}
-
-
    - {% for credit in record.credits %} -
  • {{ credit }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.language and record.language | length > 0 %} -
-
{{ _('Language') }}
-
-
    - {% for language in record.language %} -
  • {{ _('lang_' + language.value) }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.originalLanguage and record.originalLanguage | length > 0 %} -
-
{{ _('Original language') }}
-
-
    - {% for language in record.originalLanguage %} -
  • {{ _('lang_' + language) }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.originalTitle %} -
-
{{ _('Original title') }}
-
-
    - {% for title in record.originalTitle %} -
  • {{ title }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.work_access_point %} - {% set workauthorized_access_point = record.work_access_point | work_access_point %} -
-
{{ _('Work') }}
-
-
    - {% for work in workauthorized_access_point %} -
  • {{ work }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.tableOfContents %} -
-
{{ _('Contents') }}
-
-
    - {% for table in record.tableOfContents %} -
  • {{ table }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.dissertation %} -
-
{{ _('Thesis') }}
-
-
    - {% for dissertation in record.dissertation %} - {% for label in dissertation.label %} -
  • {{ label.value }}
  • - {% endfor %} - {% endfor %} -
-
-
- {% endif %} - - - {% if record.intendedAudience %} -
-
{{ _('Intended audience') }}
-
-
    - {% for audience in record.intendedAudience %} -
  • {{ _(audience.value) }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.illustrativeContent %} -
-
{{ _('Illustrations') }}
-
-
    - {% for illustrative in record.illustrativeContent %} -
  • {{ illustrative }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.colorContent %} -
-
{{ _('Colors') }}
-
-
    - {% for color in record.colorContent %} -
  • {{ _(color) }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.scale %} -
-
{{ _('Scale') }}
-
-
    - {% for scale in record.scale %} -
  • {{ scale.label }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.cartographicAttributes %} - {% set attributes = record.cartographicAttributes | cartographic_attributes %} - {% if attributes | length > 0 %} -
-
{{ _('Cartographic data') }}
-
-
    - {% for attribute in attributes %} -
  • - {% if 'projection' in attribute %}{{ attribute.projection }}{% endif %} - {% if ('projection' in attribute) and ('coordinates' in attribute) and ('label' in attribute.coordinates) %};{% endif %} - {% if ('coordinates' in attribute) and ('label' in attribute.coordinates) %}{{ attribute.coordinates.label }}{% endif %} -
  • - {% endfor %} -
-
-
- {% endif %} - {% endif %} - - - {% if record.classification %} -
-
{{ _('Classification') }}
-
-
    - {% for classification in record.classification %} -
  • - {{ classification.classificationPortion }} - {% if 'subdivision' in classification %} - - - {% for sub in classification.subdivision %} - {{ sub }} - {% if not loop.last %} - {% endif %} - {% endfor %} - {% endif %} - ({{ _(classification.type) }}) -
  • - {% endfor %} -
-
-
- {% endif %} - - - - - - {% if record.usageAndAccessPolicy %} -
-
{{ _('Use and access condition') }}
-
-
    - {% for usage in record.usageAndAccessPolicy %} -
  • {{ usage.label }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% with fieldLabel=_('Other edition'), data=record.otherEdition, header=false %} - {% include 'rero_ils/_other_edition.html' %} - {% endwith %} - - {% with fieldLabel=_('Also issued as'), data=record.otherPhysicalFormat, header=false %} - {% include 'rero_ils/_other_edition.html' %} - {% endwith %} - - {% with fieldLabel=_('Reproduced as'), data=record.hasReproduction, header=false %} - {% include 'rero_ils/_other_edition.html' %} - {% endwith %} - - - {% if record.title %} - {% set variants = record.title | title_variants %} - {% for key, value in variants.items() %} -
-
{{ _(key) | capitalize }}
-
-
    - {% for title in value %} -
  • {{ title }}
  • - {% endfor %} -
-
-
- {% endfor %} - {% endif %} - - - {% if record.responsibilityStatement %} -
-
{{ _('Statement of responsibility') }}
-
-
    - {% for responsibility in record.responsibilityStatement %} - {% for resp in responsibility %} -
  • {{ resp.value }}
  • - {% endfor %} - {% endfor %} -
-
-
- {% endif %} - - - {% if record.seriesStatement %} -
-
{{ _('Series statement') }}
-
-
    - {% for series in record.seriesStatement | series_statement_format %} - {% for serie in series %} -
  • {{ serie.value }}
  • - {% endfor %} - {% endfor %} -
-
-
- {% endif %} - - - {% if record.provisionActivity %} - {% set provisions = record.provisionActivity | provision_activity | provision_activity_not_publication %} - {% for key, provisions in provisions.items() %} -
-
{{ _(key) }}
-
-
    - {% for provision in provisions %} -
  • {{ provision.value }}
  • - {% endfor %} -
-
-
- {% endfor %} - {% endif %} - - - {% if record.provisionActivity %} - {% set provisions = record.provisionActivity | provision_activity_original_date %} - {% if provisions | length > 0 %} -
-
{{ _('Date of the original') }}
-
-
    - {% for provision in provisions %} -
  • {{ provision }}
  • - {% endfor %} -
-
-
- {% endif %} - {% endif %} - - - {% if record.copyrightDate %} -
-
{{ _('Copyright date') }}
-
-
    - {% for copyright in record.copyrightDate %} -
  • {{ copyright }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.sequence_numbering %} -
-
{{ _('Numbering') }}
-
{{ record.sequence_numbering }}
-
- {% endif %} - - - {% if record.dimensions %} -
-
{{ _('Dimensions') }}
-
-
    - {% for dimension in record.dimensions %} -
  • {{ dimension }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.bookFormat %} -
-
{{ _('Format') }}
-
-
    - {% for format in record.bookFormat %} -
  • {{ format }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.productionMethod %} -
-
{{ _('Production method') }}
-
-
    - {% for method in record.productionMethod %} -
  • {{ _(method) }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.note %} - {% set notes = record.note | notes_except_general %} - {% if notes %} - {% for key, notes in notes.items() %} -
-
{{ _(key) }}
-
-
    - {% for note in notes %} -
  • {{ note }}
  • - {% endfor %} -
-
-
- {% endfor %} - {% endif %} - {% endif %} - - - {% if record.supplementaryContent %} -
-
{{ _('Supplementary content') }}
-
-
    - {% for sup in record.supplementaryContent %} -
  • {{ sup }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.acquisitionTerms %} -
-
{{ _('Terms of availability') }}
-
-
    - {% for term in record.acquisitionTerms %} -
  • {{ term }}
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.identifiedBy %} - {% set identifiedby = record.identifiedBy | identified_by %} - {% if identifiedby | length > 0 %} -
-
{{ _('Identifier') }}
-
-
    - {% for identifier in identifiedby %} -
  • - {% if identifier.type == "uri" %} - {{ identifier.value }} - {% else %} - {{ identifier.value }} - {% endif %} - {% if identifier.details != '' %} - - {{ identifier.details }} - {% endif %} - {{ _(identifier.type)|safe }} -
  • - {% endfor %} -
-
-
- {% endif %} - {% endif %} - - - - - - {% if record.contentMediaCarrier %} -
-
{{ _('Carrier and content type') }}
-
-
    - {% for content in record.contentMediaCarrier %} -
  • - {{ _(content.carrierType) }} - {%- if 'contentType' in content %} - ({%- for type in content.contentType -%} - {{ _(type) }}{% if not loop.last %}, {% endif %} - {%- endfor -%}) - {% endif %} -
  • - {% endfor %} -
-
-
- {% endif %} - - - {% if record.issuance %} -
-
{{ _('Mode of issuance') }}
-
- {{ _(record.issuance.main_type) }} / {{ _(record.issuance.subtype) }} -
-
- {% endif %} - - -
-
{{ _('Permalink') }}
-
- {% set permalink = url_for('invenio_records_ui.doc', viewcode=viewcode, pid_value=record.pid, _external=True) %} - {{ permalink }} -
-
-
diff --git a/rero_ils/modules/documents/templates/rero_ils/_ill_request_button.html b/rero_ils/modules/documents/templates/rero_ils/_ill_request_button.html deleted file mode 100644 index 941fe4d0b0..0000000000 --- a/rero_ils/modules/documents/templates/rero_ils/_ill_request_button.html +++ /dev/null @@ -1,35 +0,0 @@ -{# -*- coding: utf-8 -*- - - RERO ILS - Copyright (C) 2019-2022 RERO - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -#} -{% if - config.RERO_ILS_ILL_REQUEST_ON_GLOBAL_VIEW - and current_user - and current_user.is_authenticated - and current_patrons|length > 0 - and viewcode == config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE - and not record.harvested -%} - {{ _('interlibrary_loan') | capitalize }} -{% endif %} 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 b8c0f3b8a7..4a62bed4d6 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 @@ -24,8 +24,7 @@ {%- block css %} {{ super() }} - {{ node_assets('@rero/rero-ils-ui/dist/public-holdings-items', ['styles.*css'], 'css') }} - {% if viewcode | babeltheque_enabled_view %} + {% if viewcode | babeltheque_enabled_view and isbn is not none %} {{ webpack['babeltheque.css'] }} {% endif %} {%- endblock css %} @@ -34,26 +33,6 @@
{{ _('Back') }}
-{%- set formats = export_formats(pid.pid_type) %} -{%- if formats %} -
-
- -
-
-{%- endif %}
{%- set icon_name = record | document_main_type(false) %} {%- set covert_art = record | get_cover_art %} @@ -296,131 +275,36 @@

{%- block record_body %}
- {% if not(holdings_count > 0 or es_record.files) %} -
- -
-
-
-
- {% include('rero_ils/_documents_description.html') %} -
-
- {% else %} -
- -
-
- {% if holdings_count > 0 or es_record.files %} -
- {% 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 %} - - {% endif %} - - {% if holdings_count > 0 %} - {% include('rero_ils/_ill_request_button.html') %} - {% endif %} -
- {% endif %} -
- {% include('rero_ils/_documents_description.html') %} -
- {% if viewcode | babeltheque_enabled_view %} -
- - -
-
-
-
{{ _('No additionnal information yet.') }}
+
+ + {% if viewcode | babeltheque_enabled_view and isbn is not none %} + + + +
+
+
+
{{ _('No additional information yet.') }}
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- {% endif %} -
- {% endif %} +
+
+
+
+
+ + {% endif %} + +

- -
- {%- set formats = export_formats(pid.pid_type) %} - {%- if formats %} -
{{ _('Export Formats') }}:
- - {%- endif %} -
{%- endblock record_body %} {%- endblock body %} diff --git a/rero_ils/modules/documents/views.py b/rero_ils/modules/documents/views.py index fc836653ce..eb2835fe58 100644 --- a/rero_ils/modules/documents/views.py +++ b/rero_ils/modules/documents/views.py @@ -26,43 +26,30 @@ from elasticsearch_dsl.query import Q from flask import Blueprint, current_app, render_template, url_for from flask_babel import gettext as _ -from flask_login import current_user from invenio_records_ui.signals import record_viewed -from rero_ils.modules.collections.api import CollectionsSearch from rero_ils.modules.entities.api import Entity from rero_ils.modules.entities.helpers import get_entity_record_from_data -from rero_ils.modules.entities.models import EntityType -from rero_ils.modules.holdings.models import HoldingNoteTypes -from rero_ils.modules.items.models import ItemCirculationAction -from rero_ils.modules.libraries.api import Library from rero_ils.modules.locations.api import Location from rero_ils.modules.organisations.api import Organisation from rero_ils.modules.patrons.api import current_patrons from rero_ils.modules.utils import extracted_data_from_ref -from ..collections.api import CollectionsSearch from ..entities.api import Entity -from ..entities.models import EntityType -from ..holdings.models import HoldingNoteTypes -from ..items.models import ItemCirculationAction -from ..libraries.api import Library from ..locations.api import Location from ..organisations.api import Organisation from ..patrons.api import current_patrons from ..utils import extracted_data_from_ref -from .api import Document, DocumentsSearch +from .api import Document from .dumpers import document_indexer_dumper from .extensions import ( EditionStatementExtension, ProvisionActivitiesExtension, - SeriesStatementExtension, TitleExtension, ) from .utils import ( display_alternate_graphic_first, get_remote_cover, - title_format_text, title_format_text_alternate_graphic, title_variant_format_text, ) @@ -146,37 +133,6 @@ def get_first_isbn(record): return isbns[0] if isbns else None -@blueprint.app_template_filter() -def note_general(notes): - """Preprocess notes to extract only general type.""" - return sort_by_type(list(filter(lambda t: t["noteType"] == "general", notes))) - - -@blueprint.app_template_filter() -def notes_except_general(notes): - """Preprocess notes to extract all note except general type.""" - return sort_by_type(list(filter(lambda t: t["noteType"] != "general", notes))) - - -def sort_by_type(notes): - """Sort notes by type.""" - by_type = {} - for note in notes: - by_type.setdefault(note["noteType"], []) - by_type[note["noteType"]].append(note["label"]) - return by_type - - -@blueprint.app_template_filter() -def cartographic_attributes(attributes): - """Preprocess cartographic attributes.""" - return [ - attribute - for attribute in attributes - if "projection" in attribute or attribute.get("coordinates", {}).get("label") - ] - - @blueprint.app_template_filter() def provision_activity(provisions): """Preprocess provision activity.""" @@ -196,81 +152,6 @@ def provision_activity_publication(provisions): return {"bf:Publication": provisions.get("bf:Publication", [])} -@blueprint.app_template_filter() -def provision_activity_not_publication(provisions): - """Extact other than publication of provision activity.""" - if "bf:Publication" in provisions: - provisions.pop("bf:Publication") - return provisions - - -@blueprint.app_template_filter() -def provision_activity_original_date(provisions): - """Preprocess provision activity original date.""" - return [ - provision["original_date"] - for provision in provisions - if "original_date" in provision - ] - - -@blueprint.app_template_filter() -def title_variants(titles): - """Preprocess title variants.""" - variants = {} - bf_titles = list(filter(lambda t: t["type"] != "bf:Title", titles)) - for title in bf_titles: - title_texts = title_format_text(title, with_subtitle=True) - variants.setdefault(title["type"], []) - variants[title["type"]].append(title_texts[0].get("value")) - return variants - - -@blueprint.app_template_filter() -def identified_by(identifiedby): - """Preprocess identified by.""" - output = [] - for identifier in identifiedby: - details = [] - # Replace bf:Local by source - id_type = identifier.get("type") - if id_type == "bf:Local": - id_type = identifier.get("source") - # Format qualifier, status and note - if identifier.get("qualifier"): - details.append(identifier.get("qualifier")) - if identifier.get("status"): - details.append(identifier.get("status")) - if identifier.get("note"): - details.append(identifier.get("note")) - output.append( - { - "type": id_type, - "value": identifier.get("value"), - "details": ", ".join(details), - } - ) - return output - - -@blueprint.app_template_filter() -def can_request(item): - """Check if the current user can request a given item.""" - if current_user.is_authenticated: - patron = None - for p in current_patrons: - if p.organisation_pid == item.organisation_pid: - patron = p - if patron: - can, reasons = item.can( - ItemCirculationAction.REQUEST, - patron=patron, - library=Library.get_record_by_pid(patron.library_pid), - ) - return can, reasons - return False, [] - - @blueprint.app_template_filter() def contribution_format(contributions, language, viewcode, with_roles=False): """Format contribution for template in given language. @@ -399,107 +280,6 @@ def part_of_format(part_of): return output -@blueprint.app_template_filter() -def record_library_pickup_locations(record): - """Get the pickup locations of the library of the given item or holding.""" - location_pid = extracted_data_from_ref(record.get("location")) - location = Location.get_record_by_pid(location_pid) - # Either the location defines some 'restrict_pickup_to' either not. - # * If 'restrict_pickup_to' is defined, then only these locations are - # eligible as possible pickup_locations - # * Otherwise, get all organisation pickup locations - # of the record belongs to - if "restrict_pickup_to" in location: - # Get all pickup locations as Location objects and append it to the - # location record (removing possible None values) - pickup_locations = [ - Location.get_record_by_pid(loc_pid) - for loc_pid in location.restrict_pickup_to - ] - else: - org = Organisation.get_record_by_pid(location.organisation_pid) - # Get the pickup location from each library of the record organisation - # (removing possible None value) - pickup_locations = [] - for library in org.get_libraries(): - pickup_locations.extend( - Location.get_record_by_pid(location_pid) - for location_pid in list(library.get_pickup_locations_pids()) - ) - return sorted( - list(filter(None, pickup_locations)), - key=lambda location: location.get("pickup_name", location.get("code")), - ) - - -@blueprint.app_template_filter() -def work_access_point(work_access_point): - """Process work access point data.""" - wap = [] - for work in work_access_point: - agent_formatted = "" - if agent := work.get("creator"): - if agent["type"] == EntityType.PERSON: - # Person - name = [] - if "preferred_name" in agent: - name.append(agent["preferred_name"]) - if "numeration" in agent: - name.append(agent["numeration"]) - elif "fuller_form_of_name" in agent: - name.append(f"({agent['fuller_form_of_name']})") - if len(name): - agent_formatted += f"{', '.join(name)}, " - if "numeration" in agent and "qualifier" in agent: - agent_formatted += f"{agent['qualifier']}, " - dates = [ - agent[key] - for key in ["date_of_birth", "date_of_death"] - if key in agent - ] - if len(dates): - agent_formatted += f"{'-'.join(dates)}. " - if "numeration" not in agent and "qualifier" in agent: - agent_formatted += f"{agent['qualifier']}. " - else: - # Organisation - if "preferred_name" in agent: - agent_formatted += agent["preferred_name"] + ". " - if "subordinate_unit" in agent: - for unit in agent["subordinate_unit"]: - agent_formatted += f"{unit}. " - if ( - "numbering" in agent - or "conference_date" in agent - or "place" in agent - ): - conf = [ - agent[key] for key in ["numbering", "conference_date", "place"] - ] - if len(conf): - agent_formatted += f"({' : '.join(conf)}) " - agent_formatted += f"{work['title']}. " - if "part" in work: - for part in work["part"]: - for key in ["partNumber", "partName"]: - if key in part: - agent_formatted += f"{part[key]}. " - if "miscellaneous_information" in work: - agent_formatted += f"{work['miscellaneous_information']}. " - if "language" in work: - agent_formatted += f"{_('lang_'+work['language'])}. " - if "medium_of_performance_for_music" in work: - agent_formatted += f"{'. '.join(work['medium_of_performance_for_music'])}. " - if "key_for_music" in work: - agent_formatted += f"{work['key_for_music']}. " - if "arranged_statement_for_music" in work: - agent_formatted += f"{work['arranged_statement_for_music']}. " - if "date_of_work" in work: - agent_formatted += f"{work['date_of_work']}. " - wap.append(agent_formatted.strip()) - return wap - - @blueprint.app_template_filter() def create_publication_statement(provision_activity): """Create publication statement from place, agent and date values.""" @@ -622,62 +402,6 @@ def create_title_alternate_graphic(titles, responsibility_statement=None): return output -@blueprint.app_template_filter() -def create_title_variants(titles): - """Create the list of variant titles as text for detail view. - - :param titles: list of title objects - :type titles: list - :return: list of variant titles as text for detail view - :rtype: list - """ - output = [] - title_variant_texts = title_variant_format_text(titles=titles, with_subtitle=True) - for title_variant_text in title_variant_texts: - value = title_variant_text.get("value") - if value not in output: - output.append(value) - return output - - -@blueprint.app_template_filter() -def create_title_responsibilites(responsibilityStatement): - """Create the list of title responsibilites as text for detail view. - - :param responsibilityStatement: list of responsibilityStatement - :type responsibilityStatement: list - :return: list of title responsibilites as text for detail view - :rtype: list - - """ - output = [] - for responsibility in responsibilityStatement: - for responsibility_language in responsibility: - value = responsibility_language.get("value") - if value not in output: - language = responsibility_language.get("language", "default") - if display_alternate_graphic_first(language): - output.insert(0, value) - else: - output.append(value) - return output - - -@blueprint.app_template_filter() -def in_collection(item_pid): - """Find item in published collection(s). - - :param item_pid: item pid - :return: list of collections whose item is present - """ - return list( - CollectionsSearch() - .filter("term", items__pid=item_pid) - .filter("term", published=True) - .scan() - ) - - @blueprint.app_template_filter() def document_types(record, translate: bool = True) -> list[str]: """Get document types. @@ -706,82 +430,83 @@ def document_main_type(record, translate: bool = True) -> Optional[str]: @blueprint.app_template_filter() -def get_articles(record): - """Get articles for serial. +def main_title_text(title): + """Extract title with type bf:Title. - :return: list of articles with title and pid- + :param title: array of the field title. """ - search = ( - DocumentsSearch() - .filter("term", partOf__document__pid=record.get("pid")) - .source(["pid", "title"]) - ) - return [ - {"title": TitleExtension.format_text(hit.title), "pid": hit.pid} - for hit in search.scan() - ] + return list(filter(lambda t: t.get("type") == "bf:Title", title)) @blueprint.app_template_filter() -def n_electronic_holdings(record): - """Get the number of electronic holdings for this document. - - :return: integer of number of electronic holdings - """ - return Document.get_n_available_holdings(record.pid)[1] +def record_library_pickup_locations(record): + """Get the pickup locations of the library of the given item or holding.""" + location_pid = extracted_data_from_ref(record.get("location")) + location = Location.get_record_by_pid(location_pid) + # Either the location defines some 'restrict_pickup_to' either not. + # * If 'restrict_pickup_to' is defined, then only these locations are + # eligible as possible pickup_locations + # * Otherwise, get all organisation pickup locations + # of the record belongs to + if "restrict_pickup_to" in location: + # Get all pickup locations as Location objects and append it to the + # location record (removing possible None values) + pickup_locations = [ + Location.get_record_by_pid(loc_pid) + for loc_pid in location.restrict_pickup_to + ] + else: + org = Organisation.get_record_by_pid(location.organisation_pid) + # Get the pickup location from each library of the record organisation + # (removing possible None value) + pickup_locations = [] + for library in org.get_libraries(): + pickup_locations.extend( + Location.get_record_by_pid(location_pid) + for location_pid in list(library.get_pickup_locations_pids()) + ) + return sorted( + list(filter(None, pickup_locations)), + key=lambda location: location.get("pickup_name", location.get("code")), + ) @blueprint.app_template_filter() -def online_holdings(document_pid, viewcode="global"): - """Find holdings by document pid and viewcode. - - :param document_pid: document pid - :param viewcode: symbol of organisation viewcode - :return: list of holdings - """ - from ..holdings.api import HoldingsSearch - - organisation = None - if viewcode != current_app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE"): - organisation = Organisation.get_record_by_viewcode(viewcode) - query = ( - HoldingsSearch() - .filter("term", document__pid=document_pid) - .filter("bool", must_not=[Q("term", _masked=True)]) - ) - - if organisation: - query = query.filter("term", organisation__pid=organisation.pid) - results = query.source( - ["library", "electronic_location", "enumerationAndChronology", "notes"] - ).scan() - - holdings = {} - for record in results: - library = Library.get_record_by_pid(record.library.pid) - library_holdings = holdings.get(library["name"], []) - record.library.name = library["name"] - if public_notes_content := [ - n["content"] - for n in record.to_dict().get("notes", []) - if n["type"] in HoldingNoteTypes.PUBLIC - ]: - record.notes = public_notes_content - library_holdings.append(record) - holdings[library["name"]] = library_holdings - return holdings +def create_title_responsibilites(responsibilityStatement): + """Create the list of title responsibilites as text for detail view. + :param responsibilityStatement: list of responsibilityStatement + :type responsibilityStatement: list + :return: list of title responsibilites as text for detail view + :rtype: list -@blueprint.app_template_filter() -def series_statement_format(series): - """Series statement format.""" - return [SeriesStatementExtension.format_text(serie) for serie in series] + """ + output = [] + for responsibility in responsibilityStatement: + for responsibility_language in responsibility: + value = responsibility_language.get("value") + if value not in output: + language = responsibility_language.get("language", "default") + if display_alternate_graphic_first(language): + output.insert(0, value) + else: + output.append(value) + return output @blueprint.app_template_filter() -def main_title_text(title): - """Extract title with type bf:Title. +def create_title_variants(titles): + """Create the list of variant titles as text for detail view. - :param title: array of the field title. + :param titles: list of title objects + :type titles: list + :return: list of variant titles as text for detail view + :rtype: list """ - return list(filter(lambda t: t.get("type") == "bf:Title", title)) + output = [] + title_variant_texts = title_variant_format_text(titles=titles, with_subtitle=True) + for title_variant_text in title_variant_texts: + value = title_variant_text.get("value") + if value not in output: + output.append(value) + return output diff --git a/rero_ils/modules/entities/remote_entities/jsonschemas/remote_entities/remote_entity-v0.0.1.json b/rero_ils/modules/entities/remote_entities/jsonschemas/remote_entities/remote_entity-v0.0.1.json index ed9e745647..62b23f9647 100644 --- a/rero_ils/modules/entities/remote_entities/jsonschemas/remote_entities/remote_entity-v0.0.1.json +++ b/rero_ils/modules/entities/remote_entities/jsonschemas/remote_entities/remote_entity-v0.0.1.json @@ -55,8 +55,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rero", @@ -94,4 +95,4 @@ "format": "date-time" } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json b/rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json index 1f8defe191..6ba5adceae 100644 --- a/rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json +++ b/rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json @@ -265,8 +265,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rdafr:1013", @@ -345,7 +346,7 @@ "validationMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -717,11 +718,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { - "selectWithSortOptions": { - "order": "label" - }, + "sort": true, "options": [ { "label": "general_note", @@ -817,11 +816,12 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "expressions": { "props.required": "model && model.holdings_type === 'serial'" }, "props": { + "sort": true, "options": [ { "label": "not_currently_received", @@ -875,8 +875,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "deposit", @@ -943,7 +944,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "wrappers": [ "form-field" ], @@ -977,8 +978,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "unknown", @@ -1038,8 +1040,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "other", @@ -1080,8 +1083,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "separate", diff --git a/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json b/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json index cfd4ba3062..8cc361fda5 100644 --- a/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json +++ b/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json @@ -92,6 +92,7 @@ "pattern": "^https://bib.rero.ch/api/patrons/.*?$", "widget": { "formlyConfig": { + "type": "remoteAutoComplete", "props": { "hideLabel": true, "validation": { @@ -99,7 +100,7 @@ "patternMessage": "Should be in the following format: https://bib.rero.ch/api/patrons/." } }, - "remoteTypeahead": { + "queryOptions": { "type": "patrons" } } @@ -344,8 +345,9 @@ "default": "public_note", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "public_note", diff --git a/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html b/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html index 40c165d49a..7247849be0 100644 --- a/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html +++ b/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html @@ -111,5 +111,4 @@ - {%- endblock body %} diff --git a/rero_ils/modules/item_types/jsonschemas/item_types/item_type-v0.0.1.json b/rero_ils/modules/item_types/jsonschemas/item_types/item_type-v0.0.1.json index 942e79abd4..f3e03020c5 100644 --- a/rero_ils/modules/item_types/jsonschemas/item_types/item_type-v0.0.1.json +++ b/rero_ils/modules/item_types/jsonschemas/item_types/item_type-v0.0.1.json @@ -73,8 +73,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "value": "standard", diff --git a/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json b/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json index 8e0d96c536..c51e5d64eb 100644 --- a/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json +++ b/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json @@ -233,7 +233,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "expressions": { "hide": "false" }, @@ -292,7 +292,7 @@ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -362,8 +362,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "received", @@ -399,7 +400,7 @@ "validationMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "expressions": { "props.required": "field?.parent?.model?.status === 'received'", "hide": "field?.parent?.model?.status !== 'received'" @@ -425,7 +426,7 @@ "validationMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -445,7 +446,7 @@ "validationMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -493,11 +494,12 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "wrappers": [ "hide" ], "props": { + "sort": true, "options": [ { "label": "on_shelf", @@ -598,8 +600,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "acquisition_note", @@ -690,7 +693,7 @@ "validationMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "hideLabel": true, "defaultValueExpression": "new Date().toISOString().split('T')[0]", @@ -737,8 +740,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "cssClass": "editor-title", "options": [ { diff --git a/rero_ils/modules/libraries/jsonschemas/libraries/library-v0.0.1.json b/rero_ils/modules/libraries/jsonschemas/libraries/library-v0.0.1.json index 4d3b1faaf3..10969c75d0 100644 --- a/rero_ils/modules/libraries/jsonschemas/libraries/library-v0.0.1.json +++ b/rero_ils/modules/libraries/jsonschemas/libraries/library-v0.0.1.json @@ -463,8 +463,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "lang_fre", @@ -541,8 +542,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "rollover_no_transfer", diff --git a/rero_ils/modules/loans/jsonschemas/loans/loan-ils-v0.0.1.json b/rero_ils/modules/loans/jsonschemas/loans/loan-ils-v0.0.1.json index 860878b342..debb962179 100644 --- a/rero_ils/modules/loans/jsonschemas/loans/loan-ils-v0.0.1.json +++ b/rero_ils/modules/loans/jsonschemas/loans/loan-ils-v0.0.1.json @@ -171,8 +171,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "CREATED", diff --git a/rero_ils/modules/patron_transactions/jsonschemas/patron_transactions/patron_transaction-v0.0.1.json b/rero_ils/modules/patron_transactions/jsonschemas/patron_transactions/patron_transaction-v0.0.1.json index fa1ac17270..bbc49731be 100644 --- a/rero_ils/modules/patron_transactions/jsonschemas/patron_transactions/patron_transaction-v0.0.1.json +++ b/rero_ils/modules/patron_transactions/jsonschemas/patron_transactions/patron_transaction-v0.0.1.json @@ -45,7 +45,10 @@ "default": "open", "widget": { "formlyConfig": { - "type": "selectWithSort" + "type": "select", + "props": { + "sort": true + } } } }, @@ -64,8 +67,9 @@ "default": "overdue", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "overdue", @@ -181,4 +185,4 @@ "title": "Total calculated amount of the patron transaction" } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json b/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json index e4a12c2aa3..30c91798a4 100644 --- a/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json +++ b/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json @@ -47,7 +47,14 @@ "items": { "title": "Local code", "type": "string", - "minLength": 1 + "minLength": 1, + "widget": { + "formlyConfig": { + "props": { + "hideLabel": true + } + } + } } }, "user_id": { @@ -57,7 +64,6 @@ "widget": { "formlyConfig": { "wrappers": [ - "form-field", "user-id" ] } @@ -200,6 +206,7 @@ "widget": { "formlyConfig": { "props": { + "hideLabel": true, "doNotSubmitOnEnter": true, "validation": { "validators": { @@ -251,7 +258,7 @@ "pattern": "\\d{4}-((0[1-9])|(1[0-2]))-(((0[1-9])|[1-2][0-9])|(3[0-1]))$", "widget": { "formlyConfig": { - "type": "datepicker", + "type": "datePicker", "props": { "validation": { "messages": { @@ -273,8 +280,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "email", @@ -312,8 +320,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "lang_fre", @@ -490,7 +499,7 @@ }, "widget": { "formlyConfig": { - "type": "multicheckbox", + "type": "multi-checkbox", "wrappers": [ "card" ], @@ -569,8 +578,9 @@ "default": "public_note", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "public_note", diff --git a/rero_ils/modules/patrons/templates/rero_ils/patron_profile.html b/rero_ils/modules/patrons/templates/rero_ils/patron_profile.html index 63f8eb3082..5620e562d7 100644 --- a/rero_ils/modules/patrons/templates/rero_ils/patron_profile.html +++ b/rero_ils/modules/patrons/templates/rero_ils/patron_profile.html @@ -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 %} - + {%- endblock body %} {%- block javascript %} diff --git a/rero_ils/modules/patrons/views.py b/rero_ils/modules/patrons/views.py index 54967e5dad..a11bdebc3f 100644 --- a/rero_ils/modules/patrons/views.py +++ b/rero_ils/modules/patrons/views.py @@ -25,7 +25,6 @@ from flask import Blueprint, abort, current_app, jsonify, render_template from flask import request as flask_request -from flask_babel import format_currency from flask_babel import lazy_gettext as _ from flask_login import current_user, login_required from flask_menu import register_menu @@ -35,14 +34,11 @@ from rero_ils.modules.decorators import ( check_logged_as_librarian, - check_logged_as_patron, check_logged_user_authentication, ) from rero_ils.modules.ill_requests.api import ILLRequestsSearch -from rero_ils.modules.items.utils import item_pid_to_object from rero_ils.modules.loans.api import get_loans_stats_by_patron_pid, get_overdue_loans from rero_ils.modules.loans.utils import sum_for_fees -from rero_ils.modules.locations.api import Location from rero_ils.modules.organisations.dumpers import OrganisationLoggedUserDumper from rero_ils.modules.patron_transactions.utils import ( get_transactions_total_amount_for_patron, @@ -166,8 +162,9 @@ def logged_user(): return jsonify(data) -@blueprint.route("//patrons/profile", methods=["GET", "POST"]) -@check_logged_as_patron +@blueprint.route("//patrons/profile/", defaults={"path": ""}) +@blueprint.route("//patrons/profile/") +@login_required @register_menu( blueprint, "settings.patron_profile", @@ -176,18 +173,17 @@ def logged_user(): id="my-profile-menu", order=-1, ) -def profile(viewcode): +def profile(viewcode, path): """Patron Profile Page.""" + if (path not in ["user/edit", "password/edit"]) and not current_patrons: + abort(401) + if (path in ["user/edit", "password/edit"]) and current_app.config.get( + "RERO_PUBLIC_USERPROFILES_READONLY" + ): + abort(401) return render_template("rero_ils/patron_profile.html", viewcode=viewcode) -@blueprint.app_template_filter("format_currency") -def format_currency_filter(value, currency): - """Format currency with current locale.""" - if value: - return format_currency(value, currency) - - @api_blueprint.route("/roles_management_permissions", methods=["GET"]) @check_logged_as_librarian def get_roles_management_permissions(): @@ -195,35 +191,6 @@ def get_roles_management_permissions(): return jsonify({"allowed_roles": get_allowed_roles_management()}) -@blueprint.app_template_filter("get_patron_from_checkout_item_pid") -def get_patron_from_checkout_item_pid(item_pid): - """Get patron from a checked out item pid.""" - from invenio_circulation.api import get_loan_for_item - - patron_pid = get_loan_for_item(item_pid_to_object(item_pid))["patron_pid"] - return Patron.get_record_by_pid(patron_pid) - - -@blueprint.app_template_filter("get_checkout_loan_for_item") -def get_checkout_loan_for_item(item_pid): - """Get patron from a checkout item pid.""" - from invenio_circulation.api import get_loan_for_item - - return get_loan_for_item(item_pid_to_object(item_pid)) - - -@blueprint.app_template_filter("get_patron_from_pid") -def get_patron_from_pid(patron_pid): - """Get patron from pid.""" - return Patron.get_record_by_pid(patron_pid) - - -@blueprint.app_template_filter("get_location_name_from_pid") -def get_location_name_from_pid(location_pid): - """Get location from pid.""" - return Location.get_record_by_pid(location_pid)["name"] - - @api_blueprint.route("//messages", methods=["GET"]) @check_logged_user_authentication def get_messages(patron_pid): @@ -237,10 +204,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) diff --git a/rero_ils/modules/stats_cfg/jsonschemas/stats_cfg/stat_cfg-v0.0.1.json b/rero_ils/modules/stats_cfg/jsonschemas/stats_cfg/stat_cfg-v0.0.1.json index 06aa9219ae..5405588a5e 100644 --- a/rero_ils/modules/stats_cfg/jsonschemas/stats_cfg/stat_cfg-v0.0.1.json +++ b/rero_ils/modules/stats_cfg/jsonschemas/stats_cfg/stat_cfg-v0.0.1.json @@ -217,7 +217,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ @@ -288,7 +288,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ @@ -359,7 +359,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ @@ -444,7 +444,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ @@ -551,7 +551,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ @@ -907,7 +907,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ @@ -982,7 +982,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ @@ -1054,7 +1054,7 @@ }, "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { "sort": false, "options": [ diff --git a/rero_ils/modules/templates/jsonschemas/templates/template-v0.0.1.json b/rero_ils/modules/templates/jsonschemas/templates/template-v0.0.1.json index c7b4c3f7dc..2fb5c584f2 100644 --- a/rero_ils/modules/templates/jsonschemas/templates/template-v0.0.1.json +++ b/rero_ils/modules/templates/jsonschemas/templates/template-v0.0.1.json @@ -88,11 +88,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { - "selectWithSortOptions": { - "order": "label" - }, + "sort": true, "options": [ { "label": "public", diff --git a/rero_ils/modules/users/jsonschemas/users/user-v0.0.1.json b/rero_ils/modules/users/jsonschemas/users/user-v0.0.1.json index 0ede19d560..d841a9808c 100644 --- a/rero_ils/modules/users/jsonschemas/users/user-v0.0.1.json +++ b/rero_ils/modules/users/jsonschemas/users/user-v0.0.1.json @@ -77,6 +77,7 @@ }, "gender": { "title": "Gender", + "type": "string", "enum": [ "male", "female", @@ -86,15 +87,16 @@ "widget": { "formlyConfig": { "props": { + "placeholder": "Select an option\u2026", "options": [ - { - "label": "male", - "value": "male" - }, { "label": "female", "value": "female" }, + { + "label": "male", + "value": "male" + }, { "label": "other", "value": "other" @@ -162,7 +164,7 @@ "widget": { "formlyConfig": { "props": { - "itemCssClass": "col-lg-12" + "itemCssClass": "col-12" } } } diff --git a/rero_ils/modules/users/templates/rero_ils/user_password.html b/rero_ils/modules/users/templates/rero_ils/user_password.html deleted file mode 100644 index f676aafaa3..0000000000 --- a/rero_ils/modules/users/templates/rero_ils/user_password.html +++ /dev/null @@ -1,29 +0,0 @@ -{# -*- coding: utf-8 -*- - - RERO ILS - Copyright (C) 2019-2022 RERO - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -#} -{% extends 'rero_ils/page.html' %} - -{%- block body %} -

{{ _('Change password') }}

- -{%- endblock body %} - -{%- block javascript %} -{{ webpack['reroils_public.js']}} -{{ node_assets('@rero/rero-ils-ui/dist/public-user-password-change', tags='type="module"') }} -{%- endblock javascript %} diff --git a/rero_ils/modules/users/templates/rero_ils/user_profile.html b/rero_ils/modules/users/templates/rero_ils/user_profile.html deleted file mode 100644 index 033b515d7a..0000000000 --- a/rero_ils/modules/users/templates/rero_ils/user_profile.html +++ /dev/null @@ -1,29 +0,0 @@ -{# -*- coding: utf-8 -*- - - RERO ILS - Copyright (C) 2019-2022 RERO - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -#} -{% extends 'rero_ils/page.html' %} - -{%- block body %} -

{{ _('Profile') }}

- -{%- endblock body %} - -{%- block javascript %} -{{ webpack['reroils_public.js']}} -{{ node_assets('@rero/rero-ils-ui/dist/public-user-profile-edit', tags='type="module"') }} -{%- endblock javascript %} diff --git a/rero_ils/modules/users/views.py b/rero_ils/modules/users/views.py index 21d882f0c1..d27a597dbb 100644 --- a/rero_ils/modules/users/views.py +++ b/rero_ils/modules/users/views.py @@ -22,7 +22,7 @@ import json from functools import wraps -from flask import Blueprint, abort, current_app, render_template, request +from flask import Blueprint, abort, current_app, request from flask_login import current_user from invenio_rest import ContentNegotiatedMethodView @@ -204,19 +204,3 @@ def post(self): template_folder="templates", static_folder="static", ) - - -@blueprint.route("//user/profile") -@check_user_readonly_permission -def profile(viewcode): - """User Profile editor Page.""" - return render_template("rero_ils/user_profile.html", viewcode=viewcode) - - -@blueprint.route("//user/password") -@check_user_readonly_permission -def password(viewcode): - """User change password Page.""" - return render_template( - "rero_ils/user_password.html", viewcode=viewcode, current_user=current_user - ) diff --git a/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json b/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json index 00621448b5..df10eb3a9d 100644 --- a/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json +++ b/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json @@ -108,8 +108,9 @@ "default": "general_note", "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "label": "order_note", @@ -202,8 +203,9 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "options": [ { "value": "fre", @@ -263,12 +265,10 @@ ], "widget": { "formlyConfig": { - "type": "selectWithSort", + "type": "select", "props": { + "sort": true, "itemCssClass": "col-lg-12", - "selectWithSortOptions": { - "order": "label" - }, "options": [ { "value": "default", diff --git a/rero_ils/theme/assets/scss/rero_ils/babeltheque.scss b/rero_ils/theme/assets/scss/rero_ils/babeltheque.scss index b938f4b0cd..a3479164db 100644 --- a/rero_ils/theme/assets/scss/rero_ils/babeltheque.scss +++ b/rero_ils/theme/assets/scss/rero_ils/babeltheque.scss @@ -16,116 +16,117 @@ along with this program. If not, see . */ - -#BW_suggestions, -#BW_notes, -#BW_etiquettes, -#BW_prix_litt, -#BW_critiques, -#BW_critiques_pro, -#BW_citations, -#BW_bio_auteur, -#BW_videos, -#BW_podcasts { - margin-top: 16px; - padding: 0 !important; -} - -#BW_notes img { - margin-bottom: 6px; -} - -#BW_etiquettes h2, -.BW_critiques_opac_add, -.BW_citations_opac_add { - display: none; -} - -#BW_ulEti { - display: flex; - gap: 6px; - align-items: center; - justify-content: center; - flex-wrap: wrap; - padding-inline-start: 0; - max-width: 400px !important; -} - -#BW_ulEti ol { - padding-inline-start: 0; - text-transform: lowercase; -} - -#BW_ulEti a.tag_s0 { - font-weight: 120; - font-size: 0.8em; -} -#BW_ulEti a.tag_s1 { - font-weight: 150; - font-size: 0.9em; -} -#BW_ulEti a.tag_s2 { - font-weight: 180; - font-size: 1.0em; -} -#BW_ulEti a.tag_s3 { - font-weight: 200; - font-size: 1.2em; -} -#BW_ulEti a.tag_s4 { - font-weight: 220; - font-size: 1.4em; -} -#BW_ulEti a.tag_s5 { - font-weight: 230; - font-size: 1.5em; -} -#BW_ulEti a.tag_s6 { - font-weight: 320; - font-size: 1.6em; -} -#BW_ulEti a.tag_s7 { - font-weight: 350; - font-size: 1.7em; -} -#BW_ulEti a.tag_s8 { - font-weight: 400; - font-size: 1.8em; -} - -.babelio-block, -.bw_list_recos { - display: flex; - flex-wrap: wrap; - gap: 20px; -} - -.babelio-block div, -.bw_list_recos div { - flex-grow: 1; -} - -.babelio-block div:empty, -.BW_critiques_OPAC { - display: none; -} - -#BW_prix_litt ul { - list-style: none; - padding-inline-start: 0; - flex-wrap: wrap; -} - -#BW_bio_titre, -.bw_h2 { - font-size: 1.3em; -} - -.BW_couv_suggestions { - max-height: 140px; - max-width: 100px; -} - -.bw_boxclose { - color: white !important; +@layer babel { + #BW_suggestions, + #BW_notes, + #BW_etiquettes, + #BW_prix_litt, + #BW_critiques, + #BW_critiques_pro, + #BW_citations, + #BW_bio_auteur, + #BW_videos, + #BW_podcasts { + margin-top: 16px; + padding: 0 !important; + } + + #BW_notes img { + margin-bottom: 6px; + } + + #BW_etiquettes h2, + .BW_critiques_opac_add, + .BW_citations_opac_add { + display: none; + } + + #BW_ulEti { + display: flex; + gap: 6px; + align-items: center; + justify-content: center; + flex-wrap: wrap; + padding-inline-start: 0; + max-width: 400px !important; + } + + #BW_ulEti ol { + padding-inline-start: 0; + text-transform: lowercase; + } + + #BW_ulEti a.tag_s0 { + font-weight: 120; + font-size: 0.8em; + } + #BW_ulEti a.tag_s1 { + font-weight: 150; + font-size: 0.9em; + } + #BW_ulEti a.tag_s2 { + font-weight: 180; + font-size: 1em; + } + #BW_ulEti a.tag_s3 { + font-weight: 200; + font-size: 1.2em; + } + #BW_ulEti a.tag_s4 { + font-weight: 220; + font-size: 1.4em; + } + #BW_ulEti a.tag_s5 { + font-weight: 230; + font-size: 1.5em; + } + #BW_ulEti a.tag_s6 { + font-weight: 320; + font-size: 1.6em; + } + #BW_ulEti a.tag_s7 { + font-weight: 350; + font-size: 1.7em; + } + #BW_ulEti a.tag_s8 { + font-weight: 400; + font-size: 1.8em; + } + + .babelio-block, + .bw_list_recos { + display: flex; + flex-wrap: wrap; + gap: 20px; + } + + .babelio-block div, + .bw_list_recos div { + flex-grow: 1; + } + + .babelio-block div:empty, + .BW_critiques_OPAC { + display: none; + } + + #BW_prix_litt ul { + list-style: none; + padding-inline-start: 0; + flex-wrap: wrap; + } + + #BW_bio_titre, + .bw_h2 { + font-size: 1.3em !important; + } + + .BW_couv_suggestions { + max-height: 140px; + max-width: 100px; + } + + .bw_boxclose { + color: white !important; + } } diff --git a/rero_ils/theme/assets/scss/rero_ils/styles.scss b/rero_ils/theme/assets/scss/rero_ils/styles.scss index 0aa8b4ceda..09a0b95f37 100644 --- a/rero_ils/theme/assets/scss/rero_ils/styles.scss +++ b/rero_ils/theme/assets/scss/rero_ils/styles.scss @@ -17,78 +17,88 @@ along with this program. If not, see . */ +:root { + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, + "Helvetica Neue", Helvetica, Arial, sans-serif; + --font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", + Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 1rem; +} -@import "variables"; - -// Setting the path to fonts files. $fa-font-path: "~font-awesome/fonts"; $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; -@import '~bootstrap/scss/bootstrap'; @import "~font-awesome/scss/font-awesome"; -// general styles -@import "page"; -@import "header"; -@import "footer"; -@import "search"; -@import "frontpage"; -@import "thumbnail"; +@layer bootstrap, babel, primeng, rero-ils-ui; -// modules -@import "contributions/detailed"; -@import "patrons/profile"; -@import "documents/detailed"; +@layer bootstrap { + @import "variables"; -// bootstrap extension + // Setting the path to fonts files. + @import "~bootstrap/scss/bootstrap"; -.mw-25 { - max-width: 25%; -} + // general styles + @import "page"; + @import "header"; + @import "footer"; + @import "search"; + @import "frontpage"; + @import "thumbnail"; -.mw-50 { - max-width: 50%; -} + // modules + @import "contributions/detailed"; + @import "patrons/profile"; + @import "documents/detailed"; -.mw-75 { - max-width: 75%; -} + // bootstrap extension -// cover -.rero-ils-cover-logo { - width: 10em; -} + .mw-25 { + max-width: 25%; + } -// CSS code to allow `ng-csp="no-inline-css"` -[ng\:cloak], -[ng-cloak], -[data-ng-cloak], -[x-ng-cloak], -.ng-cloak, -.x-ng-cloak, -.ng-hide:not(.ng-hide-animate) { - display: none !important; -} + .mw-50 { + max-width: 50%; + } -ng\:form { - display: block; -} + .mw-75 { + max-width: 75%; + } -.ng-animate-shim { - visibility:hidden; -} + // cover + .rero-ils-cover-logo { + width: 10em; + } -.ng-anchor { - position:absolute; -} + // CSS code to allow `ng-csp="no-inline-css"` + [ng\:cloak], + [ng-cloak], + [data-ng-cloak], + [x-ng-cloak], + .ng-cloak, + .x-ng-cloak, + .ng-hide:not(.ng-hide-animate) { + display: none !important; + } + ng\:form { + display: block; + } -// TODO: to correct a display bug with webkit browsers + .ng-animate-shim { + visibility: hidden; + } -html [type=button] { - -webkit-appearance: none; -} + .ng-anchor { + position: absolute; + } -/* + // TODO: to correct a display bug with webkit browsers + + html [type="button"] { + -webkit-appearance: none; + } + + /* ********************************* GLOBAL @@ -96,40 +106,40 @@ html [type=button] { ******************************** */ -.rero-ils-external-link:after { - font-family: 'FontAwesome'; - font-size: $font-size-very-small; - vertical-align: top; - content: " \f08e"; -} - -.required::after { - content: " *"; - color: $red; - font-weight: bold; -} - -.no-data { - color: $secondary; -} - -button:disabled { - pointer-events: none; -} - -div.tooltip div.tooltip-inner{ - text-align: left; - max-width: 400px; -} - -.rero-ils-external-link:after { - font-family: 'FontAwesome'; - font-size: $font-size-very-small; - vertical-align: top; - content: " \f08e"; -} - -/* + .rero-ils-external-link:after { + font-family: "FontAwesome"; + font-size: $font-size-very-small; + vertical-align: top; + content: " \f08e"; + } + + .required::after { + content: " *"; + color: $red; + font-weight: bold; + } + + .no-data { + color: $secondary; + } + + button:disabled { + pointer-events: none; + } + + div.tooltip div.tooltip-inner { + text-align: left; + max-width: 400px; + } + + .rero-ils-external-link:after { + font-family: "FontAwesome"; + font-size: $font-size-very-small; + vertical-align: top; + content: " \f08e"; + } + + /* ********************************* TOAST @@ -137,59 +147,60 @@ div.tooltip div.tooltip-inner{ ******************************** */ -.toast { - min-width: 350px; -} - -.toast-container { - position: fixed; - z-index: 9999999; - top: 0; - right: 0; -} - -.toast-top-right { - top: 12px; - right: 24px; -} - -.toast-success .toast-body { - background-color: $green; - color: white; -} - -.toast-warning .toast-body { - background-color: $orange; - color: white; -} - -.toast-error .toast-body, -.toast-danger .toast-body { - background-color: $red; - color: white; -} - - -/* + .toast { + min-width: 350px; + } + + .toast-container { + position: fixed; + z-index: 9999999; + top: 0; + right: 0; + } + + .toast-top-right { + top: 12px; + right: 24px; + } + + .toast-success .toast-body { + background-color: $green; + color: white; + } + + .toast-warning .toast-body { + background-color: $orange; + color: white; + } + + .toast-error .toast-body, + .toast-danger .toast-body { + background-color: $red; + color: white; + } + + /* ********************************* BUTTON ******************************** */ -.btn-mini { - padding: .25rem .35rem .25rem .45rem; - font-size: .875rem; - line-height: 1.3; - border-radius: .2rem; -} - -.btn:focus, .btn:active:focus, .btn.active:focus { - outline:none; - box-shadow:none; -} - - -#password-show-hide-icon:hover { - cursor: pointer; + .btn-mini { + padding: 0.25rem 0.35rem 0.25rem 0.45rem; + font-size: 0.875rem; + line-height: 1.3; + border-radius: 0.2rem; + } + + .btn:focus, + .btn:active:focus, + .btn.active:focus { + outline: none; + box-shadow: none; + } + + #password-show-hide-icon:hover { + cursor: pointer; + } } diff --git a/rero_ils/theme/menus.py b/rero_ils/theme/menus.py index 494b2f29b4..5243b6e1ab 100644 --- a/rero_ils/theme/menus.py +++ b/rero_ils/theme/menus.py @@ -306,7 +306,7 @@ def is_not_read_only(): item = current_menu.submenu("main.profile.edit_profile") rero_register( item, - endpoint="users.profile", + external_url=f"/{viewcode}/patrons/profile/user/edit", endpoint_arguments_constructor=lambda: dict( viewcode=request.view_args.get( "viewcode", current_app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE") @@ -321,7 +321,7 @@ def is_not_read_only(): item = current_menu.submenu("main.profile.change_password") rero_register( item, - endpoint="users.password", + external_url=f"/{viewcode}/patrons/profile/password/edit", endpoint_arguments_constructor=lambda: dict( viewcode=request.view_args.get( "viewcode", current_app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE") diff --git a/rero_ils/theme/templates/rero_ils/frontpage.html b/rero_ils/theme/templates/rero_ils/frontpage.html index 4bed45dc7b..c9d23b39f7 100644 --- a/rero_ils/theme/templates/rero_ils/frontpage.html +++ b/rero_ils/theme/templates/rero_ils/frontpage.html @@ -36,21 +36,14 @@