<commit_before>%section#banner
  = render partial: 'shared/title', locals: { title: "Subscriptions", date: nil }

.row.mt-4
  .col
    %h3= t('subscriptions.mailing_list.title')
    %p.lead= t('subscriptions.mailing_list.summary')
    .row
      .col-3
        - if @member.subscribed_to_newsletter?
          = simple_form_for @mailing_list, url: mailing_lists_path, method: :delete do |f|
            = f.submit t('subscriptions.mailing_list.unsubscribe'), class: 'btn btn-success btn-lg'
        - else
          = simple_form_for @mailing_list, url: mailing_lists_path do |f|
            = f.submit t('subscriptions.mailing_list.subscribe'), class: 'btn btn-success btn-lg'

%hr


.row
  .col
    %p.lead.mb-4= t('subscriptions.summary')

- @groups.group_by(&:chapter).each do |chapter, groups|
  .row.mb-4.border-bottom
    .col
      %h4= chapter.name
  - groups.sort_by(&:name).each do |group|
    .row.mb-3
      .col-9
        %p= group.name
      .col-3.d-flex.justify-content-end
        - if belongs_to_group?(group)
          = simple_form_for :subscription, method: :delete, html: { class: 'w-100' } do |f|
            = f.input :subscription_id, as: :hidden, input_html: { value: nil }
            = f.input :group_id, as: :hidden, input_html: { value: group.id }
            = f.submit "Subscribed", class: 'btn btn-success btn-lg w-100', id: "#{chapter.name.downcase}-#{group.name.downcase}"
        - else
          = simple_form_for :subscription, html: { class: 'w-100' } do |f|
            = f.input :group_id, as: :hidden, input_html: { value: group.id }
            = f.submit "Subscribe", class: 'btn btn-primary btn-lg w-100', id: "#{chapter.name.downcase}-#{group.name.downcase}"<commit_msg>Fixes subscriptions page mobile layout<commit_after>%section#banner
  = render partial: 'shared/title', locals: { title: 'Subscriptions', date: nil }

.row.mt-4
  .col.col-lg-9
    %h3= t('subscriptions.mailing_list.title')
    %p.lead= t('subscriptions.mailing_list.summary')
    - if @member.subscribed_to_newsletter?
      = simple_form_for @mailing_list, url: mailing_lists_path, method: :delete do |f|
        = f.submit t('subscriptions.mailing_list.unsubscribe'), class: 'btn btn-success btn-lg'
    - else
      = simple_form_for @mailing_list, url: mailing_lists_path do |f|
        = f.submit t('subscriptions.mailing_list.subscribe'), class: 'btn btn-success btn-lg'
%hr

.row
  .col.col.col-lg-9
    %p.lead= t('subscriptions.summary')

- @groups.group_by(&:chapter).each do |chapter, groups|
  .row.mb-4.border-bottom
    .col
      %h4= chapter.name
  - groups.sort_by(&:name).each do |group|
    .row.mb-3
      .col
        %p= group.name
      .col.col-md-4.col-lg-3
        - if belongs_to_group?(group)
          = simple_form_for :subscription, method: :delete, html: { class: 'w-100' } do |f|
            = f.input :subscription_id, as: :hidden, input_html: { value: nil }
            = f.input :group_id, as: :hidden, input_html: { value: group.id }
            = f.submit 'Subscribed', class: 'btn btn-success btn-lg w-100', id: "#{chapter.name.downcase}-#{group.name.downcase}"
        - else
          = simple_form_for :subscription, html: { class: 'w-100' } do |f|
            = f.input :group_id, as: :hidden, input_html: { value: group.id }
            = f.submit 'Subscribe', class: 'btn btn-primary btn-lg w-100', id: "#{chapter.name.downcase}-#{group.name.downcase}"
{'fraction_non_alphanumeric': 0.15666178623718888, 'fraction_numerical': 0.012298682284040996, 'mean_word_length': 2.7955555555555556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6945900', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1208, 'n_words': 251}