From eb0e8a4aa7a13431691d1c92669ba7289b02352b Mon Sep 17 00:00:00 2001 From: j Date: Mon, 26 Feb 2024 12:14:42 +0000 Subject: [PATCH] update document metadata --- config.jsonc | 125 +++++++++++++++++++++++++++-- static/js/documentsInfoView.amp.js | 93 ++++++++++++++++++++- 2 files changed, 211 insertions(+), 7 deletions(-) diff --git a/config.jsonc b/config.jsonc index 5875088..9c8de55 100644 --- a/config.jsonc +++ b/config.jsonc @@ -163,9 +163,9 @@ "columnWidth": 256 }, { - "id": "type", + "id": "format", "operator": "+", - "title": "Type", + "title": "Format", "type": "string", "filter": true, "find": true, @@ -173,6 +173,17 @@ "autocomplete": true, "columnWidth": 128 }, + { + "id": "publication", + "operator": "+", + "title": "Publication", + "type": "string", + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, { "id": "author", "operator": "+", @@ -185,6 +196,17 @@ "autocomplete": true, "columnWidth": 256 }, + { + "id": "group", + "operator": "+", + "title": "Group", + "type": "string", + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, { "id": "publisher", "operator": "+", @@ -196,6 +218,24 @@ "autocomplete": true, "columnWidth": 256 }, + { + "id": "source", + "operator": "+", + "title": "Source", + "type": "string", + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, + { + "id": "links", + "title": "Links", + "type": ["string"], + "columnWidth": 180, + "find": true + }, { "id": "place", "title": "Place", @@ -205,6 +245,15 @@ "find": true, "sort": true }, + { + "id": "space", + "title": "Space", + "type": ["string"], + "columnWidth": 128, + "filter": true, + "find": true, + "sort": true + }, { "id": "date", "title": "Date", @@ -223,11 +272,21 @@ "sort": true }, { - "id": "edition", - "title": "Edition", + "id": "volume", + "title": "Volume", "type": "string", "columnWidth": 128, - "find": true + "find": true, + "additionalSort": [{"key": "issue", "operator": "-"}], + "sort": true + }, + { + "id": "issue", + "title": "Issue", + "type": "string", + "columnWidth": 128, + "find": true, + "sort": true }, { "id": "language", @@ -238,6 +297,61 @@ "find": true, "sort": true }, + { + "id": "movement", + "operator": "+", + "title": "Social Movements", + "type": ["string"], + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, + { + "id": "event", + "operator": "+", + "title": "Events", + "type": ["string"], + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, + { + "id": "associatedgroups", + "operator": "+", + "title": "Associated groups", + "type": ["string"], + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, + { + "id": "relatedpeople", + "operator": "+", + "title": "Related people", + "type": ["string"], + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, + { + "id": "tags", + "operator": "+", + "title": "Tags", + "type": ["string"], + "filter": true, + "find": true, + "sort": true, + "autocomplete": true, + "columnWidth": 256 + }, { "id": "id", "operator": "+", @@ -516,6 +630,7 @@ "id": "year", "title": "Year", "type": "string", + "additionalSort": [{"key": "date", "operator": "+"}], "autocomplete": true, "columnWidth": 60, "filter": true, diff --git a/static/js/documentsInfoView.amp.js b/static/js/documentsInfoView.amp.js index 0cc00b4..24e2c53 100644 --- a/static/js/documentsInfoView.amp.js +++ b/static/js/documentsInfoView.amp.js @@ -202,6 +202,87 @@ pandora.ui.documentInfoView = function(data, isMixed) { pandora.createLinks($info); } + // Group & Publication description ----------------------------------------------------- + if (!isMultiple) { + ;['group', 'publication'].forEach(key => { + var $box = $('
').appendTo($data); + (data[key] ? pandora.api.findEntities : Ox.noop)({ + query: { + conditions: [{ + key: 'type', operator: '==', value: Ox.decodeHTMLEntities(key) + }, { + key: 'name', operator: '==', value: Ox.decodeHTMLEntities(data[key] || '') + }], + operator: '&' + }, + keys: ['id', 'name', 'description'] + }, function(result) { + if (data[key] && ((result && result.data.items.length == 1) || canEdit)) { + var entity = {} + if (result && result.data.items.length) { + entity = result.data.items[0] + } + $('
') + .html(Ox._('About {0}:', [data[key]])) + .css({ + 'padding-top': '4px', + 'font-weight': 'bold' + }) + .appendTo($box); + $('
') + .append( + Ox.EditableContent({ + clickLink: pandora.clickLink, + editable: false, + format: function(value) { + return value.replace( + /') @@ -229,8 +310,16 @@ pandora.ui.documentInfoView = function(data, isMixed) { // Director, Year and Country ---------------------------------------------- - renderGroup(['author', 'date', 'type']); - renderGroup(['publisher', 'place', 'series', 'edition', 'language']); + renderGroup(['group', 'author']); + renderGroup(['publication']); + renderGroup(['date', 'format', 'language']); + renderGroup(['publisher', 'series', 'volume', 'issue']); + renderGroup(['source', 'links']); + renderGroup(['place', 'space']); + + renderGroup(['movement', 'event']); + renderGroup(['associatedgroups', 'relatedpeople']); + renderGroup(['tags']); // Description -------------------------------------------------------------