From 6dce0f7cb84d5c8466dff9e97cbb27360e3c3e2f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 3 Mar 2023 15:59:42 +0000 Subject: [PATCH] tabs --- css-tweaks.css | 61 ++++++-- js/rdm.js | 35 +++-- .../node--islandora-rdm-dataset.html.twig | 134 ++++++++++++++++++ 3 files changed, 207 insertions(+), 23 deletions(-) create mode 100644 templates/content/node--islandora-rdm-dataset.html.twig diff --git a/css-tweaks.css b/css-tweaks.css index 89136d2..f77321c 100644 --- a/css-tweaks.css +++ b/css-tweaks.css @@ -7,27 +7,62 @@ } div#block-homepagewelcome-2, #block-exposedformdataset-searchpage-1 { - color: #fff !important; - padding: 4rem 0; - background: #789d4a; + color: #fff !important; + padding: 4rem 0; + background: #789d4a; } #block-exposedformdataset-searchpage-1 label { display:none; } div#block-homepagewelcome-2 a { - color: var(--upei-red); } +color: var(--upei-red); } div#block-homepagewelcome-2 h2, div#block-homepagewelcome-2 p { - color: #fff !important; } +color: #fff !important; } - input#edit-search-api-fulltext--2 { - width: 100%; - height: 50px; - } +input#edit-search-api-fulltext--2 { + width: 100%; + height: 50px; +} + +.js-form-item.form-item.js-form-type-textfield.form-item-search-api-fulltext.js-form-item-search-api-fulltext { + width: 600px; + /* height: 54px; */ +} +/* Style the tab */ +.tab { + overflow: hidden; + border: 1px solid #ccc; + background-color: #f1f1f1; +} + +/* Style the buttons that are used to open the tab content */ +.tab button { + background-color: inherit; + float: left; + border: none; + outline: none; + cursor: pointer; + padding: 14px 16px; + transition: 0.3s; +} - .js-form-item.form-item.js-form-type-textfield.form-item-search-api-fulltext.js-form-item-search-api-fulltext { - width: 600px; - /* height: 54px; */ - } +/* Change background color of buttons on hover */ +.tab button:hover { + background-color: #ddd; +} + +/* Create an active/current tablink class */ +.tab button.active { + background-color: #ccc; +} + +/* Style the tab content */ +.tabcontent { + display: none; + padding: 6px 12px; + border: 1px solid #ccc; + border-top: none; +} diff --git a/js/rdm.js b/js/rdm.js index 331d149..627eacc 100644 --- a/js/rdm.js +++ b/js/rdm.js @@ -1,21 +1,36 @@ /* Load jQuery. --------------------------*/ jQuery(document).ready(function ($) { - // Homepage blocks - $(".region-content-home-top .block, .region-content-home-bottom .block").wrapInner( '
' ); -/* $('.accordion_block').accordionjs({ + Drupal.behaviors.nodeTabs = { + attach: function (context, settings) { + // your custom javascript goes inside this function... + function openCity(cityName) { + var i; + var x = document.getElementsByClassName("city"); + for (i = 0; i < x.length; i++) { + x[i].style.display = "none"; + } + document.getElementById(cityName).style.display = "block"; + } + } + }; + + // Homepage blocks + $(".region-content-home-top .block, .region-content-home-bottom .block").wrapInner( '
' ); + + /* $('.accordion_block').accordionjs({ activeIndex: false, }); -*/ + */ $(".views-field-search-api-rendered-item span").each(function() { - var html = $(this).html(); - html = html.replace(". . ", ". "); - $(this).html(html); + var html = $(this).html(); + html = html.replace(". . ", ". "); + $(this).html(html); }); - //$('.views-field-search-api-rendered-item:contains(". . ")').text('. '); + //$('.views-field-search-api-rendered-item:contains(". . ")').text('. '); // $('p:contains("dogsss")').text('dollsss'); - -/* End document + + /* End document --------------------------*/ }); diff --git a/templates/content/node--islandora-rdm-dataset.html.twig b/templates/content/node--islandora-rdm-dataset.html.twig new file mode 100644 index 0000000..ff20eeb --- /dev/null +++ b/templates/content/node--islandora-rdm-dataset.html.twig @@ -0,0 +1,134 @@ +{% +set node_classes = [ + 'node', + node.isPromoted() ? 'node-promoted', + node.isSticky() ? 'node-sticky', + not node.isPublished() ? 'node-unpublished', + view_mode ? 'node-view-mode-' ~ view_mode|clean_class, +] +%} + +{{ title_prefix }} + {% if not page %} + + {{ label }} + + {% endif %} +{{ title_suffix }} + +{% if display_submitted %} +
+ {% if node_author_pic %} +
{{ author_picture }}
+ {% endif %} + + {% set createdDate = node.getCreatedTime|date('j F Y') %} + {% trans %} {{ author_name }} {{ createdDate }}{% endtrans %} + {% if node_tags %} + {% if content.field_tags %} + + {% for item in content.field_tags %} + {% if item['#title'] %} + {{ item['#title'] }}{{ ',' }} + {% endif %} + {% endfor %} + + {% endif %} + {% endif %} + {{ metadata }} + +
+{% endif %} + +
+

Rob's dummy content

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+

London

+

London is the capital city of England.

+
+ +
+

Paris

+

Paris is the capital of France.

+
+ +
+

Tokyo

+

Tokyo is the capital of Japan.

+
+ + + {{ content.field_rdm_creator }} + {{ content.field_rdm_organization_name }} +
+ + {{ content }} + + +