commit d14148e6cb7cb25e9d0f4fb9cb1c3293c359ac64 Author: rdrew Date: Wed Sep 20 12:47:28 2023 -0300 1st diff --git a/README.md b/README.md new file mode 100644 index 0000000..7024d8b --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +islandscholar theme, generated from starterkit_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme). \ No newline at end of file diff --git a/config.yml b/config.yml new file mode 100755 index 0000000..6d3ee50 --- /dev/null +++ b/config.yml @@ -0,0 +1,44 @@ +SITE: + Local: + Url: 'https://d10_dev.lndo.site/' + Remote: + Url: 'https://library.upei.ca/' + Path: user +PORT: 8000 +BSREWRITE: + Css: + + Match: '/themes/custom/roblib_2023/css/global-style.css' + Replace: '/css/global-style.css' + Js: + Match: "/themes/custom/roblib_2023/js/custom_js.js" + Replace: "/js/custom_js.js" +PATHS: + Watch: + #changes in these compiled files trigged reload + - ./css/*.css + - ./js/*.js + Scss: + Dir: ./css/sass + Libraries: + #- libraries/guff + #- bower_components/foundation-sites/scss + #- bower_components/motion-ui/src + - node_modules/modularscale-sass/stylesheets + #- node_modules/vanilla-framework/scss + - node_modules/foundation-sites/scss + - node_modules/foundation-sites/scss/util + - node_modules/motion-ui/src + - icons/fontawesome/scss + - node_modules + Css: + Dir: css + #FileName: app.css + Js: + Src: ./js/src/*.js + Dest: js + FileName: 'ia-islandimagined.behaviors.js' + Img: + Src: img/src + Dest: img + diff --git a/css/components/action-links.css b/css/components/action-links.css new file mode 100644 index 0000000..274d798 --- /dev/null +++ b/css/components/action-links.css @@ -0,0 +1,43 @@ +/** + * @file + * Styles for link buttons and action links. + */ + +.action-links { + margin: 1em 0; + padding: 0; + list-style: none; +} +[dir="rtl"] .action-links { + /* This is required to win over specificity of [dir="rtl"] ul */ + margin-right: 0; +} +.action-links li { + display: inline-block; + margin: 0 0.3em; +} +.action-links li:first-child { + margin-left: 0; /* LTR */ +} +[dir="rtl"] .action-links li:first-child { + margin-right: 0; + margin-left: 0.3em; +} +.button-action { + display: inline-block; + padding: 0.2em 0.5em 0.3em; + text-decoration: none; + line-height: 160%; +} +.button-action:before { + margin-left: -0.1em; /* LTR */ + padding-right: 0.2em; /* LTR */ + content: "+"; + font-weight: 900; +} +[dir="rtl"] .button-action:before { + margin-right: -0.1em; + margin-left: 0; + padding-right: 0; + padding-left: 0.2em; +} diff --git a/css/components/breadcrumb.css b/css/components/breadcrumb.css new file mode 100644 index 0000000..1e6a7fa --- /dev/null +++ b/css/components/breadcrumb.css @@ -0,0 +1,29 @@ +/** + * @file + * Styles for breadcrumbs. + */ + +.breadcrumb { + padding-bottom: 0.5em; +} +.breadcrumb ol { + margin: 0; + padding: 0; +} +[dir="rtl"] .breadcrumb ol { + /* This is required to win over specificity of [dir="rtl"] ol */ + margin-right: 0; +} +.breadcrumb li { + display: inline; + margin: 0; + padding: 0; + list-style-type: none; +} +/* IE8 does not support :not() and :last-child. */ +.breadcrumb li:before { + content: " \BB "; +} +.breadcrumb li:first-child:before { + content: none; +} diff --git a/css/components/button.css b/css/components/button.css new file mode 100644 index 0000000..5eb4f1a --- /dev/null +++ b/css/components/button.css @@ -0,0 +1,15 @@ +/** + * @file + * Visual styles for buttons. + */ + +.button, +.image-button { + margin-right: 1em; + margin-left: 1em; +} +.button:first-child, +.image-button:first-child { + margin-right: 0; + margin-left: 0; +} diff --git a/css/components/container-inline.css b/css/components/container-inline.css new file mode 100644 index 0000000..64b78f6 --- /dev/null +++ b/css/components/container-inline.css @@ -0,0 +1,22 @@ +/** + * @file + * Inline items. + */ + +.container-inline label:after, +.container-inline .label:after { + content: ":"; +} +.form-type-radios .container-inline label:after, +.form-type-checkboxes .container-inline label:after { + content: ""; +} +.form-type-radios .container-inline .form-type-radio, +.form-type-checkboxes .container-inline .form-type-checkbox { + margin: 0 1em; +} +.container-inline .form-actions, +.container-inline.form-actions { + margin-top: 0; + margin-bottom: 0; +} diff --git a/css/components/details.css b/css/components/details.css new file mode 100644 index 0000000..a546363 --- /dev/null +++ b/css/components/details.css @@ -0,0 +1,23 @@ +/** + * @file + * Collapsible details. + * + * @see collapse.js + * @see http://nicolasgallagher.com/css-background-image-hacks/ + */ + +details { + margin-top: 1em; + margin-bottom: 1em; + border: 1px solid #ccc; +} +details > .details-wrapper { + padding: 0.5em 1.5em; +} +/* @todo Regression: The summary of uncollapsible details are no longer + vertically aligned with the .details-wrapper in browsers without native + details support. */ +summary { + padding: 0.2em 0.5em; + cursor: pointer; +} diff --git a/css/components/dialog.css b/css/components/dialog.css new file mode 100644 index 0000000..16e1770 --- /dev/null +++ b/css/components/dialog.css @@ -0,0 +1,72 @@ +/** + * @file + * Presentational styles for Drupal dialogs. + */ + +.ui-dialog { + position: absolute; + z-index: 1260; + overflow: visible; + padding: 0; + color: #000; + border: solid 1px #ccc; + background: #fff; +} + +@media all and (max-width: 48em) { /* 768px */ + .ui-dialog { + width: 92% !important; + } +} +.ui-dialog .ui-dialog-titlebar { + border-width: 0 0 1px 0; + border-style: solid; + border-color: #ccc; + border-radius: 0; + background: #f3f4ee; + font-weight: bold; +} +.ui-dialog .ui-dialog-titlebar-close { + border: 0; + background: none; +} +.ui-dialog .ui-dialog-buttonpane { + margin-top: 0; + padding: 0.3em 1em; + border-width: 1px 0 0 0; + border-color: #ccc; + background: #f3f4ee; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + margin: 0; + padding: 0; +} +.ui-dialog .ui-dialog-buttonpane .ui-button-text-only .ui-button-text { + padding: 0; +} + +/* Form action buttons are moved in dialogs. Remove empty space. */ +.ui-dialog .ui-dialog-content .form-actions { + margin: 0; + padding: 0; +} +.ui-dialog .ajax-progress-throbber { + position: fixed; + z-index: 1000; + top: 48.5%; + /* Can't do center:50% middle: 50%, so approximate it for a typical window size. */ + left: 49%; + width: 24px; + height: 24px; + padding: 4px; + opacity: 0.9; + border-radius: 7px; + background-color: #232323; + background-image: url(../../images/icons/loading-small.gif); + background-repeat: no-repeat; + background-position: center center; +} +.ui-dialog .ajax-progress-throbber .throbber, +.ui-dialog .ajax-progress-throbber .message { + display: none; +} diff --git a/css/components/dropbutton.css b/css/components/dropbutton.css new file mode 100644 index 0000000..5e971ba --- /dev/null +++ b/css/components/dropbutton.css @@ -0,0 +1,33 @@ +/** + * @file + * General styles for dropbuttons. + */ + +.js .dropbutton-widget { + border: 1px solid #ccc; + background-color: white; +} +.js .dropbutton-widget:hover { + border-color: #b8b8b8; +} +.dropbutton .dropbutton-action > * { + padding: 0.1em 0.5em; + white-space: nowrap; +} +.dropbutton .secondary-action { + border-top: 1px solid #e8e8e8; +} +.dropbutton-multiple .dropbutton { + border-right: 1px solid #e8e8e8; /* LTR */ +} +[dir="rtl"] .dropbutton-multiple .dropbutton { + border-right: 0 none; + border-left: 1px solid #e8e8e8; +} +.dropbutton-multiple .dropbutton .dropbutton-action > * { + margin-right: 0.25em; /* LTR */ +} +[dir="rtl"] .dropbutton-multiple .dropbutton .dropbutton-action > * { + margin-right: 0; + margin-left: 0.25em; +} diff --git a/css/components/exposed-filters.css b/css/components/exposed-filters.css new file mode 100644 index 0000000..b686902 --- /dev/null +++ b/css/components/exposed-filters.css @@ -0,0 +1,46 @@ +/** + * @file + * Visual styles for exposed filters. + */ + +.exposed-filters .filters { + float: left; /* LTR */ + margin-right: 1em; /* LTR */ +} +[dir="rtl"] .exposed-filters .filters { + float: right; + margin-right: 0; + margin-left: 1em; +} +.exposed-filters .form-item { + margin: 0 0 0.1em 0; + padding: 0; +} +.exposed-filters .form-item label { + float: left; /* LTR */ + width: 10em; + font-weight: normal; +} +[dir="rtl"] .exposed-filters .form-item label { + float: right; +} +.exposed-filters .form-select { + width: 14em; +} +/* Current filters */ +.exposed-filters .current-filters { + margin-bottom: 1em; +} +.exposed-filters .current-filters .placeholder { + font-weight: bold; + font-style: normal; +} +.exposed-filters .additional-filters { + float: left; /* LTR */ + margin-right: 1em; /* LTR */ +} +[dir="rtl"] .exposed-filters .additional-filters { + float: right; + margin-right: 0; + margin-left: 1em; +} diff --git a/css/components/field.css b/css/components/field.css new file mode 100644 index 0000000..ff7e9ab --- /dev/null +++ b/css/components/field.css @@ -0,0 +1,25 @@ +/** + * @file + * Visual styles for fields. + */ + +.field__label { + font-weight: bold; +} +.field--label-inline .field__label, +.field--label-inline .field__items { + float: left; /* LTR */ +} +.field--label-inline .field__label, +.field--label-inline > .field__item, +.field--label-inline .field__items { + padding-right: 0.5em; +} +[dir="rtl"] .field--label-inline .field__label, +[dir="rtl"] .field--label-inline .field__items { + padding-right: 0; + padding-left: 0.5em; +} +.field--label-inline .field__label::after { + content: ":"; +} diff --git a/css/components/file.css b/css/components/file.css new file mode 100644 index 0000000..9aa90eb --- /dev/null +++ b/css/components/file.css @@ -0,0 +1,62 @@ +/** + * @file + * Default style for file module. + */ + +/* File icons. */ + +.file { + display: inline-block; + min-height: 16px; + padding-left: 20px; /* LTR */ + background-repeat: no-repeat; + background-position: left center; /* LTR */ +} +[dir="rtl"] .file { + padding-right: 20px; + padding-left: inherit; + background-position: right center; +} +.file--general, +.file--application-octet-stream { + background-image: url(../../images/icons/application-octet-stream.png); +} +.file--package-x-generic { + background-image: url(../../images/icons/package-x-generic.png); +} +.file--x-office-spreadsheet { + background-image: url(../../images/icons/x-office-spreadsheet.png); +} +.file--x-office-document { + background-image: url(../../images/icons/x-office-document.png); +} +.file--x-office-presentation { + background-image: url(../../images/icons/x-office-presentation.png); +} +.file--text-x-script { + background-image: url(../../images/icons/text-x-script.png); +} +.file--text-html { + background-image: url(../../images/icons/text-html.png); +} +.file--text-plain { + background-image: url(../../images/icons/text-plain.png); +} +.file--application-pdf { + background-image: url(../../images/icons/application-pdf.png); +} +.file--application-x-executable { + background-image: url(../../images/icons/application-x-executable.png); +} +.file--audio { + background-image: url(../../images/icons/audio-x-generic.png); +} +.file--video { + background-image: url(../../images/icons/video-x-generic.png); +} +.file--text { + background-image: url(../../images/icons/text-x-generic.png); +} +.file--image { + background-image: url(../../images/icons/image-x-generic.png); +} diff --git a/css/components/form.css b/css/components/form.css new file mode 100644 index 0000000..b840022 --- /dev/null +++ b/css/components/form.css @@ -0,0 +1,104 @@ +/** + * @file + * Visual styles for form components. + */ + +form .field-multiple-table { + margin: 0; +} +form .field-multiple-table .field-multiple-drag { + width: 30px; + padding-right: 0; /* LTR */ +} +[dir="rtl"] form .field-multiple-table .field-multiple-drag { + padding-left: 0; +} +form .field-multiple-table .field-multiple-drag .tabledrag-handle { + padding-right: 0.5em; /* LTR */ +} +[dir="rtl"] form .field-multiple-table .field-multiple-drag .tabledrag-handle { + padding-right: 0; + padding-left: 0.5em; +} +form .field-add-more-submit { + margin: 0.5em 0 0; +} + +/** + * Markup generated by Form API. + */ +.form-item, +.form-actions { + margin-top: 1em; + margin-bottom: 1em; +} +tr.odd .form-item, +tr.even .form-item { + margin-top: 0; + margin-bottom: 0; +} +.form-composite > .fieldset-wrapper > .description, +.form-item .description { + font-size: 0.85em; +} +label.option { + display: inline; + font-weight: normal; +} +.form-composite > legend, +.label { + display: inline; + margin: 0; + padding: 0; + font-size: inherit; + font-weight: bold; +} +.form-checkboxes .form-item, +.form-radios .form-item { + margin-top: 0.4em; + margin-bottom: 0.4em; +} +.form-type-radio .description, +.form-type-checkbox .description { + margin-left: 2.4em; /* LTR */ +} +[dir="rtl"] .form-type-radio .description, +[dir="rtl"] .form-type-checkbox .description { + margin-right: 2.4em; + margin-left: 0; +} +.marker { + color: #e00; +} +.form-required:after { + display: inline-block; + width: 6px; + height: 6px; + margin: 0 0.3em; + content: ""; + vertical-align: super; + /* Use a background image to prevent screen readers from announcing the text. */ + background-image: url(../../images/icons/required.svg); + background-repeat: no-repeat; + background-size: 6px 6px; +} +abbr.tabledrag-changed, +abbr.ajax-changed { + border-bottom: none; +} +.form-item input.error, +.form-item textarea.error, +.form-item select.error { + border: 2px solid red; +} + +/* Inline error messages. */ +.form-item--error-message:before { + display: inline-block; + width: 14px; + height: 14px; + content: ""; + vertical-align: sub; + background: url(../../images/icons/error.svg) no-repeat; + background-size: contain; +} diff --git a/css/components/icons.css b/css/components/icons.css new file mode 100644 index 0000000..2733758 --- /dev/null +++ b/css/components/icons.css @@ -0,0 +1,21 @@ +/** + * @file + * Visual styles for icons. + */ + +.icon-help { + padding: 1px 0 1px 20px; /* LTR */ + background: url(../../images/icons/help.png) 0 50% no-repeat; /* LTR */ +} +[dir="rtl"] .icon-help { + padding: 1px 20px 1px 0; + background-position: 100% 50%; +} +.feed-icon { + display: block; + overflow: hidden; + width: 16px; + height: 16px; + text-indent: -9999px; + background: url(../../images/icons/feed.svg) no-repeat; +} diff --git a/css/components/image-widget.css b/css/components/image-widget.css new file mode 100644 index 0000000..72e52a2 --- /dev/null +++ b/css/components/image-widget.css @@ -0,0 +1,22 @@ +/** + * @file + * Image upload widget. + */ + +.image-preview { + float: left; /* LTR */ + padding: 0 10px 10px 0; /* LTR */ +} +[dir="rtl"] .image-preview { + float: right; + padding: 0 0 10px 10px; +} +.image-widget-data { + float: left; /* LTR */ +} +[dir="rtl"] .image-widget-data { + float: right; +} +.image-widget-data .text-field { + width: auto; +} diff --git a/css/components/indented.css b/css/components/indented.css new file mode 100644 index 0000000..65ae061 --- /dev/null +++ b/css/components/indented.css @@ -0,0 +1,15 @@ +/** + * @file + * Basic styling for comment module. + */ + +/** + * Indent threaded comments. + */ +.indented { + margin-left: 25px; /* LTR */ +} +[dir="rtl"] .indented { + margin-right: 25px; + margin-left: 0; +} diff --git a/css/components/inline-form.css b/css/components/inline-form.css new file mode 100644 index 0000000..b5201a7 --- /dev/null +++ b/css/components/inline-form.css @@ -0,0 +1,33 @@ +/** + * @file + * Visual styles for inline forms. + */ + +.form--inline .form-item { + float: left; /* LTR */ + margin-right: 0.5em; /* LTR */ +} +[dir="rtl"] .form--inline .form-item { + float: right; + margin-right: 0; + margin-left: 0.5em; +} +/* This is required to win over specificity of [dir="rtl"] .form--inline .form-item */ +[dir="rtl"] .views-filterable-options-controls .form-item { + margin-right: 2%; +} +.form--inline .form-item-separator { + margin-top: 2.3em; + margin-right: 1em; /* LTR */ + margin-left: 0.5em; /* LTR */ +} +[dir="rtl"] .form--inline .form-item-separator { + margin-right: 0.5em; + margin-left: 1em; +} +.form--inline .form-actions { + clear: left; /* LTR */ +} +[dir="rtl"] .form--inline .form-actions { + clear: right; +} diff --git a/css/components/item-list.css b/css/components/item-list.css new file mode 100644 index 0000000..a8ce5d2 --- /dev/null +++ b/css/components/item-list.css @@ -0,0 +1,32 @@ +/** + * @file + * Visual styles for item list. + */ + +.item-list .title { + font-weight: bold; +} +.item-list ul { + margin: 0 0 0.75em 0; + padding: 0; +} +.item-list li { + margin: 0 0 0.25em 1.5em; /* LTR */ + padding: 0; +} +[dir="rtl"] .item-list li { + margin: 0 1.5em 0.25em 0; +} + +/** + * Comma separated lists. + */ +.item-list--comma-list { + display: inline; +} +.item-list--comma-list .item-list__comma-list, +.item-list__comma-list li, +[dir="rtl"] .item-list--comma-list .item-list__comma-list, +[dir="rtl"] .item-list__comma-list li { + margin: 0; +} diff --git a/css/components/link.css b/css/components/link.css new file mode 100644 index 0000000..fa83f2b --- /dev/null +++ b/css/components/link.css @@ -0,0 +1,16 @@ +/** + * @file + * Style another element as a link. + */ + +button.link { + margin: 0; + padding: 0; + cursor: pointer; + border: 0; + background: transparent; + font-size: 1em; +} +label button.link { + font-weight: bold; +} diff --git a/css/components/links.css b/css/components/links.css new file mode 100644 index 0000000..e483253 --- /dev/null +++ b/css/components/links.css @@ -0,0 +1,23 @@ +/** + * @file + * Visual styles for links. + */ + +ul.inline, +ul.links.inline { + display: inline; + padding-left: 0; /* LTR */ +} +[dir="rtl"] ul.inline, +[dir="rtl"] ul.links.inline { + padding-right: 0; + padding-left: 15px; +} +ul.inline li { + display: inline; + padding: 0 0.5em; + list-style-type: none; +} +ul.links a.is-active { + color: #000; +} diff --git a/css/components/menu.css b/css/components/menu.css new file mode 100644 index 0000000..df73324 --- /dev/null +++ b/css/components/menu.css @@ -0,0 +1,34 @@ +/** + * @file + * Visual styles for menu. + */ + +ul.menu { + margin-left: 1em; /* LTR */ + padding: 0; + list-style: none outside; + text-align: left; /* LTR */ +} +[dir="rtl"] ul.menu { + margin-right: 1em; + margin-left: 0; + text-align: right; +} +.menu-item--expanded { + list-style-type: circle; + list-style-image: url(../../images/icons/menu-expanded.png); +} +.menu-item--collapsed { + list-style-type: disc; + list-style-image: url(../../images/icons/menu-collapsed.png); /* LTR */ +} +[dir="rtl"] .menu-item--collapsed { + list-style-image: url(../../images/icons/menu-collapsed-rtl.png); +} +.menu-item { + margin: 0; + padding-top: 0.2em; +} +ul.menu a.is-active { + color: #000; +} diff --git a/css/components/messages.css b/css/components/messages.css new file mode 100644 index 0000000..be25930 --- /dev/null +++ b/css/components/messages.css @@ -0,0 +1,69 @@ +/** + * @file + * Styles for system messages. + */ + +.messages { + padding: 15px 20px 15px 35px; /* LTR */ + word-wrap: break-word; + border: 1px solid; + border-width: 1px 1px 1px 0; /* LTR */ + border-radius: 2px; + background: no-repeat 10px 17px; /* LTR */ + overflow-wrap: break-word; +} +[dir="rtl"] .messages { + padding-right: 35px; + padding-left: 20px; + text-align: right; + border-width: 1px 0 1px 1px; + background-position: right 10px top 17px; +} +.messages + .messages { + margin-top: 1.538em; +} +.messages__list { + margin: 0; + padding: 0; + list-style: none; +} +.messages__item + .messages__item { + margin-top: 0.769em; +} +.messages--status { + color: #325e1c; + border-color: #c9e1bd #c9e1bd #c9e1bd transparent; /* LTR */ + background-color: #f3faef; + background-image: url(../../images/icons/check.svg); + box-shadow: -8px 0 0 #77b259; /* LTR */ +} +[dir="rtl"] .messages--status { + margin-left: 0; + border-color: #c9e1bd transparent #c9e1bd #c9e1bd; + box-shadow: 8px 0 0 #77b259; +} +.messages--warning { + color: #734c00; + border-color: #f4daa6 #f4daa6 #f4daa6 transparent; /* LTR */ + background-color: #fdf8ed; + background-image: url(../../images/icons/warning.svg); + box-shadow: -8px 0 0 #e09600; /* LTR */ +} +[dir="rtl"] .messages--warning { + border-color: #f4daa6 transparent #f4daa6 #f4daa6; + box-shadow: 8px 0 0 #e09600; +} +.messages--error { + color: #a51b00; + border-color: #f9c9bf #f9c9bf #f9c9bf transparent; /* LTR */ + background-color: #fcf4f2; + background-image: url(../../images/icons/error.svg); + box-shadow: -8px 0 0 #e62600; /* LTR */ +} +[dir="rtl"] .messages--error { + border-color: #f9c9bf transparent #f9c9bf #f9c9bf; + box-shadow: 8px 0 0 #e62600; +} +.messages--error p.error { + color: #a51b00; +} diff --git a/css/components/more-link.css b/css/components/more-link.css new file mode 100644 index 0000000..c604061 --- /dev/null +++ b/css/components/more-link.css @@ -0,0 +1,12 @@ +/** + * @file + * Markup generated by #type 'more_link'. + */ + +.more-link { + display: block; + text-align: right; /* LTR */ +} +[dir="rtl"] .more-link { + text-align: left; +} diff --git a/css/components/node.css b/css/components/node.css new file mode 100644 index 0000000..6b7cd52 --- /dev/null +++ b/css/components/node.css @@ -0,0 +1,8 @@ +/** + * @file + * Visual styles for nodes. + */ + +.node--unpublished { + background-color: #fff4f4; +} diff --git a/css/components/pager.css b/css/components/pager.css new file mode 100644 index 0000000..a9471fc --- /dev/null +++ b/css/components/pager.css @@ -0,0 +1,16 @@ +/** + * @file + * Visual styles for pager. + */ + +.pager__items { + clear: both; + text-align: center; +} +.pager__item { + display: inline; + padding: 0.5em; +} +.pager__item.is-active { + font-weight: bold; +} diff --git a/css/components/progress.css b/css/components/progress.css new file mode 100644 index 0000000..91d793b --- /dev/null +++ b/css/components/progress.css @@ -0,0 +1,55 @@ +/** + * @file + * Visual styles for progress bar. + * + * @see progress.js + */ + +.progress__track { + border-color: #b3b3b3; + border-radius: 10em; + background-color: #f2f1eb; + background-image: linear-gradient(#e7e7df, #f0f0f0); + box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.16); +} +.progress__bar { + height: 16px; + margin-top: -1px; + margin-left: -1px; /* LTR */ + padding: 0 1px; + -webkit-transition: width 0.5s ease-out; + transition: width 0.5s ease-out; + -webkit-animation: animate-stripes 3s linear infinite; + -moz-animation: animate-stripes 3s linear infinite; + border: 1px #07629a solid; + border-radius: 10em; + background: #057ec9; + background-image: + linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)), + linear-gradient(to right bottom, #0094f0 0%, #0094f0 25%, #007ecc 25%, #007ecc 50%, #0094f0 50%, #0094f0 75%, #0094f0 100%); + background-size: 40px 40px; +} +[dir="rtl"] .progress__bar { + margin-right: -1px; + margin-left: 0; + -webkit-animation-direction: reverse; + -moz-animation-direction: reverse; + animation-direction: reverse; +} + +@media screen and (prefers-reduced-motion: reduce) { + .progress__bar { + -webkit-transition: none; + transition: none; + -webkit-animation: none; + -moz-animation: none; + } +} + +/** + * Progress bar animations. + */ +@keyframes animate-stripes { + 0% { background-position: 0 0, 0 0; } + 100% { background-position: 0 0, -80px 0; } +} diff --git a/css/components/search-results.css b/css/components/search-results.css new file mode 100644 index 0000000..343ea8b --- /dev/null +++ b/css/components/search-results.css @@ -0,0 +1,8 @@ +/** + * @file + * Stylesheet for results generated by the Search module. + */ + +.search-results { + list-style: none; +} diff --git a/css/components/tabledrag.css b/css/components/tabledrag.css new file mode 100644 index 0000000..a197b24 --- /dev/null +++ b/css/components/tabledrag.css @@ -0,0 +1,14 @@ +/** + * @file + * Visual styles for table drag. + */ + +tr.drag { + background-color: #fffff0; +} +tr.drag-previous { + background-color: #ffd; +} +body div.tabledrag-changed-warning { + margin-bottom: 0.5em; +} diff --git a/css/components/tableselect.css b/css/components/tableselect.css new file mode 100644 index 0000000..fcfb2a5 --- /dev/null +++ b/css/components/tableselect.css @@ -0,0 +1,19 @@ +/** + * @file + * Table select behavior. + * + * @see tableselect.js + */ + +tr.selected td { + background: #ffc; +} +td.checkbox, +th.checkbox { + text-align: center; +} +[dir="rtl"] td.checkbox, +[dir="rtl"] th.checkbox { + /* This is required to win over specificity of [dir="rtl"] td */ + text-align: center; +} diff --git a/css/components/tablesort.css b/css/components/tablesort.css new file mode 100644 index 0000000..44e5349 --- /dev/null +++ b/css/components/tablesort.css @@ -0,0 +1,11 @@ +/** + * @file + * Table sort indicator. + */ + +th.is-active img { + display: inline; +} +td.is-active { + background-color: #ddd; +} diff --git a/css/components/tabs.css b/css/components/tabs.css new file mode 100644 index 0000000..16fb122 --- /dev/null +++ b/css/components/tabs.css @@ -0,0 +1,33 @@ +/** + * @file + * Visual styles for tabs. + */ + +div.tabs { + margin: 1em 0; +} +ul.tabs { + margin: 0 0 0.5em; + padding: 0; + list-style: none; +} +.tabs > li { + display: inline-block; + margin-right: 0.3em; /* LTR */ +} +[dir="rtl"] .tabs > li { + margin-right: 0; + margin-left: 0.3em; +} +.tabs a { + display: block; + padding: 0.2em 1em; + text-decoration: none; +} +.tabs a.is-active { + background-color: #eee; +} +.tabs a:focus, +.tabs a:hover { + background-color: #f5f5f5; +} diff --git a/css/components/textarea.css b/css/components/textarea.css new file mode 100644 index 0000000..2661bae --- /dev/null +++ b/css/components/textarea.css @@ -0,0 +1,11 @@ +/** + * @file + * Visual styles for a resizable textarea. + */ + +.form-textarea-wrapper textarea { + display: block; + box-sizing: border-box; + width: 100%; + margin: 0; +} diff --git a/css/components/ui-dialog.css b/css/components/ui-dialog.css new file mode 100644 index 0000000..164ca86 --- /dev/null +++ b/css/components/ui-dialog.css @@ -0,0 +1,15 @@ +/** + * @file + * Styles for modal windows. + */ + +.ui-dialog--narrow { + max-width: 500px; +} + +@media screen and (max-width: 600px) { + .ui-dialog--narrow { + min-width: 95%; + max-width: 95%; + } +} diff --git a/css/components/user.css b/css/components/user.css new file mode 100644 index 0000000..7892fd6 --- /dev/null +++ b/css/components/user.css @@ -0,0 +1,67 @@ +/** + * @file + * Theme styling for user module. + */ + +/* Visual styling for the Password strength indicator */ +.password-strength__meter { + margin-top: 0.5em; + background-color: #ebeae4; +} +.password-strength__indicator { + -webkit-transition: width 0.5s ease-out; + transition: width 0.5s ease-out; + background-color: #77b259; +} +.password-strength__indicator.is-weak { + background-color: #e62600; +} +.password-strength__indicator.is-fair { + background-color: #e09600; +} +.password-strength__indicator.is-good { + background-color: #0074bd; +} +.password-strength__indicator.is-strong { + background-color: #77b259; +} + +.password-confirm, +.password-field, +.password-strength, +.password-confirm-match, +.password-confirm-message { + width: 55%; +} + +.password-suggestions { + max-width: 34.7em; + margin: 0.7em 0; + padding: 0.2em 0.5em; + border: 1px solid #b4b4b4; +} +.password-suggestions ul { + margin-bottom: 0; +} + +.confirm-parent, +.password-parent { + clear: left; /* LTR */ + overflow: hidden; + max-width: 33em; + margin: 0; +} +[dir="rtl"] .confirm-parent, +[dir="rtl"] .password-parent { + clear: right; +} + +/* Styling for the status indicator of the passwords match test. */ +.password-confirm .ok { + color: #325e1c; + font-weight: bold; +} +.password-confirm .error { + color: #a51b00; + font-weight: bold; +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100755 index 0000000..2670961 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,110 @@ +//@format +const yaml = require('js-yaml'); +const fs = require('fs'); +const { SITE, PORT, BSREWRITE, PATHS } = loadConfig(); +//var server = require('browser-sync').create(); +//global.server = server; +const gulp = require('gulp'); +const plumber = require('gulp-plumber'); +const autoprefixer = require('gulp-autoprefixer'); +const sass = require('gulp-sass')(require('sass')); +const browsersync = require('browser-sync').create(); +const sourcemaps = require('gulp-sourcemaps'); +const cleanCSS = require('gulp-clean-css'); + +function loadConfig() { + var ymlFile = fs.readFileSync('config.yml', 'utf8'); + return yaml.load(ymlFile); +} + +// BrowserSync +function bsInit__local(done) { + browsersync.init({ + logLevel: 'debug', + proxy: SITE.Local.Url, + //proxy: 'https://d10_dev.lndo.site/', + }); + done(); +} + +function bsInit__remote(done) { + browsersync.init({ + //logLevel: 'debug', + proxy: SITE.Remote.Url, + serveStatic: ['.'], + files: PATHS.Watch, + plugins: ['bs-rewrite-rules'], + rewriteRules: [ + { + match: BSREWRITE.Css.Match, + replace: BSREWRITE.Css.Replace + }, + { + match: BSREWRITE.Js.Match, + replace: BSREWRITE.Js.Replace + } + ] + }); + done(); +} + +// BrowserSync Reload +function bsReload(done) { + browsersync.reload(); + done(); +} + +var cp = require('child_process'); +function drush() { + return cp.exec('lando drush cr'); +} + +// Compile CSS +function styles() { + 'use strict'; + return gulp + //.src(PATHS.Scss.Dir + '/**/*.scss') + .src('./css/sass/**/*.scss') + .pipe(plumber()) + .pipe(sourcemaps.init()) + .pipe( + sass + .sync({ + includePaths: PATHS.Scss.Libraries + }) + .on('error', sass.logError) + ) + //.pipe(cleanCSS()) + .pipe(sourcemaps.write('.')) + //.pipe(gulp.dest(PATHS.Css.Dir)) + .pipe(gulp.dest('./css')) + .pipe(browsersync.stream()); +} + +// Watch Files +function watchFiles() { + 'use strict'; + //gulp.watch(PATHS.Scss.Dir + '/**/*.scss', styles); + gulp.watch('css/sass/**/*.scss', styles); + gulp.watch('./templates/**/*.twig', drush); +} + +// Group complex tasks +const build = gulp.parallel(styles); +const watch_remote = gulp.series( + styles, + gulp.parallel(watchFiles, bsInit__remote) +); +const watch_local = gulp.series( + styles, + gulp.parallel(watchFiles, bsInit__local) +); + +// Export tasks +exports.build = build; +exports.styles = styles; +exports.drush = drush; +exports.watch = watch_remote; +exports.remote = watch_remote; +exports.local = watch_local; +exports.default = watch_remote; diff --git a/images/icons/application-octet-stream.png b/images/icons/application-octet-stream.png new file mode 100644 index 0000000..d545321 Binary files /dev/null and b/images/icons/application-octet-stream.png differ diff --git a/images/icons/application-pdf.png b/images/icons/application-pdf.png new file mode 100644 index 0000000..36107d6 Binary files /dev/null and b/images/icons/application-pdf.png differ diff --git a/images/icons/application-x-executable.png b/images/icons/application-x-executable.png new file mode 100644 index 0000000..d545321 Binary files /dev/null and b/images/icons/application-x-executable.png differ diff --git a/images/icons/audio-x-generic.png b/images/icons/audio-x-generic.png new file mode 100644 index 0000000..28d7f50 Binary files /dev/null and b/images/icons/audio-x-generic.png differ diff --git a/images/icons/check.svg b/images/icons/check.svg new file mode 100644 index 0000000..566cbc4 --- /dev/null +++ b/images/icons/check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/error.svg b/images/icons/error.svg new file mode 100644 index 0000000..151a1e6 --- /dev/null +++ b/images/icons/error.svg @@ -0,0 +1 @@ + diff --git a/images/icons/feed.svg b/images/icons/feed.svg new file mode 100644 index 0000000..595a9d9 --- /dev/null +++ b/images/icons/feed.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/images/icons/help.png b/images/icons/help.png new file mode 100644 index 0000000..dcc5cac Binary files /dev/null and b/images/icons/help.png differ diff --git a/images/icons/image-x-generic.png b/images/icons/image-x-generic.png new file mode 100644 index 0000000..c1b814f Binary files /dev/null and b/images/icons/image-x-generic.png differ diff --git a/images/icons/loading-small.gif b/images/icons/loading-small.gif new file mode 100644 index 0000000..5cbf6e7 Binary files /dev/null and b/images/icons/loading-small.gif differ diff --git a/images/icons/menu-collapsed-rtl.png b/images/icons/menu-collapsed-rtl.png new file mode 100644 index 0000000..dc8d0b8 Binary files /dev/null and b/images/icons/menu-collapsed-rtl.png differ diff --git a/images/icons/menu-collapsed.png b/images/icons/menu-collapsed.png new file mode 100644 index 0000000..91f3fd4 Binary files /dev/null and b/images/icons/menu-collapsed.png differ diff --git a/images/icons/menu-expanded.png b/images/icons/menu-expanded.png new file mode 100644 index 0000000..46f39ec Binary files /dev/null and b/images/icons/menu-expanded.png differ diff --git a/images/icons/package-x-generic.png b/images/icons/package-x-generic.png new file mode 100644 index 0000000..21fc382 Binary files /dev/null and b/images/icons/package-x-generic.png differ diff --git a/images/icons/required.svg b/images/icons/required.svg new file mode 100644 index 0000000..f7882d6 --- /dev/null +++ b/images/icons/required.svg @@ -0,0 +1 @@ + diff --git a/images/icons/text-html.png b/images/icons/text-html.png new file mode 100644 index 0000000..9c7c793 Binary files /dev/null and b/images/icons/text-html.png differ diff --git a/images/icons/text-plain.png b/images/icons/text-plain.png new file mode 100644 index 0000000..0680484 Binary files /dev/null and b/images/icons/text-plain.png differ diff --git a/images/icons/text-x-generic.png b/images/icons/text-x-generic.png new file mode 100644 index 0000000..0680484 Binary files /dev/null and b/images/icons/text-x-generic.png differ diff --git a/images/icons/text-x-script.png b/images/icons/text-x-script.png new file mode 100644 index 0000000..f9ecca8 Binary files /dev/null and b/images/icons/text-x-script.png differ diff --git a/images/icons/video-x-generic.png b/images/icons/video-x-generic.png new file mode 100644 index 0000000..a2b71f9 Binary files /dev/null and b/images/icons/video-x-generic.png differ diff --git a/images/icons/warning.svg b/images/icons/warning.svg new file mode 100644 index 0000000..1498a41 --- /dev/null +++ b/images/icons/warning.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/x-office-document.png b/images/icons/x-office-document.png new file mode 100644 index 0000000..40db538 Binary files /dev/null and b/images/icons/x-office-document.png differ diff --git a/images/icons/x-office-presentation.png b/images/icons/x-office-presentation.png new file mode 100644 index 0000000..fb119e5 Binary files /dev/null and b/images/icons/x-office-presentation.png differ diff --git a/images/icons/x-office-spreadsheet.png b/images/icons/x-office-spreadsheet.png new file mode 100644 index 0000000..9af7b61 Binary files /dev/null and b/images/icons/x-office-spreadsheet.png differ diff --git a/islandscholar.info.yml b/islandscholar.info.yml new file mode 100644 index 0000000..bd8048f --- /dev/null +++ b/islandscholar.info.yml @@ -0,0 +1,22 @@ +name: islandscholar +type: theme +'base theme': stable9 +starterkit: true +version: VERSION +libraries: + - islandscholar/base + - islandscholar/messages + - core/normalize +libraries-extend: + user/drupal.user: + - islandscholar/user + core/drupal.dropbutton: + - islandscholar/dropbutton + core/drupal.dialog: + - islandscholar/dialog + file/drupal.file: + - islandscholar/file + core/drupal.progress: + - islandscholar/progress +core_version_requirement: ^10 +generator: 'starterkit_theme:10.0.9' diff --git a/islandscholar.libraries.yml b/islandscholar.libraries.yml new file mode 100644 index 0000000..de8638e --- /dev/null +++ b/islandscholar.libraries.yml @@ -0,0 +1,105 @@ +base: + version: VERSION + css: + component: + css/components/action-links.css: + weight: -10 + css/components/breadcrumb.css: + weight: -10 + css/components/button.css: + weight: -10 + css/components/container-inline.css: + weight: -10 + css/components/details.css: + weight: -10 + css/components/exposed-filters.css: + weight: -10 + css/components/field.css: + weight: -10 + css/components/form.css: + weight: -10 + css/components/icons.css: + weight: -10 + css/components/inline-form.css: + weight: -10 + css/components/item-list.css: + weight: -10 + css/components/link.css: + weight: -10 + css/components/links.css: + weight: -10 + css/components/menu.css: + weight: -10 + css/components/more-link.css: + weight: -10 + css/components/pager.css: + weight: -10 + css/components/tabledrag.css: + weight: -10 + css/components/tableselect.css: + weight: -10 + css/components/tablesort.css: + weight: -10 + css/components/tabs.css: + weight: -10 + css/components/textarea.css: + weight: -10 + css/components/ui-dialog.css: + weight: -10 +dialog: + version: VERSION + css: + component: + css/components/dialog.css: + weight: -10 +dropbutton: + version: VERSION + css: + component: + css/components/dropbutton.css: + weight: -10 +file: + version: VERSION + css: + component: + css/components/file.css: + weight: -10 +image-widget: + version: VERSION + css: + component: + css/components/image-widget.css: { } +indented: + version: VERSION + css: + component: + css/components/indented.css: { } +messages: + version: VERSION + css: + component: + css/components/messages.css: + weight: -10 +node: + version: VERSION + css: + component: + css/components/node.css: + weight: -10 +progress: + version: VERSION + css: + component: + css/components/progress.css: + weight: -10 +search-results: + version: VERSION + css: + component: + css/components/search-results.css: { } +user: + version: VERSION + css: + component: + css/components/user.css: + weight: -10 diff --git a/islandscholar.theme b/islandscholar.theme new file mode 100644 index 0000000..1343610 --- /dev/null +++ b/islandscholar.theme @@ -0,0 +1,21 @@ + diff --git a/package.json b/package.json new file mode 100755 index 0000000..2607641 --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "vanilla_vre", + "version": "1.0.0", + "description": "vanilla_vre theme, generated from starterkit_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme).", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "breakpoint-sass": "^2.7.1", + "browser-sync": "latest", + "bs-rewrite-rules": "^2.1.2", + "foundation-sites": "^6.7.5", + "fs": "^0.0.1-security", + "gulp": "latest", + "gulp-autoprefixer": "latest", + "gulp-cache": "^1.1.3", + "gulp-clean-css": "^4.3.0", + "gulp-concat": "^2.6.1", + "gulp-plumber": "latest", + "gulp-rename": "latest", + "gulp-sass": "latest", + "gulp-sourcemaps": "^3.0.0", + "gulp4-run-sequence": "^1.0.0", + "js-yaml": "^4.1.0", + "modularscale-sass": "^3.0.10", + "natives": "^1.1.6", + "require-dir": "^1.2.0", + "run-sequence": "^2.2.1", + "sass": "^1.44.0", + "vanilla-framework": "^3.10.0" + }, + "dependencies": { + "superfish": "^1.7.10" + } +} diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..4d8e395 Binary files /dev/null and b/screenshot.png differ diff --git a/src/StarterKit.php b/src/StarterKit.php new file mode 100644 index 0000000..9f367d2 --- /dev/null +++ b/src/StarterKit.php @@ -0,0 +1,20 @@ +{{ content }} + {% endif %} +{% endblock %} diff --git a/templates/block/block--local-tasks-block.html.twig b/templates/block/block--local-tasks-block.html.twig new file mode 100644 index 0000000..0f25f59 --- /dev/null +++ b/templates/block/block--local-tasks-block.html.twig @@ -0,0 +1,14 @@ +{% extends "block.html.twig" %} +{# +/** + * @file + * Theme override for tabs. + */ +#} +{% block content %} + {% if content %} + + {% endif %} +{% endblock %} diff --git a/templates/block/block--search-form-block.html.twig b/templates/block/block--search-form-block.html.twig new file mode 100644 index 0000000..d1cda72 --- /dev/null +++ b/templates/block/block--search-form-block.html.twig @@ -0,0 +1,46 @@ +{# +/** + * @file + * Theme override for the search form block. + * + * Available variables: + * - plugin_id: The ID of the block implementation. + * - label: The configured label of the block if visible. + * - configuration: A list of the block's configuration values, including: + * - label: The configured label for the block. + * - label_display: The display settings for the label. + * - provider: The module or other provider that provided this block plugin. + * - Block plugin specific settings will also be stored here. + * - in_preview: Whether the plugin is being rendered in preview mode. + * - content: The content of this block. + * - attributes: A list HTML attributes populated by modules, intended to + * be added to the main container tag of this template. Includes: + * - id: A valid HTML ID and guaranteed unique. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * + * @see template_preprocess_block() + * @see search_preprocess_block() + */ +#} +{% + set classes = [ + 'block', + 'block-search', + 'container-inline', + ] +%} + + {{ title_prefix }} + {% if label %} + {{ label }} + {% endif %} + {{ title_suffix }} + {% block content %} + {{ content }} + {% endblock %} + diff --git a/templates/block/block--system-branding-block.html.twig b/templates/block/block--system-branding-block.html.twig new file mode 100644 index 0000000..baa015b --- /dev/null +++ b/templates/block/block--system-branding-block.html.twig @@ -0,0 +1,30 @@ +{% extends "block.html.twig" %} +{# +/** + * @file + * Theme override for a branding block. + * + * Each branding element variable (logo, name, slogan) is only available if + * enabled in the block configuration. + * + * Available variables: + * - site_logo: Logo for site as defined in Appearance or theme settings. + * - site_name: Name for site as defined in Site information settings. + * - site_slogan: Slogan for site as defined in Site information settings. + */ +#} +{% block content %} + {% if site_logo %} + + {% endif %} + {% if site_name %} + + {% endif %} + {% if site_slogan %} +
{{ site_slogan }}
+ {% endif %} +{% endblock %} diff --git a/templates/block/block--system-menu-block.html.twig b/templates/block/block--system-menu-block.html.twig new file mode 100644 index 0000000..db3f9f8 --- /dev/null +++ b/templates/block/block--system-menu-block.html.twig @@ -0,0 +1,57 @@ +{# +/** + * @file + * Theme override for a menu block. + * + * Available variables: + * - plugin_id: The ID of the block implementation. + * - label: The configured label of the block if visible. + * - configuration: A list of the block's configuration values. + * - label: The configured label for the block. + * - label_display: The display settings for the label. + * - provider: The module or other provider that provided this block plugin. + * - Block plugin specific settings will also be stored here. + * - in_preview: Whether the plugin is being rendered in preview mode. + * - content: The content of this block. + * - attributes: HTML attributes for the containing element. + * - id: A valid HTML ID and guaranteed unique. + * - title_attributes: HTML attributes for the title element. + * - content_attributes: HTML attributes for the content element. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * + * Headings should be used on navigation menus that consistently appear on + * multiple pages. When this menu block's label is configured to not be + * displayed, it is automatically made invisible using the 'visually-hidden' CSS + * class, which still keeps it visible for screen-readers and assistive + * technology. Headings allow screen-reader and keyboard only users to navigate + * to or skip the links. + * See http://juicystudio.com/article/screen-readers-display-none.php and + * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. + */ +#} +{% + set classes = [ + 'block', + 'block-menu', + 'navigation', + 'menu--' ~ derivative_plugin_id|clean_class, + ] +%} +{% set heading_id = attributes.id ~ '-menu'|clean_id %} + diff --git a/templates/block/block.html.twig b/templates/block/block.html.twig new file mode 100644 index 0000000..114d7c4 --- /dev/null +++ b/templates/block/block.html.twig @@ -0,0 +1,45 @@ +{# +/** + * @file + * Theme override to display a block. + * + * Available variables: + * - plugin_id: The ID of the block implementation. + * - label: The configured label of the block if visible. + * - configuration: A list of the block's configuration values. + * - label: The configured label for the block. + * - label_display: The display settings for the label. + * - provider: The module or other provider that provided this block plugin. + * - Block plugin specific settings will also be stored here. + * - in_preview: Whether the plugin is being rendered in preview mode. + * - content: The content of this block. + * - attributes: array of HTML attributes populated by modules, intended to + * be added to the main container tag of this template. + * - id: A valid HTML ID and guaranteed unique. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * + * @see template_preprocess_block() + */ +#} +{% + set classes = [ + 'block', + 'block-' ~ configuration.provider|clean_class, + 'block-' ~ plugin_id|clean_class, + ] +%} + + {{ title_prefix }} + {% if label %} + {{ label }} + {% endif %} + {{ title_suffix }} + {% block content %} + {{ content }} + {% endblock %} + diff --git a/templates/content-edit/file-managed-file.html.twig b/templates/content-edit/file-managed-file.html.twig new file mode 100644 index 0000000..5cd5238 --- /dev/null +++ b/templates/content-edit/file-managed-file.html.twig @@ -0,0 +1,22 @@ +{# +/** + * @file + * Theme override to display a file form widget. + * + * Available variables: + * - element: Form element for the file upload. + * - attributes: HTML attributes for the containing element. + * + * @see template_preprocess_file_managed_file() + */ +#} +{{ attach_library('islandscholar/file') }} +{% + set classes = [ + 'js-form-managed-file', + 'form-managed-file', + ] +%} + + {{ element }} + diff --git a/templates/content-edit/file-upload-help.html.twig b/templates/content-edit/file-upload-help.html.twig new file mode 100644 index 0000000..d05822e --- /dev/null +++ b/templates/content-edit/file-upload-help.html.twig @@ -0,0 +1,12 @@ +{# +/** + * @file + * Theme override to display help text for file fields. + * + * Available variables: + * - descriptions: Lines of help text for uploading a file. + * + * @see template_preprocess_file_upload_help() + */ +#} +{{ descriptions|safe_join('
') }} diff --git a/templates/content-edit/file-widget-multiple.html.twig b/templates/content-edit/file-widget-multiple.html.twig new file mode 100644 index 0000000..34646fe --- /dev/null +++ b/templates/content-edit/file-widget-multiple.html.twig @@ -0,0 +1,14 @@ +{# +/** + * @file + * Theme override to display a multi file form widget. + * + * Available variables: + * - table: Table of previously uploaded files. + * - element: The form element for uploading another file. + * + * @see template_preprocess_file_widget_multiple() + */ +#} +{{ table }} +{{ element }} diff --git a/templates/content-edit/filter-caption.html.twig b/templates/content-edit/filter-caption.html.twig new file mode 100644 index 0000000..1e35795 --- /dev/null +++ b/templates/content-edit/filter-caption.html.twig @@ -0,0 +1,18 @@ +{# +/** + * @file + * Theme override for a filter caption. + * + * Returns HTML for a captioned image, audio, video or other tag. + * + * Available variables + * - string node: The complete HTML tag whose contents are being captioned. + * - string tag: The name of the HTML tag whose contents are being captioned. + * - string caption: The caption text. + * - string classes: The classes of the captioned HTML tag. + */ +#} +
+{{ node }} +
{{ caption }}
+
diff --git a/templates/content-edit/filter-guidelines.html.twig b/templates/content-edit/filter-guidelines.html.twig new file mode 100644 index 0000000..afef2d2 --- /dev/null +++ b/templates/content-edit/filter-guidelines.html.twig @@ -0,0 +1,29 @@ +{# +/** + * @file + * Theme override for guidelines for a text format. + * + * Available variables: + * - format: Contains information about the current text format, including the + * following: + * - name: The name of the text format, potentially unsafe and needs to be + * escaped. + * - format: The machine name of the text format, e.g. 'basic_html'. + * - attributes: HTML attributes for the containing element. + * - tips: Descriptions and a CSS ID in the form of 'module-name/filter-id' + * (only used when 'long' is TRUE) for each filter in one or more text + * formats. + * + * @see template_preprocess_filter_tips() + */ +#} +{% + set classes = [ + 'filter-guidelines-item', + 'filter-guidelines-' ~ format.id, + ] +%} + +

{{ format.label }}

+ {{ tips }} + diff --git a/templates/content-edit/filter-tips.html.twig b/templates/content-edit/filter-tips.html.twig new file mode 100644 index 0000000..25ed49d --- /dev/null +++ b/templates/content-edit/filter-tips.html.twig @@ -0,0 +1,61 @@ +{# +/** + * @file + * Theme override for a set of filter tips. + * + * Available variables: + * - tips: Descriptions and a CSS ID in the form of 'module-name/filter-id' + * (only used when 'long' is TRUE) for each filter in one or more text + * formats. + * - long: A flag indicating whether the passed-in filter tips contain extended + * explanations, i.e. intended to be output on the path 'filter/tips' + * (TRUE), or are in a short format, i.e. suitable to be displayed below a + * form element. Defaults to FALSE. + * - multiple: A flag indicating there is more than one filter tip. + * + * @see template_preprocess_filter_tips() + */ +#} +{% if multiple %} +

{{ 'Text Formats'|t }}

+{% endif %} + +{% if tips|length %} + {% if multiple %} +
+ {% endif %} + + {% for name, tip in tips %} + {% if multiple %} + {% + set tip_classes = [ + 'filter-type', + 'filter-' ~ name|clean_class, + ] + %} + +

{{ tip.name }}

+ {% endif %} + + {% if tip.list|length %} +
    + {% for item in tip.list %} + {% + set item_classes = [ + long ? 'filter-' ~ item.id|replace({'/': '-'}), + ] + %} + {{ item.tip }} + {% endfor %} +
+ {% endif %} + + {% if multiple %} +
+ {% endif %} + {% endfor %} + + {% if multiple %} + + {% endif %} +{% endif %} diff --git a/templates/content-edit/image-widget.html.twig b/templates/content-edit/image-widget.html.twig new file mode 100644 index 0000000..dac3a22 --- /dev/null +++ b/templates/content-edit/image-widget.html.twig @@ -0,0 +1,23 @@ +{# +/** + * @file + * Theme override for an image field widget. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - data: Render elements of the image widget. + * + * @see template_preprocess_image_widget() + */ +#} + + {% if data.preview %} +
+ {{ data.preview }} +
+ {% endif %} +
+ {# Render widget data without the image preview that was output already. #} + {{ data|without('preview') }} +
+ diff --git a/templates/content-edit/node-add-list.html.twig b/templates/content-edit/node-add-list.html.twig new file mode 100644 index 0000000..f38fe3a --- /dev/null +++ b/templates/content-edit/node-add-list.html.twig @@ -0,0 +1,30 @@ +{# +/** + * @file + * Theme override to list node types available for adding content. + * + * This list is displayed on the Add content admin page. + * + * Available variables: + * - types: A list of content types, each with the following properties: + * - add_link: Link to create a piece of content of this type. + * - description: Description of this type of content. + * + * @see template_preprocess_node_add_list() + */ +#} +{% if types is not empty %} +
+ {% for type in types %} +
{{ type.add_link }}
+
{{ type.description }}
+ {% endfor %} +
+{% else %} +

+ {% set create_content = path('node.type_add') %} + {% trans %} + You have not created any content types yet. Go to the content type creation page to add a new content type. + {% endtrans %} +

+{% endif %} diff --git a/templates/content-edit/node-edit-form.html.twig b/templates/content-edit/node-edit-form.html.twig new file mode 100644 index 0000000..9e1ffbb --- /dev/null +++ b/templates/content-edit/node-edit-form.html.twig @@ -0,0 +1,26 @@ +{# +/** + * @file + * Theme override for a node edit form. + * + * Two column template for the node add/edit form. + * + * This template will be used when a node edit form specifies 'node_edit_form' + * as its #theme callback. Otherwise, by default, node add/edit forms will be + * themed by form.html.twig. + * + * Available variables: + * - form: The node add/edit form. + */ +#} +
+
+ {{ form|without('advanced', 'actions') }} +
+
+ {{ form.advanced }} +
+ +
diff --git a/templates/content-edit/text-format-wrapper.html.twig b/templates/content-edit/text-format-wrapper.html.twig new file mode 100644 index 0000000..08a88ca --- /dev/null +++ b/templates/content-edit/text-format-wrapper.html.twig @@ -0,0 +1,26 @@ +{# +/** + * @file + * Theme override for a text format-enabled form element. + * + * Available variables: + * - children: Text format element children. + * - description: Text format element description. + * - attributes: HTML attributes for the containing element. + * - aria_description: Flag for whether or not an ARIA description has been + * added to the description container. + * + * @see template_preprocess_text_format_wrapper() + */ +#} +
+ {{ children }} + {% if description %} + {% + set classes = [ + aria_description ? 'description', + ] + %} + {{ description }}
+ {% endif %} + diff --git a/templates/content/comment.html.twig b/templates/content/comment.html.twig new file mode 100644 index 0000000..a086751 --- /dev/null +++ b/templates/content/comment.html.twig @@ -0,0 +1,111 @@ +{# +/** + * @file + * Theme override for comments. + * + * Available variables: + * - author: Comment author. Can be a link or plain text. + * - content: The content-related items for the comment display. Use + * {{ content }} to print them all, or print a subset such as + * {{ content.field_example }}. Use the following code to temporarily suppress + * the printing of a given child element: + * @code + * {{ content|without('field_example') }} + * @endcode + * - created: Formatted date and time for when the comment was created. + * Preprocess functions can reformat it by calling DateFormatter::format() + * with the desired parameters on the 'comment.created' variable. + * - changed: Formatted date and time for when the comment was last changed. + * Preprocess functions can reformat it by calling DateFormatter::format() + * with the desired parameters on the 'comment.changed' variable. + * - permalink: Comment permalink. + * - submitted: Submission information created from author and created + * during template_preprocess_comment(). + * - user_picture: The comment author's profile picture. + * - status: Comment status. Possible values are: + * unpublished, published, or preview. + * - title: Comment title, linked to the comment. + * - attributes: HTML attributes for the containing element. + * The attributes.class may contain one or more of the following classes: + * - comment: The current template type; e.g., 'theming hook'. + * - by-anonymous: Comment by an unregistered user. + * - by-{entity-type}-author: Comment by the author of the parent entity, + * eg. by-node-author. + * - preview: When previewing a new or edited comment. + * The following applies only to viewers who are registered users: + * - unpublished: An unpublished comment visible only to administrators. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - content_attributes: List of classes for the styling of the comment content. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - threaded: A flag indicating whether the comments are threaded or not. + * + * These variables are provided to give context about the parent comment (if + * any): + * - parent_comment: Full parent comment entity (if any). + * - parent_author: Equivalent to author for the parent comment. + * - parent_created: Equivalent to created for the parent comment. + * - parent_changed: Equivalent to changed for the parent comment. + * - parent_title: Equivalent to title for the parent comment. + * - parent_permalink: Equivalent to permalink for the parent comment. + * - parent: A text string of parent comment submission information created from + * 'parent_author' and 'parent_created' during template_preprocess_comment(). + * This information is presented to help screen readers follow lengthy + * discussion threads. You can hide this from sighted users using the class + * visually-hidden. + * + * These two variables are provided for context: + * - comment: Full comment object. + * - commented_entity: Entity the comments are attached to. + * + * @see template_preprocess_comment() + */ +#} +{% if threaded %} + {{ attach_library('islandscholar/indented') }} +{% endif %} +{% + set classes = [ + 'comment', + 'js-comment', + status != 'published' ? status, + comment.owner.anonymous ? 'by-anonymous', + author_id and author_id == commented_entity.getOwnerId() ? 'by-' ~ commented_entity.getEntityTypeId() ~ '-author', + ] +%} + + {# + Hide the "new" indicator by default, let a piece of JavaScript ask the + server which comments are new for the user. Rendering the final "new" + indicator here would break the render cache. + #} + + +
+ {{ user_picture }} + + + {# + Indicate the semantic relationship between parent and child comments for + accessibility. The list is difficult to navigate in a screen reader + without this information. + #} + {% if parent %} +

{{ parent }}

+ {% endif %} + + {{ permalink }} +
+ + + {% if title %} + {{ title_prefix }} + {{ title }} + {{ title_suffix }} + {% endif %} + {{ content }} + + diff --git a/templates/content/links--node.html.twig b/templates/content/links--node.html.twig new file mode 100644 index 0000000..e6cda0d --- /dev/null +++ b/templates/content/links--node.html.twig @@ -0,0 +1,40 @@ +{# +/** + * @file + * Theme override to display node links. + * + * Available variables: + * - attributes: Attributes for the UL containing the list of links. + * - links: Links to be output. + * Each link will have the following elements: + * - link: (optional) A render array that returns a link. See + * template_preprocess_links() for details how it is generated. + * - text: The link text. + * - attributes: HTML attributes for the list item element. + * - text_attributes: (optional) HTML attributes for the span element if no + * 'url' was supplied. + * - heading: (optional) A heading to precede the links. + * - text: The heading text. + * - level: The heading level (e.g. 'h2', 'h3'). + * - attributes: (optional) A keyed list of attributes for the heading. + * If the heading is a string, it will be used as the text of the heading and + * the level will default to 'h2'. + * + * Headings should be used on navigation menus and any list of links that + * consistently appears on multiple pages. To make the heading invisible use + * the 'visually-hidden' CSS class. Do not use 'display:none', which + * removes it from screen readers and assistive technology. Headings allow + * screen reader and keyboard only users to navigate to or skip the links. + * See http://juicystudio.com/article/screen-readers-display-none.php and + * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. + * + * @see template_preprocess_links() + * + * @ingroup themeable + */ +#} +{% if links %} + +{% endif %} diff --git a/templates/content/mark.html.twig b/templates/content/mark.html.twig new file mode 100644 index 0000000..9219915 --- /dev/null +++ b/templates/content/mark.html.twig @@ -0,0 +1,20 @@ +{# +/** + * @file + * Theme override for a marker for new or updated content. + * + * Available variables: + * - status: Number representing the marker status to display. Use the constants + * below for comparison: + * - MARK_NEW + * - MARK_UPDATED + * - MARK_READ + */ +#} +{% if logged_in %} + {% if status is constant('MARK_NEW') %} + {{ 'New'|t }} + {% elseif status is constant('MARK_UPDATED') %} + {{ 'Updated'|t }} + {% endif %} +{% endif %} diff --git a/templates/content/media.html.twig b/templates/content/media.html.twig new file mode 100644 index 0000000..422030e --- /dev/null +++ b/templates/content/media.html.twig @@ -0,0 +1,28 @@ +{# +/** + * @file + * Theme override to display a media item. + * + * Available variables: + * - name: Name of the media. + * - content: Media content. + * + * @see template_preprocess_media() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'media', + 'media--type-' ~ media.bundle()|clean_class, + not media.isPublished() ? 'media--unpublished', + view_mode ? 'media--view-mode-' ~ view_mode|clean_class, + ] +%} + + {{ title_suffix.contextual_links }} + {% if content %} + {{ content }} + {% endif %} + diff --git a/templates/content/node.html.twig b/templates/content/node.html.twig new file mode 100644 index 0000000..0183792 --- /dev/null +++ b/templates/content/node.html.twig @@ -0,0 +1,105 @@ +{# +/** + * @file + * Theme override to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * - readmore: Flag for more state. Will be true if the teaser content of the + * node cannot hold the main body content. + * - logged_in: Flag for authenticated user status. Will be true when the + * current user is a logged-in member. + * - is_admin: Flag for admin user status. Will be true when the current user + * is an administrator. + * + * @see template_preprocess_node() + * + */ +#} +{% + set classes = [ + 'node', + 'node--type-' ~ node.bundle|clean_class, + node.isPromoted() ? 'node--promoted', + node.isSticky() ? 'node--sticky', + not node.isPublished() ? 'node--unpublished', + view_mode ? 'node--view-mode-' ~ view_mode|clean_class, + ] +%} +{{ attach_library('islandscholar/node') }} + + + {{ title_prefix }} + {% if label and not page %} + + {{ label }} + + {% endif %} + {{ title_suffix }} + + {% if display_submitted %} +
+ {{ author_picture }} + + {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %} + {{ metadata }} + +
+ {% endif %} + + + {{ content }} + + + diff --git a/templates/content/page-title.html.twig b/templates/content/page-title.html.twig new file mode 100644 index 0000000..e1de726 --- /dev/null +++ b/templates/content/page-title.html.twig @@ -0,0 +1,19 @@ +{# +/** + * @file + * Theme override for page titles. + * + * Available variables: + * - title_attributes: HTML attributes for the page title element. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title: The page title, for use in the actual content. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + */ +#} +{{ title_prefix }} +{% if title %} + {{ title }} +{% endif %} +{{ title_suffix }} diff --git a/templates/content/search-result.html.twig b/templates/content/search-result.html.twig new file mode 100644 index 0000000..b1a99b9 --- /dev/null +++ b/templates/content/search-result.html.twig @@ -0,0 +1,72 @@ +{# +/** + * @file + * Theme override for displaying a single search result. + * + * This template renders a single search result. The list of results is + * rendered using '#theme' => 'item_list', with suggestions of: + * - item_list__search_results__(plugin_id) + * - item_list__search_results + * + * Available variables: + * - url: URL of the result. + * - title: Title of the result. + * - snippet: A small preview of the result. Does not apply to user searches. + * - info: String of all the meta information ready for print. Does not apply + * to user searches. + * - plugin_id: The machine-readable name of the plugin being executed,such + * as "node_search" or "user_search". + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - info_split: Contains same data as info, but split into separate parts. + * - info_split.type: Node type (or item type string supplied by module). + * - info_split.user: Author of the node linked to users profile. Depends + * on permission. + * - info_split.date: Last update of the node. Short formatted. + * - info_split.comment: Number of comments output as "% comments", % + * being the count. (Depends on comment.module). + * @todo The info variable needs to be made drillable and each of these sub + * items should instead be within info and renamed info.foo, info.bar, etc. + * + * Other variables: + * - title_attributes: HTML attributes for the title. + * - content_attributes: HTML attributes for the content. + * + * Since info_split is keyed, a direct print of the item is possible. + * This array does not apply to user searches so it is recommended to check + * for its existence before printing. The default keys of 'type', 'user' and + * 'date' always exist for node searches. Modules may provide other data. + * @code + * {% if (info_split.comment) %} + * + * {{ info_split.comment }} + * + * {% endif %} + * @endcode + * + * To check for all available data within info_split, use the code below. + * @code + *
+ *     {{ dump(info_split) }}
+ *   
+ * @endcode + * + * @see template_preprocess_search_result() + */ +#} +{{ attach_library('islandscholar/search-results') }} +{{ title_prefix }} + + {{ title }} + +{{ title_suffix }} +
+ {% if snippet %} + {{ snippet }}

+ {% endif %} + {% if info %} +

{{ info }}

+ {% endif %} +
diff --git a/templates/content/taxonomy-term.html.twig b/templates/content/taxonomy-term.html.twig new file mode 100644 index 0000000..6478b50 --- /dev/null +++ b/templates/content/taxonomy-term.html.twig @@ -0,0 +1,41 @@ +{# +/** + * @file + * Theme override to display a taxonomy term. + * + * Available variables: + * - url: URL of the current term. + * - name: (optional) Name of the current term. + * - content: Items for the content of the term (fields and description). + * Use 'content' to print them all, or print a subset such as + * 'content.description'. Use the following code to exclude the + * printing of a given child element: + * @code + * {{ content|without('description') }} + * @endcode + * - attributes: HTML attributes for the wrapper. + * - page: Flag for the full page state. + * - term: The taxonomy term entity, including: + * - id: The ID of the taxonomy term. + * - bundle: Machine name of the current vocabulary. + * - view_mode: View mode, e.g. 'full', 'teaser', etc. + * + * @see template_preprocess_taxonomy_term() + */ +#} +{% + set classes = [ + 'taxonomy-term', + 'vocabulary-' ~ term.bundle|clean_class, + ] +%} + + {{ title_prefix }} + {% if name and not page %} +

{{ name }}

+ {% endif %} + {{ title_suffix }} +
+ {{ content }} +
+ diff --git a/templates/dataset/item-list--search-results.html.twig b/templates/dataset/item-list--search-results.html.twig new file mode 100644 index 0000000..e9928fd --- /dev/null +++ b/templates/dataset/item-list--search-results.html.twig @@ -0,0 +1,29 @@ +{% extends "item-list.html.twig" %} +{# +/** + * @file + * Theme override for an item list of search results. + * + * Available variables: + * - items: A list of items. Each item contains: + * - attributes: HTML attributes to be applied to each list item. + * - value: The content of the list element. + * - title: The title of the list. + * - list_type: The tag for list element ("ul" or "ol"). + * - attributes: HTML attributes to be applied to the list. + * - empty: A message to display when there are no items. Allowed value is a + * string or render array. + * - context: An list of contextual data associated with the list. For search + * results, the following data is set: + * - plugin: The search plugin ID, for example "node_search". + * + * @see template_preprocess_item_list() + */ +#} +{% + set classes = [ + 'search-results', + context.plugin ~ '-results', + ] +%} +{% set attributes = attributes.addClass(classes) %} diff --git a/templates/dataset/item-list.html.twig b/templates/dataset/item-list.html.twig new file mode 100644 index 0000000..20541b0 --- /dev/null +++ b/templates/dataset/item-list.html.twig @@ -0,0 +1,41 @@ +{# +/** + * @file + * Theme override for an item list. + * + * Available variables: + * - items: A list of items. Each item contains: + * - attributes: HTML attributes to be applied to each list item. + * - value: The content of the list element. + * - title: The title of the list. + * - list_type: The tag for list element ("ul" or "ol"). + * - wrapper_attributes: HTML attributes to be applied to the list wrapper. + * - attributes: HTML attributes to be applied to the list. + * - empty: A message to display when there are no items. Allowed value is a + * string or render array. + * - context: A list of contextual data associated with the list. May contain: + * - list_style: The custom list style. + * + * @see template_preprocess_item_list() + */ +#} +{% if context.list_style %} + {%- set wrapper_attributes = wrapper_attributes.addClass('item-list--' ~ context.list_style) %} + {%- set attributes = attributes.addClass('item-list__' ~ context.list_style) %} +{% endif %} +{% if items or empty -%} + + {%- if title is not empty -%} +

{{ title }}

+ {%- endif -%} + {%- if items -%} + <{{ list_type }}{{ attributes }}> + {%- for item in items -%} + {{ item.value }} + {%- endfor -%} + + {%- else -%} + {{- empty -}} + {%- endif -%} + +{%- endif %} diff --git a/templates/dataset/table.html.twig b/templates/dataset/table.html.twig new file mode 100644 index 0000000..2afa9c1 --- /dev/null +++ b/templates/dataset/table.html.twig @@ -0,0 +1,113 @@ +{# +/** + * @file + * Theme override to display a table. + * + * Available variables: + * - attributes: HTML attributes to apply to the tag. + * - caption: A localized string for the tag. + * Note: Drupal currently supports only one table header row, see + * https://www.drupal.org/node/893530 and + * http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_table/7#comment-5109. + * - header: Table header cells. Each cell contains the following properties: + * - tag: The HTML tag name to use; either 'th' or 'td'. + * - attributes: HTML attributes to apply to the tag. + * - content: A localized string for the title of the column. + * - field: Field name (required for column sorting). + * - sort: Default sort order for this column ("asc" or "desc"). + * - sticky: A flag indicating whether to use a "sticky" table header. + * - rows: Table rows. Each row contains the following properties: + * - attributes: HTML attributes to apply to the tag. + * - data: Table cells. + * - no_striping: A flag indicating that the row should receive no + * 'even / odd' styling. Defaults to FALSE. + * - cells: Table cells of the row. Each cell contains the following keys: + * - tag: The HTML tag name to use; either 'th' or 'td'. + * - attributes: Any HTML attributes, such as "colspan", to apply to the + * table cell. + * - content: The string to display in the table cell. + * - active_table_sort: A boolean indicating whether the cell is the active + table sort. + * - footer: Table footer rows, in the same format as the rows variable. + * - empty: The message to display in an extra row if table does not have + * any rows. + * - no_striping: A boolean indicating that the row should receive no striping. + * - header_columns: The number of columns in the header. + * + * @see template_preprocess_table() + */ +#} + + {% if caption %} + + {% endif %} + + {% for colgroup in colgroups %} + {% if colgroup.cols %} + + {% for col in colgroup.cols %} + + {% endfor %} + + {% else %} + + {% endif %} + {% endfor %} + + {% if header %} + + + {% for cell in header %} + {% + set cell_classes = [ + cell.active_table_sort ? 'is-active', + ] + %} + <{{ cell.tag }}{{ cell.attributes.addClass(cell_classes) }}> + {{- cell.content -}} + + {% endfor %} + + + {% endif %} + + {% if rows %} + + {% for row in rows %} + {% + set row_classes = [ + not no_striping ? cycle(['odd', 'even'], loop.index0), + ] + %} + + {% for cell in row.cells %} + <{{ cell.tag }}{{ cell.attributes }}> + {{- cell.content -}} + + {% endfor %} + + {% endfor %} + + {% elseif empty %} + + + + + + {% endif %} + {% if footer %} + + {% for row in footer %} + + {% for cell in row.cells %} + <{{ cell.tag }}{{ cell.attributes }}> + {{- cell.content -}} + + {% endfor %} + + {% endfor %} + + {% endif %} +
tag. + * - colgroups: Column groups. Each group contains the following properties: + * - attributes: HTML attributes to apply to the
{{ caption }}
{{ empty }}
diff --git a/templates/field/field--comment.html.twig b/templates/field/field--comment.html.twig new file mode 100644 index 0000000..1ec3ee6 --- /dev/null +++ b/templates/field/field--comment.html.twig @@ -0,0 +1,57 @@ +{# +/** + * @file + * Theme override for comment fields. + * + * 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. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional title output populated by modules, intended to + * be displayed after the main title tag that appears in the template. + * - comments: List of comments rendered through comment.html.twig. + * - comment_form: The 'Add new comment' form. + * - comment_display_mode: Is the comments are threaded. + * - comment_type: The comment type bundle ID for the comment field. + * - 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() + * @see comment_preprocess_field() + */ +#} +{% + set classes = [ + 'field', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, + 'comment-wrapper', + ] +%} +{% + set title_classes = [ + 'title', + label_display == 'visually_hidden' ? 'visually-hidden', + ] +%} + + {% if comments and not label_hidden %} + {{ title_prefix }} + {{ label }} + {{ title_suffix }} + {% endif %} + + {{ comments }} + + {% if comment_form %} +

{{ 'Add new comment'|t }}

+ {{ comment_form }} + {% endif %} + + diff --git a/templates/field/field--node--created.html.twig b/templates/field/field--node--created.html.twig new file mode 100644 index 0000000..f4d1acd --- /dev/null +++ b/templates/field/field--node--created.html.twig @@ -0,0 +1,44 @@ +{# +/** + * @file + * Theme override for the node created field. + * + * This is an override of field.html.twig for the node created field. See that + * template for documentation about its details and overrides. + * + * Available variables: + * - attributes: HTML attributes for the containing span element. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item 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. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * ,

and so on. + * + * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 + */ +#} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} +{% + set classes = [ + 'field', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, + ] +%} + + {%- for item in items -%} + {{ item.content }} + {%- endfor -%} + +{% endif %} diff --git a/templates/field/field--node--title.html.twig b/templates/field/field--node--title.html.twig new file mode 100644 index 0000000..e79c39e --- /dev/null +++ b/templates/field/field--node--title.html.twig @@ -0,0 +1,44 @@ +{# +/** + * @file + * Theme override for the node title field. + * + * This is an override of field.html.twig for the node title field. See that + * template for documentation about its details and overrides. + * + * Available variables: + * - attributes: HTML attributes for the containing span element. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item 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. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * ,

and so on. + * + * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 + */ +#} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} +{% + set classes = [ + 'field', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, + ] +%} + + {%- for item in items -%} + {{ item.content }} + {%- endfor -%} + +{% endif %} diff --git a/templates/field/field--node--uid.html.twig b/templates/field/field--node--uid.html.twig new file mode 100644 index 0000000..0a38108 --- /dev/null +++ b/templates/field/field--node--uid.html.twig @@ -0,0 +1,44 @@ +{# +/** + * @file + * Theme override for the node user field. + * + * This is an override of field.html.twig for the node user field. See that + * template for documentation about its details and overrides. + * + * Available variables: + * - attributes: HTML attributes for the containing span element. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item 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. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * ,

and so on. + * + * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 + */ +#} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} +{% + set classes = [ + 'field', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, + ] +%} + + {%- for item in items -%} + {{ item.content }} + {%- endfor -%} + +{% endif %} diff --git a/templates/field/field--text-long.html.twig b/templates/field/field--text-long.html.twig new file mode 100644 index 0000000..07ce721 --- /dev/null +++ b/templates/field/field--text-long.html.twig @@ -0,0 +1 @@ +{% extends "field--text.html.twig" %} diff --git a/templates/field/field--text-with-summary.html.twig b/templates/field/field--text-with-summary.html.twig new file mode 100644 index 0000000..07ce721 --- /dev/null +++ b/templates/field/field--text-with-summary.html.twig @@ -0,0 +1 @@ +{% extends "field--text.html.twig" %} diff --git a/templates/field/field--text.html.twig b/templates/field/field--text.html.twig new file mode 100644 index 0000000..5d1690c --- /dev/null +++ b/templates/field/field--text.html.twig @@ -0,0 +1,28 @@ +{% extends "field.html.twig" %} +{# +/** + * @file + * Default theme implementation for a text field. + * + * A 'clearfix' class is added, because 'text' fields have a 'format' property + * that allows a Text Format to be associated with the entered text, which then + * applies filtering on output. A common use case is to align images to the left + * or right, and without this 'clearfix' class, such aligned images may be + * rendered outside of the 'text' field formatter's boundaries, and hence + * overlap with other fields. By setting the 'clearfix' class on all 'text' + * fields, we prevent that. + * + * @see https://www.drupal.org/node/2358529 + * + * A 'text-formatted' class is added to assist with default styling of base + * elements such as paragraphs and lists that may not have classes assigned to + * them. This allows user entered content to have default styling without + * interfering with the styles of other UI components such as system generated + * lists or other dynamic content. + * + * @see https://www.drupal.org/node/2539860 + * + * @ingroup themeable + */ +#} +{% set attributes = attributes.addClass('clearfix', 'text-formatted') %} diff --git a/templates/field/field.html.twig b/templates/field/field.html.twig new file mode 100644 index 0000000..1cfbd65 --- /dev/null +++ b/templates/field/field.html.twig @@ -0,0 +1,81 @@ +{# +/** + * @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', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, + label_display == 'inline' ? 'clearfix', + ] +%} +{% + set title_classes = [ + 'field__label', + label_display == 'visually_hidden' ? 'visually-hidden', + ] +%} + +{% if label_hidden %} + {% if multiple %} + + {% for item in items %} + {{ item.content }} + {% endfor %} + + {% else %} + {% for item in items %} + {{ item.content }} + {% endfor %} + {% endif %} +{% else %} + + {{ label }} + {% if multiple %} +
+ {% endif %} + {% for item in items %} + {{ item.content }}
+ {% endfor %} + {% if multiple %} + + {% endif %} + +{% endif %} diff --git a/templates/field/file-audio.html.twig b/templates/field/file-audio.html.twig new file mode 100644 index 0000000..e1ab43c --- /dev/null +++ b/templates/field/file-audio.html.twig @@ -0,0 +1,23 @@ +{# +/** +* @file +* Default theme implementation to display the file entity as an audio tag. +* +* Available variables: +* - attributes: An array of HTML attributes, intended to be added to the +* audio tag. +* - files: And array of files to be added as sources for the audio tag. Each +* element is an array with the following elements: +* - file: The full file object. +* - source_attributes: An array of HTML attributes for to be added to the +* source tag. +* +* @ingroup themeable +*/ +#} +{{ attach_library('islandscholar/file') }} + diff --git a/templates/field/file-link.html.twig b/templates/field/file-link.html.twig new file mode 100644 index 0000000..44808e8 --- /dev/null +++ b/templates/field/file-link.html.twig @@ -0,0 +1,16 @@ +{# +/** + * @file + * Theme override for a link to a file. + * + * Available variables: + * - attributes: The HTML attributes for the containing element. + * - link: A link to the file. + * - icon: The icon image representing the file type. + * - file_size: The size of the file. + * + * @see template_preprocess_file_link() + */ +#} +{{ attach_library('islandscholar/file') }} +{{ icon }} {{ link }} diff --git a/templates/field/file-video.html.twig b/templates/field/file-video.html.twig new file mode 100644 index 0000000..ef4535b --- /dev/null +++ b/templates/field/file-video.html.twig @@ -0,0 +1,23 @@ +{# +/** +* @file +* Default theme implementation to display the file entity as a video tag. +* +* Available variables: +* - attributes: An array of HTML attributes, intended to be added to the +* video tag. +* - files: And array of files to be added as sources for the video tag. Each +* element is an array with the following elements: +* - file: The full file object. +* - source_attributes: An array of HTML attributes for to be added to the +* source tag. +* +* @ingroup themeable +*/ +#} +{{ attach_library('islandscholar/file') }} + diff --git a/templates/field/image-formatter.html.twig b/templates/field/image-formatter.html.twig new file mode 100644 index 0000000..512d758 --- /dev/null +++ b/templates/field/image-formatter.html.twig @@ -0,0 +1,18 @@ +{# +/** + * @file + * Theme override to display a formatted image field. + * + * Available variables: + * - image: A collection of image data. + * - image_style: An optional image style. + * - url: An optional URL the image can be linked to. + * + * @see template_preprocess_image_formatter() + */ +#} +{% if url %} + {{ link(image, url) }} +{% else %} + {{ image }} +{% endif %} diff --git a/templates/field/image-style.html.twig b/templates/field/image-style.html.twig new file mode 100644 index 0000000..039089a --- /dev/null +++ b/templates/field/image-style.html.twig @@ -0,0 +1,18 @@ +{# +/** + * @file + * Theme override for an image using a specific image style. + * + * Available variables: + * - attributes: HTML attributes for the image, including the following: + * - src: Full URL or relative path to the image file. + * - class: One or more classes to be applied to the image. + * - width: The width of the image (if known). + * - height: The height of the image (if known). + * - title: The title of the image. + * - alt: The alternative text for the image. + * + * @see template_preprocess_image_style() + */ +#} +{{ image }} diff --git a/templates/field/image.html.twig b/templates/field/image.html.twig new file mode 100644 index 0000000..31f782b --- /dev/null +++ b/templates/field/image.html.twig @@ -0,0 +1,18 @@ +{# +/** + * @file + * Theme override of an image. + * + * Available variables: + * - attributes: HTML attributes for the img tag. + * - style_name: (optional) The name of the image style applied. + * + * @see template_preprocess_image() + */ +#} +{% +set classes = [ + style_name ? 'image-style-' ~ style_name|clean_class, +] +%} + diff --git a/templates/field/link-formatter-link-separate.html.twig b/templates/field/link-formatter-link-separate.html.twig new file mode 100644 index 0000000..52c8d29 --- /dev/null +++ b/templates/field/link-formatter-link-separate.html.twig @@ -0,0 +1,22 @@ +{# +/** + * @file + * Theme override of a link with separate title and URL elements. + * + * Available variables: + * - link: The link that has already been formatted by l(). + * - title: (optional) A descriptive or alternate title for the link, which may + * be different than the actual link text. + * + * @see template_preprocess() + * @see template_preprocess_link_formatter_link_separate() + */ +#} +{% apply spaceless %} + +{% endapply %} diff --git a/templates/field/time.html.twig b/templates/field/time.html.twig new file mode 100644 index 0000000..f2912b7 --- /dev/null +++ b/templates/field/time.html.twig @@ -0,0 +1,22 @@ +{# +/** + * @file + * Theme override for a date / time element. + * + * Available variables + * - timestamp: (optional) A UNIX timestamp for the datetime attribute. If the + * datetime cannot be represented as a UNIX timestamp, use a valid datetime + * attribute value in attributes.datetime. + * - text: (optional) The content to display within the

+{% endif %} +{{ content }} +{% if errors %} +
+ {{ errors }} +
+{% endif %} +{% if description %} + + {{ description }} + +{% endif %} diff --git a/templates/form/details.html.twig b/templates/form/details.html.twig new file mode 100644 index 0000000..c554096 --- /dev/null +++ b/templates/form/details.html.twig @@ -0,0 +1,44 @@ +{# +/** + * @file + * Theme override for a details element. + * + * Available variables + * - attributes: A list of HTML attributes for the details element. + * - errors: (optional) Any errors for this details element, may not be set. + * - title: (optional) The title of the element, may not be set. + * - summary_attributes: A list of HTML attributes for the summary element. + * - description: (optional) The description of the element, may not be set. + * - children: (optional) The children of the element, may not be set. + * - value: (optional) The value of the element, may not be set. + * + * @see template_preprocess_details() + */ +#} + + {%- if title -%} + {% + set summary_classes = [ + required ? 'js-form-required', + required ? 'form-required', + ] + %} + {{ title }} + {%- endif -%} +
+ {% if errors %} +
+ {{ errors }} +
+ {% endif %} + {%- if description -%} +
{{ description }}
+ {%- endif -%} + {%- if children -%} + {{ children }} + {%- endif -%} + {%- if value -%} + {{ value }} + {%- endif -%} +
+ diff --git a/templates/form/dropbutton-wrapper.html.twig b/templates/form/dropbutton-wrapper.html.twig new file mode 100644 index 0000000..a2bdc21 --- /dev/null +++ b/templates/form/dropbutton-wrapper.html.twig @@ -0,0 +1,20 @@ +{# +/** + * @file + * Theme override for a dropbutton wrapper. + * + * Available variables: + * - children: Contains the child elements of the dropbutton menu. + * + * @see template_preprocess() + */ +#} +{% if children %} + {% apply spaceless %} +
+
+ {{ children }} +
+
+ {% endapply %} +{% endif %} diff --git a/templates/form/field-multiple-value-form.html.twig b/templates/form/field-multiple-value-form.html.twig new file mode 100644 index 0000000..246ac41 --- /dev/null +++ b/templates/form/field-multiple-value-form.html.twig @@ -0,0 +1,42 @@ +{# +/** + * @file + * Theme override for an individual form element. + * + * Available variables for all fields: + * - multiple: Whether there are multiple instances of the field. + * + * Available variables for single cardinality fields: + * - elements: Form elements to be rendered. + * + * Available variables when there are multiple fields. + * - table: Table of field items. + * - description: The description element containing the following properties: + * - content: The description content of the form element. + * - attributes: HTML attributes to apply to the description container. + * - button: "Add another item" button. + * + * @see template_preprocess_field_multiple_value_form() + */ +#} +{% if multiple %} + {% + set classes = [ + 'js-form-item', + 'form-item' + ] + %} + + {{ table }} + {% if description.content %} + {{ description.content }} + {% endif %} + {% if button %} +
{{ button }}
+ {% endif %} + +{% else %} + {% for element in elements %} + {{ element }} + {% endfor %} +{% endif %} diff --git a/templates/form/fieldset.html.twig b/templates/form/fieldset.html.twig new file mode 100644 index 0000000..db63082 --- /dev/null +++ b/templates/form/fieldset.html.twig @@ -0,0 +1,60 @@ +{# +/** + * @file + * Theme override for a fieldset element and its children. + * + * Available variables: + * - attributes: HTML attributes for the fieldset element. + * - errors: (optional) Any errors for this fieldset element, may not be set. + * - required: Boolean indicating whether the fieldset element is required. + * - legend: The legend element containing the following properties: + * - title: Title of the fieldset, intended for use as the text of the legend. + * - attributes: HTML attributes to apply to the legend. + * - description: The description element containing the following properties: + * - content: The description content of the fieldset. + * - attributes: HTML attributes to apply to the description container. + * - children: The rendered child elements of the fieldset. + * - prefix: The content to add before the fieldset children. + * - suffix: The content to add after the fieldset children. + * + * @see template_preprocess_fieldset() + */ +#} +{% + set classes = [ + 'js-form-item', + 'form-item', + 'js-form-wrapper', + 'form-wrapper', + ] +%} + + {% + set legend_span_classes = [ + 'fieldset-legend', + required ? 'js-form-required', + required ? 'form-required', + ] + %} + {# Always wrap fieldset legends in a for CSS positioning. #} + + {{ legend.title }} + +
+ {% if errors %} +
+ {{ errors }} +
+ {% endif %} + {% if prefix %} + {{ prefix }} + {% endif %} + {{ children }} + {% if suffix %} + {{ suffix }} + {% endif %} + {% if description.content %} + {{ description.content }}
+ {% endif %} + + diff --git a/templates/form/form-element-label.html.twig b/templates/form/form-element-label.html.twig new file mode 100644 index 0000000..7c2f8f2 --- /dev/null +++ b/templates/form/form-element-label.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Theme override for a form element label. + * + * Available variables: + * - title: The label's text. + * - title_display: Elements title_display setting. + * - required: An indicator for whether the associated form element is required. + * - attributes: A list of HTML attributes for the label. + * + * @see template_preprocess_form_element_label() + */ +#} +{% + set classes = [ + title_display == 'after' ? 'option', + title_display == 'invisible' ? 'visually-hidden', + required ? 'js-form-required', + required ? 'form-required', + ] +%} +{% if title is not empty or required -%} + {{ title }} +{%- endif %} diff --git a/templates/form/form-element.html.twig b/templates/form/form-element.html.twig new file mode 100644 index 0000000..3bde4f7 --- /dev/null +++ b/templates/form/form-element.html.twig @@ -0,0 +1,95 @@ +{# +/** + * @file + * Theme override for a form element. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - errors: (optional) Any errors for this form element, may not be set. + * - prefix: (optional) The form element prefix, may not be set. + * - suffix: (optional) The form element suffix, may not be set. + * - required: The required marker, or empty if the associated form element is + * not required. + * - type: The type of the element. + * - name: The name of the element. + * - label: A rendered label element. + * - label_display: Label display setting. It can have these values: + * - before: The label is output before the element. This is the default. + * The label includes the #title and the required marker, if #required. + * - after: The label is output after the element. For example, this is used + * for radio and checkbox #type elements. If the #title is empty but the + * field is #required, the label will contain only the required marker. + * - invisible: Labels are critical for screen readers to enable them to + * properly navigate through forms but can be visually distracting. This + * property hides the label for everyone except screen readers. + * - attribute: Set the title attribute on the element to create a tooltip but + * output no label element. This is supported only for checkboxes and radios + * in \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement(). + * It is used where a visual label is not needed, such as a table of + * checkboxes where the row and column provide the context. The tooltip will + * include the title and required marker. + * - description: (optional) A list of description properties containing: + * - content: A description of the form element, may not be set. + * - attributes: (optional) A list of HTML attributes to apply to the + * description content wrapper. Will only be set when description is set. + * - description_display: Description display setting. It can have these values: + * - before: The description is output before the element. + * - after: The description is output after the element. This is the default + * value. + * - invisible: The description is output after the element, hidden visually + * but available to screen readers. + * - disabled: True if the element is disabled. + * - title_display: Title display setting. + * + * @see template_preprocess_form_element() + */ +#} +{% + set classes = [ + 'js-form-item', + 'form-item', + 'js-form-type-' ~ type|clean_class, + 'form-type-' ~ type|clean_class, + 'js-form-item-' ~ name|clean_class, + 'form-item-' ~ name|clean_class, + title_display not in ['after', 'before'] ? 'form-no-label', + disabled == 'disabled' ? 'form-disabled', + errors ? 'form-item--error', + ] +%} +{% + set description_classes = [ + 'description', + description_display == 'invisible' ? 'visually-hidden', + ] +%} + + {% if label_display in ['before', 'invisible'] %} + {{ label }} + {% endif %} + {% if prefix is not empty %} + {{ prefix }} + {% endif %} + {% if description_display == 'before' and description.content %} + + {{ description.content }} + + {% endif %} + {{ children }} + {% if suffix is not empty %} + {{ suffix }} + {% endif %} + {% if label_display == 'after' %} + {{ label }} + {% endif %} + {% if errors %} +
+ {{ errors }} +
+ {% endif %} + {% if description_display in ['after', 'invisible'] and description.content %} + + {{ description.content }} + + {% endif %} + diff --git a/templates/form/form.html.twig b/templates/form/form.html.twig new file mode 100644 index 0000000..97b4b7a --- /dev/null +++ b/templates/form/form.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Theme override for a 'form' element. + * + * Available variables + * - attributes: A list of HTML attributes for the wrapper element. + * - children: The child elements of the form. + * + * @see template_preprocess_form() + */ +#} + + {{ children }} + diff --git a/templates/form/input.html.twig b/templates/form/input.html.twig new file mode 100644 index 0000000..d5cac38 --- /dev/null +++ b/templates/form/input.html.twig @@ -0,0 +1,13 @@ +{# +/** + * @file + * Theme override for an 'input' #type form element. + * + * Available variables: + * - attributes: A list of HTML attributes for the input element. + * - children: Optional additional rendered elements. + * + * @see template_preprocess_input() + */ +#} +{{ children }} diff --git a/templates/form/radios.html.twig b/templates/form/radios.html.twig new file mode 100644 index 0000000..2e4bafd --- /dev/null +++ b/templates/form/radios.html.twig @@ -0,0 +1,13 @@ +{# +/** + * @file + * Theme override for a 'radios' #type form element. + * + * Available variables + * - attributes: A list of HTML attributes for the wrapper element. + * - children: The rendered radios. + * + * @see template_preprocess_radios() + */ +#} +{{ children }} diff --git a/templates/form/select.html.twig b/templates/form/select.html.twig new file mode 100644 index 0000000..9c8a97c --- /dev/null +++ b/templates/form/select.html.twig @@ -0,0 +1,27 @@ +{# +/** + * @file + * Theme override for a select element. + * + * Available variables: + * - attributes: HTML attributes for the +{% endapply %} diff --git a/templates/form/textarea.html.twig b/templates/form/textarea.html.twig new file mode 100644 index 0000000..99e1bde --- /dev/null +++ b/templates/form/textarea.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Theme override for a 'textarea' #type form element. + * + * Available variables + * - wrapper_attributes: A list of HTML attributes for the wrapper element. + * - attributes: A list of HTML attributes for the + diff --git a/templates/layout/html.html.twig b/templates/layout/html.html.twig new file mode 100644 index 0000000..4fe57a0 --- /dev/null +++ b/templates/layout/html.html.twig @@ -0,0 +1,55 @@ +{# +/** + * @file + * Theme override for the basic structure of a single Drupal page. + * + * Variables: + * - logged_in: A flag indicating if user is logged in. + * - root_path: The root path of the current page (e.g., node, admin, user). + * - node_type: The content type for the current node, if the page is a node. + * - head_title: List of text elements that make up the head_title variable. + * May contain one or more of the following: + * - title: The title of the page. + * - name: The name of the site. + * - slogan: The slogan of the site. + * - page_top: Initial rendered markup. This should be printed before 'page'. + * - page: The rendered page markup. + * - page_bottom: Closing rendered markup. This variable should be printed after + * 'page'. + * - db_offline: A flag indicating if the database is offline. + * - placeholder_token: The token for generating head, css, js and js-bottom + * placeholders. + * + * @see template_preprocess_html() + */ +#} +{% + set body_classes = [ + logged_in ? 'user-logged-in', + not root_path ? 'path-frontpage' : 'path-' ~ root_path|clean_class, + node_type ? 'page-node-type-' ~ node_type|clean_class, + db_offline ? 'db-offline', + ] +%} + + + + + {{ head_title|safe_join(' | ') }} + + + + + {# + Keyboard navigation/accessibility link to main content section in + page.html.twig. + #} + + {{ page_top }} + {{ page }} + {{ page_bottom }} + + + diff --git a/templates/layout/maintenance-page.html.twig b/templates/layout/maintenance-page.html.twig new file mode 100644 index 0000000..7463b02 --- /dev/null +++ b/templates/layout/maintenance-page.html.twig @@ -0,0 +1,65 @@ +{# +/** + * @file + * Theme override to display a single Drupal page while offline. + * + * All available variables are mirrored in page.html.twig. + * Some may be blank but they are provided for consistency. + * + * @see template_preprocess_maintenance_page() + */ +#} +
+ +
+ {% if logo %} + + {{ 'Home'|t }} + + {% endif %} + + {% if site_name or site_slogan %} +
+ {% if site_name %} +

+ {{ site_name }} +

+ {% endif %} + + {% if site_slogan %} +
{{ site_slogan }}
+ {% endif %} +
{# /.name-and-slogan #} + {% endif %} + +
+ +
+ {% if title %} +

{{ title }}

+ {% endif %} + + {{ page.highlighted }} + + {{ page.content }} +
+ + {% if page.sidebar_first %} + {# /.layout-sidebar-first #} + {% endif %} + + {% if page.sidebar_second %} + {# /.layout-sidebar-second #} + {% endif %} + + {% if page.footer %} +
+ {{ page.footer }} +
+ {% endif %} + +
{# /.layout-container #} diff --git a/templates/layout/page.html.twig b/templates/layout/page.html.twig new file mode 100644 index 0000000..0f5ba83 --- /dev/null +++ b/templates/layout/page.html.twig @@ -0,0 +1,87 @@ +{# +/** + * @file + * Theme override to display a single page. + * + * The doctype, html, head and body tags are not in this template. Instead they + * can be found in the html.html.twig template in this directory. + * + * Available variables: + * + * General utility variables: + * - base_path: The base URL path of the Drupal installation. Will usually be + * "/" unless you have installed Drupal in a sub-directory. + * - is_front: A flag indicating if the current page is the front page. + * - logged_in: A flag indicating if the user is registered and signed in. + * - is_admin: A flag indicating if the user has permission to access + * administration pages. + * + * Site identity: + * - front_page: The URL of the front page. Use this instead of base_path when + * linking to the front page. This includes the language domain or prefix. + * + * Page content (in order of occurrence in the default page.html.twig): + * - node: Fully loaded node, if there is an automatically-loaded node + * associated with the page and the node ID is the second argument in the + * page's path (e.g. node/12345 and node/12345/revisions, but not + * comment/reply/12345). + * + * Regions: + * - page.header: Items for the header region. + * - page.primary_menu: Items for the primary menu region. + * - page.secondary_menu: Items for the secondary menu region. + * - page.highlighted: Items for the highlighted content region. + * - page.help: Dynamic help text, mostly for admin pages. + * - page.content: The main content of the current page. + * - page.sidebar_first: Items for the first sidebar. + * - page.sidebar_second: Items for the second sidebar. + * - page.footer: Items for the footer region. + * - page.breadcrumb: Items for the breadcrumb region. + * + * @see template_preprocess_page() + * @see html.html.twig + */ +#} +
+ +
+ {{ page.header }} +
+ + {{ page.primary_menu }} + {{ page.secondary_menu }} + + {{ page.breadcrumb }} + + {{ page.highlighted }} + + {{ page.help }} + +
+ {# link is in html.html.twig #} + +
+ {{ page.content }} +
{# /.layout-content #} + + {% if page.sidebar_first %} + + {% endif %} + + {% if page.sidebar_second %} + + {% endif %} + +
+ + {% if page.footer %} +
+ {{ page.footer }} +
+ {% endif %} + +
{# /.layout-container #} diff --git a/templates/layout/region.html.twig b/templates/layout/region.html.twig new file mode 100644 index 0000000..95e71ce --- /dev/null +++ b/templates/layout/region.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Theme override to display a region. + * + * Available variables: + * - content: The content for this region, typically blocks. + * - attributes: HTML attributes for the region
. + * - region: The name of the region variable as defined in the theme's + * .info.yml file. + * + * @see template_preprocess_region() + */ +#} +{% + set classes = [ + 'region', + 'region-' ~ region|clean_class, + ] +%} +{% if content %} + + {{ content }} +
+{% endif %} diff --git a/templates/misc/progress-bar.html.twig b/templates/misc/progress-bar.html.twig new file mode 100644 index 0000000..6bb7517 --- /dev/null +++ b/templates/misc/progress-bar.html.twig @@ -0,0 +1,22 @@ +{# +/** + * @file + * Theme override for a progress bar. + * + * Note that the core Batch API uses this only for non-JavaScript batch jobs. + * + * Available variables: + * - label: The label of the working task. + * - percent: The percentage of the progress. + * - message: A string containing information to be displayed. + */ +#} +{{ attach_library('islandscholar/progress') }} +
+ {% if label %} +
{{ label }}
+ {% endif %} +
+
{{ percent }}%
+
{{ message }}
+
diff --git a/templates/misc/status-messages.html.twig b/templates/misc/status-messages.html.twig new file mode 100644 index 0000000..7dda6c0 --- /dev/null +++ b/templates/misc/status-messages.html.twig @@ -0,0 +1,55 @@ +{# +/** + * @file + * Theme override for status messages. + * + * Displays status, error, and warning messages, grouped by type. + * + * An invisible heading identifies the messages for assistive technology. + * Sighted users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html + * for info. + * + * Add an ARIA label to the contentinfo area so that assistive technology + * user agents will better describe this landmark. + * + * Available variables: + * - message_list: List of messages to be displayed, grouped by type. + * - status_headings: List of all status types. + * - attributes: HTML attributes for the element, including: + * - class: HTML classes. + */ +#} +
+{% block messages %} +{% for type, messages in message_list %} + {% + set classes = [ + 'messages', + 'messages--' ~ type, + ] + %} +
+ {% if type == 'error' %} +
+ {% endif %} + {% if status_headings[type] %} +

{{ status_headings[type] }}

+ {% endif %} + {% if messages|length > 1 %} +
    + {% for message in messages %} +
  • {{ message }}
  • + {% endfor %} +
+ {% else %} + {{ messages|first }} + {% endif %} + {% if type == 'error' %} +
+ {% endif %} +
+ {# Remove type specific classes. #} + {% set attributes = attributes.removeClass(classes) %} +{% endfor %} +{% endblock messages %} +
diff --git a/templates/navigation/breadcrumb.html.twig b/templates/navigation/breadcrumb.html.twig new file mode 100644 index 0000000..7dc08c5 --- /dev/null +++ b/templates/navigation/breadcrumb.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Theme override for a breadcrumb trail. + * + * Available variables: + * - breadcrumb: Breadcrumb trail items. + */ +#} +{% if breadcrumb %} + +{% endif %} diff --git a/templates/navigation/links.html.twig b/templates/navigation/links.html.twig new file mode 100644 index 0000000..8eb0033 --- /dev/null +++ b/templates/navigation/links.html.twig @@ -0,0 +1,55 @@ +{# +/** + * @file + * Theme override for a set of links. + * + * Available variables: + * - attributes: Attributes for the UL containing the list of links. + * - links: Links to be output. + * Each link will have the following elements: + * - link: (optional) A render array that returns a link. See + * template_preprocess_links() for details how it is generated. + * - text: The link text. + * - attributes: HTML attributes for the list item element. + * - text_attributes: (optional) HTML attributes for the span element if no + * 'url' was supplied. + * - heading: (optional) A heading to precede the links. + * - text: The heading text. + * - level: The heading level (e.g. 'h2', 'h3'). + * - attributes: (optional) A keyed list of attributes for the heading. + * If the heading is a string, it will be used as the text of the heading and + * the level will default to 'h2'. + * + * Headings should be used on navigation menus and any list of links that + * consistently appears on multiple pages. To make the heading invisible use + * the 'visually-hidden' CSS class. Do not use 'display:none', which + * removes it from screen readers and assistive technology. Headings allow + * screen reader and keyboard only users to navigate to or skip the links. + * See http://juicystudio.com/article/screen-readers-display-none.php and + * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. + * + * @see template_preprocess_links() + */ +#} +{% if links -%} + {%- if heading -%} + {%- if heading.level -%} + <{{ heading.level }}{{ heading.attributes }}>{{ heading.text }} + {%- else -%} + {{ heading.text }}

+ {%- endif -%} + {%- endif -%} + + {%- for item in links -%} + + {%- if item.link -%} + {{ item.link }} + {%- elseif item.text_attributes -%} + {{ item.text }}
+ {%- else -%} + {{ item.text }} + {%- endif -%} + + {%- endfor -%} + +{%- endif %} diff --git a/templates/navigation/menu-local-action.html.twig b/templates/navigation/menu-local-action.html.twig new file mode 100644 index 0000000..2787283 --- /dev/null +++ b/templates/navigation/menu-local-action.html.twig @@ -0,0 +1,13 @@ +{# +/** + * @file + * Theme override for a single local action link. + * + * Available variables: + * - attributes: HTML attributes for the wrapper element. + * - link: A rendered link element. + * + * @see template_preprocess_menu_local_action() + */ +#} +{{ link }} diff --git a/templates/navigation/menu-local-task.html.twig b/templates/navigation/menu-local-task.html.twig new file mode 100644 index 0000000..b855981 --- /dev/null +++ b/templates/navigation/menu-local-task.html.twig @@ -0,0 +1,17 @@ +{# +/** + * @file + * Theme override for a local task link. + * + * Available variables: + * - attributes: HTML attributes for the wrapper element. + * - is_active: Whether the task item is an active tab. + * - link: A rendered link element. + * + * Note: This template renders the content for each task item in + * menu-local-tasks.html.twig. + * + * @see template_preprocess_menu_local_task() + */ +#} +{{ link }} diff --git a/templates/navigation/menu-local-tasks.html.twig b/templates/navigation/menu-local-tasks.html.twig new file mode 100644 index 0000000..8eb20ab --- /dev/null +++ b/templates/navigation/menu-local-tasks.html.twig @@ -0,0 +1,21 @@ +{# +/** + * @file + * Theme override to display primary and secondary local tasks. + * + * Available variables: + * - primary: HTML list items representing primary tasks. + * - secondary: HTML list items representing secondary tasks. + * + * Each item in these variables (primary and secondary) can be individually + * themed in menu-local-task.html.twig. + */ +#} +{% if primary %} +

{{ 'Primary tabs'|t }}

+
    {{ primary }}
+{% endif %} +{% if secondary %} +

{{ 'Secondary tabs'|t }}

+
    {{ secondary }}
+{% endif %} diff --git a/templates/navigation/menu.html.twig b/templates/navigation/menu.html.twig new file mode 100644 index 0000000..ef04ced --- /dev/null +++ b/templates/navigation/menu.html.twig @@ -0,0 +1,55 @@ +{# +/** + * @file + * Theme override to display a menu. + * + * Available variables: + * - menu_name: The machine name of the menu. + * - items: A nested list of menu items. Each menu item contains: + * - attributes: HTML attributes for the menu item. + * - below: The menu item child items. + * - title: The menu link title. + * - url: The menu link url, instance of \Drupal\Core\Url + * - localized_options: Menu link localized options. + * - is_expanded: TRUE if the link has visible children within the current + * menu tree. + * - is_collapsed: TRUE if the link has children within the current menu tree + * that are not currently visible. + * - in_active_trail: TRUE if the link is in the active trail. + */ +#} +{% import _self as menus %} + +{# + We call a macro which calls itself to render the full tree. + @see https://twig.symfony.com/doc/3.x/tags/macro.html +#} +{{ menus.menu_links(items, attributes, 0) }} + +{% macro menu_links(items, attributes, menu_level) %} + {% import _self as menus %} + {% if items %} + {% if menu_level == 0 %} + + {% else %} + + {% endif %} +{% endmacro %} diff --git a/templates/navigation/pager.html.twig b/templates/navigation/pager.html.twig new file mode 100644 index 0000000..6f863fa --- /dev/null +++ b/templates/navigation/pager.html.twig @@ -0,0 +1,99 @@ +{# +/** + * @file + * Theme override to display a pager. + * + * Available variables: + * - heading_id: Pagination heading ID. + * - items: List of pager items. + * The list is keyed by the following elements: + * - first: Item for the first page; not present on the first page of results. + * - previous: Item for the previous page; not present on the first page + * of results. + * - next: Item for the next page; not present on the last page of results. + * - last: Item for the last page; not present on the last page of results. + * - pages: List of pages, keyed by page number. + * Sub-sub elements: + * items.first, items.previous, items.next, items.last, and each item inside + * items.pages contain the following elements: + * - href: URL with appropriate query parameters for the item. + * - attributes: A keyed list of HTML attributes for the item. + * - text: The visible text used for the item link, such as "‹ Previous" + * or "Next ›". + * - current: The page number of the current page. + * - ellipses: If there are more pages than the quantity allows, then an + * ellipsis before or after the listed pages may be present. + * - previous: Present if the currently visible list of pages does not start + * at the first page. + * - next: Present if the visible list of pages ends before the last page. + * + * @see template_preprocess_pager() + */ +#} +{% if items %} + +{% endif %} diff --git a/templates/navigation/vertical-tabs.html.twig b/templates/navigation/vertical-tabs.html.twig new file mode 100644 index 0000000..5872220 --- /dev/null +++ b/templates/navigation/vertical-tabs.html.twig @@ -0,0 +1,13 @@ +{# +/** + * @file + * Theme override for vertical tabs. + * + * Available variables + * - attributes: A list of HTML attributes for the wrapper element. + * - children: The rendered tabs. + * + * @see template_preprocess_vertical_tabs() + */ +#} +{{ children }} diff --git a/templates/user/user.html.twig b/templates/user/user.html.twig new file mode 100644 index 0000000..9a824ef --- /dev/null +++ b/templates/user/user.html.twig @@ -0,0 +1,23 @@ +{# +/** + * @file + * Theme override to present all user data. + * + * This template is used when viewing a registered user's page, + * e.g., example.com/user/123. 123 being the user's ID. + * + * Available variables: + * - content: A list of content items. Use 'content' to print all content, or + * print a subset such as 'content.field_example'. Fields attached to a user + * such as 'user_picture' are available as 'content.user_picture'. + * - attributes: HTML attributes for the container element. + * - user: A Drupal User entity. + * + * @see template_preprocess_user() + */ +#} + + {% if content %} + {{- content -}} + {% endif %} + diff --git a/templates/user/username.html.twig b/templates/user/username.html.twig new file mode 100644 index 0000000..df694df --- /dev/null +++ b/templates/user/username.html.twig @@ -0,0 +1,29 @@ +{# +/** + * @file + * Theme override for displaying a username. + * + * Available variables: + * - account: The full account information for the user. + * - uid: The user ID, or zero if not a user. As used in anonymous comments. + * - name: The user's name, sanitized, and optionally truncated. + * - name_raw: The user's name, un-truncated. + * - truncated: Whether the user's name was truncated. + * - extra: Additional text to append to the user's name, sanitized. + * - profile_access: Whether the current user has permission to access this + users profile page. + * - link_path: The path or URL of the user's profile page, home page, + * or other desired page to link to for more information about the user. + * - homepage: (optional) The home page of the account, only set for non users. + * - link_options: Options to set on the \Drupal\Core\Url object if linking the + * user's name to the user's page. + * - attributes: HTML attributes for the containing element. + * + * @see template_preprocess_username() + */ +#} +{% if link_path -%} + {{ name }}{{ extra }} +{%- else -%} + {{ name }}{{ extra }} +{%- endif -%} diff --git a/templates/views/views-exposed-form.html.twig b/templates/views/views-exposed-form.html.twig new file mode 100644 index 0000000..3c679ae --- /dev/null +++ b/templates/views/views-exposed-form.html.twig @@ -0,0 +1,21 @@ +{# +/** + * @file + * Theme override for a views exposed form. + * + * Available variables: + * - form: A render element representing the form. + * + * @see template_preprocess_views_exposed_form() + */ +#} +{% if q is not empty %} + {# + This ensures that, if clean URLs are off, the 'q' is added first, + as a hidden form element, so that it shows up first in the POST URL. + #} +{{ q }} +{% endif %} +
+ {{ form }} +
diff --git a/templates/views/views-mini-pager.html.twig b/templates/views/views-mini-pager.html.twig new file mode 100644 index 0000000..4b46f2b --- /dev/null +++ b/templates/views/views-mini-pager.html.twig @@ -0,0 +1,42 @@ +{# +/** + * @file + * Theme override for a views mini-pager. + * + * Available variables: + * - heading_id: Pagination heading ID. + * - items: List of pager items. + * + * @see template_preprocess_views_mini_pager() + */ +#} +{% if items.previous or items.next %} + +{% endif %} diff --git a/templates/views/views-view-grid.html.twig b/templates/views/views-view-grid.html.twig new file mode 100644 index 0000000..8a3a20b --- /dev/null +++ b/templates/views/views-view-grid.html.twig @@ -0,0 +1,76 @@ +{# +/** + * @file + * Theme override for views to display rows in a grid. + * + * Available variables: + * - attributes: HTML attributes for the wrapping element. + * - title: The title of this group of rows. + * - view: The view object. + * - rows: The rendered view results. + * - options: The view plugin style options. + * - row_class_default: A flag indicating whether default classes should be + * used on rows. + * - col_class_default: A flag indicating whether default classes should be + * used on columns. + * - items: A list of grid items. Each item contains a list of rows or columns. + * The order in what comes first (row or column) depends on which alignment + * type is chosen (horizontal or vertical). + * - attributes: HTML attributes for each row or column. + * - content: A list of columns or rows. Each row or column contains: + * - attributes: HTML attributes for each row or column. + * - content: The row or column contents. + * + * @see template_preprocess_views_view_grid() + */ +#} +{% + set classes = [ + 'views-view-grid', + options.alignment, + 'cols-' ~ options.columns, + 'clearfix', + ] +%} +{% if options.row_class_default %} + {% + set row_classes = [ + 'views-row', + options.alignment == 'horizontal' ? 'clearfix', + ] + %} +{% endif %} +{% if options.col_class_default %} + {% + set col_classes = [ + 'views-col', + options.alignment == 'vertical' ? 'clearfix', + ] + %} +{% endif %} +{% if title %} +

{{ title }}

+{% endif %} + + {% if options.alignment == 'horizontal' %} + {% for row in items %} + + {% for column in row.content %} + + {{- column.content -}} + + {% endfor %} + + {% endfor %} + {% else %} + {% for column in items %} + + {% for row in column.content %} + + {{- row.content -}} + + {% endfor %} + + {% endfor %} + {% endif %} + diff --git a/templates/views/views-view-grouping.html.twig b/templates/views/views-view-grouping.html.twig new file mode 100644 index 0000000..44905e5 --- /dev/null +++ b/templates/views/views-view-grouping.html.twig @@ -0,0 +1,20 @@ +{# +/** + * @file + * Theme override to display a single views grouping. + * + * Available variables: + * - view: The view object. + * - grouping: The grouping instruction. + * - grouping_level: A number indicating the hierarchical level of the grouping. + * - title: The group heading. + * - content: The content to be grouped. + * - rows: The rows returned from the view. + * + * @see template_preprocess_views_view_grouping() + */ +#} +
+
{{ title }}
+
{{ content }}
+
diff --git a/templates/views/views-view-list.html.twig b/templates/views/views-view-list.html.twig new file mode 100644 index 0000000..50cc74b --- /dev/null +++ b/templates/views/views-view-list.html.twig @@ -0,0 +1,38 @@ +{# +/** + * @file + * Theme override for a view template to display a list of rows. + * + * Available variables: + * - attributes: HTML attributes for the container. + * - rows: A list of rows for this list. + * - attributes: The row's HTML attributes. + * - content: The row's contents. + * - title: The title of this group of rows. May be empty. + * - list: @todo. + * - type: Starting tag will be either a ul or ol. + * - attributes: HTML attributes for the list element. + * + * @see template_preprocess_views_view_list() + */ +#} +{% if attributes -%} + +{% endif %} + {% if title %} +

{{ title }}

+ {% endif %} + + <{{ list.type }}{{ list.attributes }}> + + {% for row in rows %} + + {{- row.content -}} + + {% endfor %} + + + +{% if attributes -%} + +{% endif %} diff --git a/templates/views/views-view-summary-unformatted.html.twig b/templates/views/views-view-summary-unformatted.html.twig new file mode 100644 index 0000000..151734e --- /dev/null +++ b/templates/views/views-view-summary-unformatted.html.twig @@ -0,0 +1,31 @@ +{# +/** + * @file + * Theme override for unformatted summary links. + * + * Available variables: + * - rows: The rows contained in this view. + * - url: The URL to this row's content. + * - count: The number of items this summary item represents. + * - separator: A separator between each row. + * - attributes: HTML attributes for a row. + * - active: A flag indicating whether the row is active. + * - options: Flags indicating how each row should be displayed. This contains: + * - count: A flag indicating whether the row's 'count' should be displayed. + * - inline: A flag indicating whether the item should be wrapped in an inline + * or block level HTML element. + * + * @see template_preprocess_views_view_summary_unformatted() + */ +#} +{% for row in rows %} + {{ options.inline ? ' + {% if row.separator -%} + {{ row.separator }} + {%- endif %} + {{ row.link }} + {% if options.count %} + ({{ row.count }}) + {% endif %} + {{ options.inline ? '' : '' }} +{% endfor %} diff --git a/templates/views/views-view-summary.html.twig b/templates/views/views-view-summary.html.twig new file mode 100644 index 0000000..3190a45 --- /dev/null +++ b/templates/views/views-view-summary.html.twig @@ -0,0 +1,31 @@ +{# +/** + * @file + * Theme override to display a list of summary lines. + * + * Available variables: + * - rows: The rows contained in this view. + * Each row contains: + * - url: The summary link URL. + * - link: The summary link text. + * - count: The number of items under this grouping. + * - attributes: HTML attributes to apply to each row. + * - active: A flag indicating whether the row is active. + * - options: Flags indicating how the summary should be displayed. + * This contains: + * - count: A flag indicating whether the count should be displayed. + * + * @see template_preprocess_views_view_summary() + */ +#} +
+
    + {% for row in rows %} +
  • {{ row.link }} + {% if options.count %} + ({{ row.count }}) + {% endif %} +
  • + {% endfor %} +
+
diff --git a/templates/views/views-view-table.html.twig b/templates/views/views-view-table.html.twig new file mode 100644 index 0000000..edc1498 --- /dev/null +++ b/templates/views/views-view-table.html.twig @@ -0,0 +1,120 @@ +{# +/** + * @file + * Theme override for displaying a view as a table. + * + * Available variables: + * - attributes: Remaining HTML attributes for the element. + * - class: HTML classes that can be used to style contextually through CSS. + * - title : The title of this group of rows. + * - header: The table header columns. + * - attributes: Remaining HTML attributes for the element. + * - content: HTML classes to apply to each header cell, indexed by + * the header's key. + * - default_classes: A flag indicating whether default classes should be + * used. + * - caption_needed: Is the caption tag needed. + * - caption: The caption for this table. + * - accessibility_description: Extended description for the table details. + * - accessibility_summary: Summary for the table details. + * - rows: Table row items. Rows are keyed by row number. + * - attributes: HTML classes to apply to each row. + * - columns: Row column items. Columns are keyed by column number. + * - attributes: HTML classes to apply to each column. + * - content: The column content. + * - default_classes: A flag indicating whether default classes should be + * used. + * - responsive: A flag indicating whether table is responsive. + * - sticky: A flag indicating whether table header is sticky. + * - summary_element: A render array with table summary information (if any). + * + * @see template_preprocess_views_view_table() + */ +#} +{% + set classes = [ + 'views-table', + 'views-view-table', + 'cols-' ~ header|length, + responsive ? 'responsive-enabled', + sticky ? 'sticky-enabled', + ] +%} + + {% if caption_needed %} + + {% if caption %} + {{ caption }} + {% else %} + {{ title }} + {% endif %} + {% if (summary_element is not empty) %} + {{ summary_element }} + {% endif %} + + {% endif %} + {% if header %} + + + {% for key, column in header %} + {% if column.default_classes %} + {% + set column_classes = [ + 'views-field', + 'views-field-' ~ fields[key], + ] + %} + {% endif %} + + {%- if column.wrapper_element -%} + <{{ column.wrapper_element }}> + {%- if column.url -%} + {{ column.content }}{{ column.sort_indicator }} + {%- else -%} + {{ column.content }}{{ column.sort_indicator }} + {%- endif -%} + + {%- else -%} + {%- if column.url -%} + {{ column.content }}{{ column.sort_indicator }} + {%- else -%} + {{- column.content }}{{ column.sort_indicator }} + {%- endif -%} + {%- endif -%} + + {% endfor %} + + + {% endif %} + + {% for row in rows %} + + {% for key, column in row.columns %} + {% if column.default_classes %} + {% + set column_classes = [ + 'views-field' + ] + %} + {% for field in column.fields %} + {% set column_classes = column_classes|merge(['views-field-' ~ field]) %} + {% endfor %} + {% endif %} + + {%- if column.wrapper_element -%} + <{{ column.wrapper_element }}> + {% for content in column.content %} + {{ content.separator }}{{ content.field_output }} + {% endfor %} + + {%- else -%} + {% for content in column.content %} + {{- content.separator }}{{ content.field_output -}} + {% endfor %} + {%- endif %} + + {% endfor %} + + {% endfor %} + + diff --git a/templates/views/views-view-unformatted.html.twig b/templates/views/views-view-unformatted.html.twig new file mode 100644 index 0000000..534ac9a --- /dev/null +++ b/templates/views/views-view-unformatted.html.twig @@ -0,0 +1,30 @@ +{# +/** + * @file + * Theme override to display a view of unformatted rows. + * + * Available variables: + * - title: The title of this group of rows. May be empty. + * - rows: A list of the view's row items. + * - attributes: The row's HTML attributes. + * - content: The row's content. + * - view: The view object. + * - default_row_class: A flag indicating whether default classes should be + * used on rows. + * + * @see template_preprocess_views_view_unformatted() + */ +#} +{% if title %} +

{{ title }}

+{% endif %} +{% for row in rows %} + {% + set row_classes = [ + default_row_class ? 'views-row', + ] + %} + + {{- row.content -}} + +{% endfor %} diff --git a/templates/views/views-view.html.twig b/templates/views/views-view.html.twig new file mode 100644 index 0000000..251b061 --- /dev/null +++ b/templates/views/views-view.html.twig @@ -0,0 +1,95 @@ +{# +/** + * @file + * Theme override for a main view template. + * + * Available variables: + * - attributes: Remaining HTML attributes for the element. + * - css_name: A CSS-safe version of the view name. + * - css_class: The user-specified classes names, if any. + * - header: The optional header. + * - footer: The optional footer. + * - rows: The results of the view query, if any. + * - empty: The content to display if there are no rows. + * - pager: The optional pager next/prev links to display. + * - exposed: Exposed widget form/info to display. + * - feed_icons: Optional feed icons to display. + * - more: An optional link to the next page of results. + * - title: Title of the view, only used when displaying in the admin preview. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the view title. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the view title. + * - attachment_before: An optional attachment view to be displayed before the + * view content. + * - attachment_after: An optional attachment view to be displayed after the + * view content. + * - dom_id: Unique id for every view being printed to give unique class for + * JavaScript. + * + * @see template_preprocess_views_view() + */ +#} +{% + set classes = [ + 'view', + 'view-' ~ id|clean_class, + 'view-id-' ~ id, + 'view-display-id-' ~ display_id, + dom_id ? 'js-view-dom-id-' ~ dom_id, + ] +%} + + {{ title_prefix }} + {% if title %} + {{ title }} + {% endif %} + {{ title_suffix }} + {% if header %} +
+ {{ header }} +
+ {% endif %} + {% if exposed %} +
+ {{ exposed }} +
+ {% endif %} + {% if attachment_before %} +
+ {{ attachment_before }} +
+ {% endif %} + + {% if rows %} +
+ {{ rows }} +
+ {% elseif empty %} +
+ {{ empty }} +
+ {% endif %} + + {% if pager %} + {{ pager }} + {% endif %} + {% if attachment_after %} +
+ {{ attachment_after }} +
+ {% endif %} + {% if more %} + {{ more }} + {% endif %} + {% if footer %} + + {% endif %} + {% if feed_icons %} +
+ {{ feed_icons }} +
+ {% endif %} +