Verified Commit 26e593af authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3439844 by ivnish, KrakenBite, larowlan, smustgrave: Add setting to...

Issue #3439844 by ivnish, KrakenBite, larowlan, smustgrave: Add setting to move comment form after comments
parent 9069a0a9
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,3 +13,4 @@ third_party_settings:
mobile_menu_all_widths: 0
site_branding_bg_color: default
base_primary_color: '#1b9ae4'
comment_form_position: 0
+3 −0
Original line number Diff line number Diff line
@@ -38,3 +38,6 @@ olivero.settings:
    base_primary_color:
      type: color_hex
      label: 'Base Primary Color'
    comment_form_position:
      type: integer
      label: 'Comment form position'
+9 −0
Original line number Diff line number Diff line
@@ -13,3 +13,12 @@ function olivero_post_update_add_olivero_primary_color() {
    ->set('base_primary_color', '#1b9ae4')
    ->save();
}

/**
 * Sets the `comment_form_position` value of Olivero's theme settings.
 */
function olivero_post_update_add_comment_form_position() {
  \Drupal::configFactory()->getEditable('olivero.settings')
    ->set('comment_form_position', 0)
    ->save(TRUE);
}
+2 −0
Original line number Diff line number Diff line
@@ -540,6 +540,8 @@ function olivero_preprocess_field__comment(&$variables) {

    $variables['#cache']['contexts'][] = 'user';
  }

  $variables['comment_form_position'] = theme_get_setting('comment_form_position');
}

/**
+7 −1
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@
    {{ title_suffix }}
  {% endif %}

  {% if comment_form_position %}
    {{ comments }}
  {% endif %}

  {% if comment_form %}
    <div class="add-comment">
      {% if user_picture %}
@@ -57,6 +61,8 @@
    </div>
  {% endif %}

  {% if not comment_form_position %}
    {{ comments }}
  {% endif %}

</section>
Loading