diff --git a/composer.json b/composer.json index f4765b5..3c7062e 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,8 @@ "require": { "cweagans/composer-patches": "^1.6.0", "oomphinc/composer-installers-extender": "^1.1 || ^2", - "drupal/core": "8.* || 9.*", - "drupal/bootstrap": "3.25" + "drupal/core": "9.* || 10.*", + "drupal/bootstrap": "3.29" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/config/optional/block.block.sidebar.yml b/config/optional/block.block.sidebar.yml index 2fa65a7..a5d681e 100644 --- a/config/optional/block.block.sidebar.yml +++ b/config/optional/block.block.sidebar.yml @@ -33,7 +33,7 @@ settings: render_parent: false visibility: node_type: - id: node_type + id: 'entity_bundle:node' bundles: page: page negate: false diff --git a/config/optional/block.block.sidebar_fr.yml b/config/optional/block.block.sidebar_fr.yml index 166dc76..aa53165 100644 --- a/config/optional/block.block.sidebar_fr.yml +++ b/config/optional/block.block.sidebar_fr.yml @@ -29,7 +29,7 @@ settings: suggestion: sidebar_fr visibility: node_type: - id: node_type + id: 'entity_bundle:node' bundles: page: page negate: false diff --git a/css/ckeditor.css b/css/ckeditor.css deleted file mode 100644 index 4fe412e..0000000 --- a/css/ckeditor.css +++ /dev/null @@ -1,17 +0,0 @@ -@charset "UTF-8"; -/** - * CKEditor styles. - */ -table { - width: 100%; } - -table th { - padding: 8px; - line-height: 1.4375; - font-weight: 700; - border-color: #8d8d8d !important; } - -table td { - padding: 8px; - line-height: 1.4375; - border-color: #8d8d8d !important; } diff --git a/css/ckeditor5.css b/css/ckeditor5.css new file mode 100644 index 0000000..0b5ba19 --- /dev/null +++ b/css/ckeditor5.css @@ -0,0 +1,6 @@ +/** + * CKEditor5 styles. + */ + +.ck-content { + min-height: 250px; } diff --git a/sass/ckeditor.scss b/sass/ckeditor.scss deleted file mode 100644 index 6281639..0000000 --- a/sass/ckeditor.scss +++ /dev/null @@ -1,19 +0,0 @@ -/** - * CKEditor styles. - */ -table { - width: 100%; - - th { - padding: 8px; - line-height: 1.4375; - font-weight: 700; - border-color: #8d8d8d !important; - } - - td { - padding: 8px; - line-height: 1.4375; - border-color: #8d8d8d !important; - } -} diff --git a/sass/ckeditor5.scss b/sass/ckeditor5.scss new file mode 100644 index 0000000..330e296 --- /dev/null +++ b/sass/ckeditor5.scss @@ -0,0 +1,7 @@ +/** + * CKEditor5 styles. + */ + +.ck-content { + min-height: 250px; +} diff --git a/src/Plugin/Preprocess/Comment.php b/src/Plugin/Preprocess/Comment.php index d8b36a6..a6ece26 100644 --- a/src/Plugin/Preprocess/Comment.php +++ b/src/Plugin/Preprocess/Comment.php @@ -19,6 +19,22 @@ class Comment extends PreprocessBase { */ public function preprocessVariables(Variables $variables) { $variables['author'] = \Drupal::service('renderer')->render($elements); + $owner = $variables['comment']->getOwner(); + if (empty($variables['author']) && $owner->id() === 0) { + $variables['author'] = $this->t('Anonymous'); + } + if (empty($variables['author']) && $owner->isAuthenticated()) { + if ($owner->hasField('field_first_name') && $owner->hasField('field_last_name')) { + $first_name = $owner->get('field_first_name')->getString(); + $last_name = $owner->get('field_last_name')->getString(); + if (!empty($first_name) && !empty($last_name)) { + $variables['author'] = $first_name . ' ' . $last_name; + } + } + } + if (empty($variables['author'])) { + $variables['author'] = $variables['comment']->getAuthorName(); + } // Getting the node creation time stamp from the comment object. $date = $variables['comment']->getCreatedTime(); diff --git a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual-fr.html.twig b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual-fr.html.twig index 4cfb224..735f24e 100644 --- a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual-fr.html.twig +++ b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual-fr.html.twig @@ -40,16 +40,16 @@ ] %}
-
- - {{ title_prefix }} + + {{ title_prefix }} + {% if label %}

{{ label }}

- {{ title_suffix }} - {% block content %} -
    - {{ content }} -
- {% endblock %} - -
+ {% endif %} + {{ title_suffix }} + {% block content %} + + {% endblock %} +
diff --git a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual.html.twig b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual.html.twig index 4cfb224..735f24e 100644 --- a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual.html.twig +++ b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-contextual.html.twig @@ -40,16 +40,16 @@ ] %}
-
- - {{ title_prefix }} + + {{ title_prefix }} + {% if label %}

{{ label }}

- {{ title_suffix }} - {% block content %} -
    - {{ content }} -
- {% endblock %} - -
+ {% endif %} + {{ title_suffix }} + {% block content %} + + {% endblock %} +
diff --git a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top-fr.html.twig b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top-fr.html.twig index d8f2ea3..8f700cc 100644 --- a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top-fr.html.twig +++ b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top-fr.html.twig @@ -40,16 +40,14 @@ ] %} diff --git a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top.html.twig b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top.html.twig index d8f2ea3..8f700cc 100644 --- a/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top.html.twig +++ b/templates/block/block--footer--gcweb--wxt-bootstrap-footer-top.html.twig @@ -40,16 +40,14 @@ ] %} diff --git a/templates/file/file-link.html.twig b/templates/file/file-link.html.twig index 54ae38b..e5c87aa 100644 --- a/templates/file/file-link.html.twig +++ b/templates/file/file-link.html.twig @@ -15,7 +15,7 @@ * @see \Drupal\bootstrap\Plugin\Preprocess\FileLink::preprocessVariables */ #} -{% spaceless %} +{% apply spaceless %} {% set classes = [ icon_only ? 'icon-only', @@ -37,4 +37,4 @@ {% endif %} {% endif %} -{% endspaceless %} +{% endapply %} diff --git a/templates/input/input--button--split.html.twig b/templates/input/input--button--split.html.twig index c7d6f01..dfef5f5 100644 --- a/templates/input/input--button--split.html.twig +++ b/templates/input/input--button--split.html.twig @@ -22,15 +22,15 @@ * @see template_preprocess_input() */ #} -{% spaceless %} - {% - set classes = [ + + {% block input %}{% apply spaceless %} + {% + set classes = [ 'btn', type == 'submit' ? 'js-form-submit', icon and icon_position and not icon_only ? 'icon-' ~ icon_position, ] - %} - {% block input %} + %} {% if icon_only %} {{ label }} @@ -54,5 +54,5 @@ {{ 'Toggle Dropdown'|t }} {{ children }} - {% endblock %} -{% endspaceless %} + {% endapply %}{% endblock %} + diff --git a/templates/input/input--button--submit.html.twig b/templates/input/input--button--submit.html.twig index b339f48..82fc345 100644 --- a/templates/input/input--button--submit.html.twig +++ b/templates/input/input--button--submit.html.twig @@ -22,15 +22,14 @@ * @see template_preprocess_input() */ #} -{% spaceless %} - {% - set classes = [ + {% block input %}{% apply spaceless %} + {% + set classes = [ 'btn', type == 'submit' ? 'js-form-submit', icon and icon_position and not icon_only ? 'icon-' ~ icon_position, ] - %} - {% block input %} + %} {% if search_submit == 'true' %} {% if wxt_theme == 'gcweb' %} {{ icon }}{{ 'Search'|t }}{{ children }} @@ -52,5 +51,4 @@ {% endif %} {% endif %} {{ children }} - {% endblock %} -{% endspaceless %} + {% endapply %}{% endblock %} diff --git a/templates/input/input--button.html.twig b/templates/input/input--button.html.twig index 7166b1a..dd86adb 100644 --- a/templates/input/input--button.html.twig +++ b/templates/input/input--button.html.twig @@ -22,15 +22,14 @@ * @see template_preprocess_input() */ #} -{% spaceless %} - {% - set classes = [ + {% block input %}{% apply spaceless %} + {% + set classes = [ 'btn', type == 'submit' ? 'js-form-submit', icon and icon_position and not icon_only ? 'icon-' ~ icon_position, ] - %} - {% block input %} + %} {% if icon and icon_only %} {{ label }} @@ -44,5 +43,4 @@ {% endif %} {% endif %} {{ children }} - {% endblock %} -{% endspaceless %} + {% endapply %}{% endblock %} diff --git a/templates/input/input--form-control.html.twig b/templates/input/input--form-control.html.twig index 5694480..a5b235d 100644 --- a/templates/input/input--form-control.html.twig +++ b/templates/input/input--form-control.html.twig @@ -20,13 +20,13 @@ * @see template_preprocess_input() */ #} -{% spaceless %} - {% - set classes = [ + + {% block input %}{% apply spaceless %} + {% + set classes = [ 'form-control', ] - %} - {% block input %} + %} - {% endblock %} -{% endspaceless %} + {% endapply %}{% endblock %} + diff --git a/templates/input/input.html.twig b/templates/input/input.html.twig index 662a6ab..7ecf9ed 100644 --- a/templates/input/input.html.twig +++ b/templates/input/input.html.twig @@ -19,7 +19,7 @@ * @see template_preprocess_input() */ #} -{% spaceless %} +{% apply spaceless %} {% if input_group %}
{% endif %} @@ -41,4 +41,4 @@ {% endif %} {{ children }} -{% endspaceless %} +{% endapply %} diff --git a/templates/input/select.html.twig b/templates/input/select.html.twig index 8d75f0e..99e14b3 100644 --- a/templates/input/select.html.twig +++ b/templates/input/select.html.twig @@ -15,7 +15,7 @@ * @see template_preprocess_select() */ #} -{% spaceless %} +{% apply spaceless %} {% if input_group %}
{% endif %} @@ -58,4 +58,4 @@ {% if input_group %}
{% endif %} -{% endspaceless %} +{% endapply %} diff --git a/wxt_bootstrap.info.yml b/wxt_bootstrap.info.yml index 8c3aea3..6d994c3 100644 --- a/wxt_bootstrap.info.yml +++ b/wxt_bootstrap.info.yml @@ -1,11 +1,11 @@ name: WxT Bootstrap description: WxT theme(s) support leveraging Bootstrap. type: theme -core_version_requirement: ^8 || ^9 +core_version_requirement: '^9 || ^10' package: 'WxT' base theme: bootstrap -ckeditor_stylesheets: - - css/ckeditor.css +ckeditor5-stylesheets: + - css/ckeditor5.css regions: branding: 'Branding' diff --git a/yarn.lock b/yarn.lock index 0b5b8ef..38a7a73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4374,9 +4374,9 @@ xmlhttprequest-ssl@~1.5.4: integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + version "3.2.2" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" + integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== yallist@^2.1.2: version "2.1.2"