diff --git a/configuration/views.view.nb_bibliography_contributors.yml b/configuration/views.view.nb_bibliography_contributors.yml index 0a8b63b7..2e28b68e 100644 --- a/configuration/views.view.nb_bibliography_contributors.yml +++ b/configuration/views.view.nb_bibliography_contributors.yml @@ -333,7 +333,12 @@ display: contextual_filters_or: false relationships: { } header: { } - footer: { } + footer: + area_text_custom: + id: area_text_custom + table: views + field: area_text_custom + plugin_id: text_custom display_extenders: { } cache_metadata: max-age: -1 @@ -1175,8 +1180,8 @@ display: label: '' exclude: true alter: - alter_text: false - text: '' + alter_text: true + text: "{% if name__value|slice(-1, 1) == \".\" %}\r\n{{ name__value[:-1] }}\r\n{% endif %}\r\n{% if name__value|slice(-1, 1) != \".\" %}\r\n{{ name__value }}\r\n{% endif %}\r\n" make_link: false path: '' absolute: false @@ -1292,7 +1297,7 @@ display: exclude: false alter: alter_text: true - text: "\"{{ name }}.\" Tide & Time: A New Brunswick Bibliography, UNB Libraries, {{ view_yabrm_contributor }}, Accessed on {{ drupal_token('date:custom:d') }} {{ drupal_token('date:custom:F') }} {{ drupal_token('date:custom:Y') }}." + text: "\"{{ name|trim }}.\" {{ 'Tide & Time: A New Brunswick Bibliography' }}, UNB Libraries, {{ view_yabrm_contributor }}, accessed on {{ drupal_token('date:custom:d') }} {{ drupal_token('date:custom:F') }} {{ drupal_token('date:custom:Y') }}." make_link: false path: '' absolute: false @@ -1336,6 +1341,7 @@ display: cache: type: none options: { } + empty: { } sorts: { } arguments: id: @@ -1379,6 +1385,7 @@ display: operator: AND groups: { } defaults: + empty: false cache: false title: false use_ajax: false @@ -1388,8 +1395,34 @@ display: arguments: false filters: false filter_groups: false + header: false + footer: false use_ajax: true display_description: '' + header: + area_text_custom: + id: area_text_custom + table: views + field: area_text_custom + relationship: none + group_type: group + admin_label: '' + plugin_id: text_custom + empty: false + content: "
Copied the citation to clipboard.
\r\n
Copied the citation to clipboard.
" + tokenize: false + footer: + area_text_custom: + id: area_text_custom + table: views + field: area_text_custom + relationship: none + group_type: group + admin_label: '' + plugin_id: text_custom + empty: false + content: "Note:\r\n

This citation uses a modified MLA (Modern Language Association) style.

\r\nCopy citation" + tokenize: false display_extenders: { } path: cite/contributor/%id cache_metadata: diff --git a/custom/modules/nbbib_core/js/cite_copy.js b/custom/modules/nbbib_core/js/cite_copy.js index 91096d93..d4d57572 100644 --- a/custom/modules/nbbib_core/js/cite_copy.js +++ b/custom/modules/nbbib_core/js/cite_copy.js @@ -13,12 +13,13 @@ // Transcription copy button. $('#cite').click(function() { // Copy html, convert to string,remove tags, replace breaks with spaces. - navigator.clipboard.writeText($('.views-field-bibliographic-citation > .field-content') + navigator.clipboard.writeText($('#drupal-modal .views-field > .field-content') .html() .toString() .replace(/<\/?[^>]+>/gi, '') .replace(/\n/g, ' ') .replace(/\s+/g, ' ') + .replace('&', '&') .trim()).then( function() { // Clipboard successfully set. diff --git a/custom/modules/nbbib_core/nbbib_core.module b/custom/modules/nbbib_core/nbbib_core.module index cd046749..e935f894 100644 --- a/custom/modules/nbbib_core/nbbib_core.module +++ b/custom/modules/nbbib_core/nbbib_core.module @@ -1292,7 +1292,12 @@ function reindex_collection_refs($cid) { * Implements hook_views_pre_render(). */ function nbbib_core_views_pre_render($view) { - if (isset($view) && $view->id() == 'nb_bibliography_citations') { + $cite_views = [ + 'nb_bibliography_citations', + 'nb_bibliography_contributors', + ]; + + if (isset($view) and in_array($view->id(), $cite_views)) { // Attach citation button library. $view->element['#attached']['library'][] = 'nbbib_core/cite-copy'; // Include current facets in view title. diff --git a/custom/themes/bs5_nbbib_lib_unb_ca/src/scss/style.scss b/custom/themes/bs5_nbbib_lib_unb_ca/src/scss/style.scss index 3fb614a3..a1211570 100644 --- a/custom/themes/bs5_nbbib_lib_unb_ca/src/scss/style.scss +++ b/custom/themes/bs5_nbbib_lib_unb_ca/src/scss/style.scss @@ -96,9 +96,12 @@ html { svg { display: none; } - .search-result { + .view-content { margin: 1rem 0 2rem 0; - .views-field-bibliographic-citation { + li { + margin: 0 !important; + } + .views-field { padding-left: 1rem; border-left: 1px solid $base-200; }