rdrew 3 days ago
parent
commit
d869b7a91f
  1. 22
      css/components/islandora_mods.css
  2. 45
      js/custom.js
  3. 1
      olivesnews.libraries.yml
  4. 56
      templates/field/field--node--field-contributor-details--islandora-object.html.twig

22
css/components/islandora_mods.css

@ -89,6 +89,28 @@ div#block-olivesnews-content .view-header {
.facets-widget-links ul span.facet-item__count {
font-weight: 600;
}
.facets-widget-range_nouislider ul {
list-style-type: none;
margin: 0;
}
.facets-widget-range_nouislider .facet-slider {margin: 60px 14px 0;}
.facets-widget-range_nouislider .js-form-type-textfield {
display: flex;
/* width: 100%; */
}
.facets-widget-range_nouislider label.form-item__label {
width: 3em;
}
.facets-widget-range_nouislider .noUi-tooltip {
border: 1px solid #8196a2;
}
.facets-widget-range_nouislider .noUi-connect {
background: #691803;
}
/* ============================================================
SITE HEADER

45
js/custom.js

@ -1,39 +1,20 @@
(function (Drupal) {
//stuff goes here
window.onload = function() {
var inputField = document.getElementById('nouislider-input-from');
var str = inputField.value.toString();
str = str.slice(0, -3);
str = parseInt(str);
inputField.value = str;
var inputField = document.getElementById('nouislider-input-to');
var str = inputField.value.toString();
str = str.slice(0, -3);
str = parseInt(str);
inputField.value = str;
};
})(Drupal);
(function (Drupal) {
Drupal.behaviors.LangSwitchBehavior = {
attach: function (context, settings) {
const textEn = context.querySelector('#text-en');
const textFr = context.querySelector('#text-fr');
const showEn = context.querySelector('#show-text-en');
const showFr = context.querySelector('#show-text-fr');
// Hide French text initially
if (textFr) {
textFr.style.display = 'none';
}
if (showEn && textEn && textFr) {
showEn.addEventListener('click', function (e) {
e.preventDefault();
textEn.style.display = '';
textFr.style.display = 'none';
});
}
if (showFr && textEn && textFr) {
showFr.addEventListener('click', function (e) {
e.preventDefault();
textEn.style.display = 'none';
textFr.style.display = '';
});
}
}
};
})(Drupal);
//(function (Drupal, once) {

1
olivesnews.libraries.yml

@ -57,6 +57,7 @@ global-styling:
js:
js/checkbox.js: {}
js/custom.js: {}
dependencies:
- core/drupal

56
templates/field/field--node--field-contributor-details--islandora-object.html.twig

@ -1,42 +1,3 @@
{#
/**
* @file
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
*
* @see template_preprocess_field()
*/
#}
{%
set classes = [
'field',
@ -53,29 +14,18 @@
]
%}
{% if label_hidden %}
{% if multiple %}
<div{{ attributes.addClass(classes, 'field__items') }}>
{% for item in items %}
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
{% endfor %}
</div>
{% else %}
{% for item in items %}
<div{{ attributes.addClass(classes, 'field__item') }}>{{ item.content }}</div>
{% endfor %}
{% endif %}
{% else %}
<div{{ attributes.addClass(classes) }}>
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% if multiple %}
<div class="field__items">
{% endif %}
{% for item in items %}
<details>
<summary>Show Contibutor Details</summary>
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
</details>
{% endfor %}
{% if multiple %}
</div>
{% endif %}
</div>
{% endif %}

Loading…
Cancel
Save