From 57947f80f450cd461032d2d4e20c28579b03b80a Mon Sep 17 00:00:00 2001 From: MarcEgliP <88040929+MarcEgliP@users.noreply.github.com> Date: Fri, 21 Jun 2024 09:59:18 +0200 Subject: [PATCH] fix additional fields styles (#160) --- app/helpers/contactable_insieme_helper.rb | 2 -- .../_additional_email_fields.html.haml | 16 ++++++++-------- .../contactable/_phone_number_fields.html.haml | 8 +++++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/helpers/contactable_insieme_helper.rb b/app/helpers/contactable_insieme_helper.rb index c4e9f847..b10ab858 100644 --- a/app/helpers/contactable_insieme_helper.rb +++ b/app/helpers/contactable_insieme_helper.rb @@ -13,9 +13,7 @@ def contact_method_label_select(form) translated = contact_method.class.translate_label(value) OpenStruct.new(value: value, translated: translated) end - content_tag(:div, class: 'col-2 d-inline') do form.collection_select(:translated_label, options, :value, :translated, {}, class: 'form-select form-select-sm') - end end end diff --git a/app/views/contactable/_additional_email_fields.html.haml b/app/views/contactable/_additional_email_fields.html.haml index 288a8c51..f071ade1 100644 --- a/app/views/contactable/_additional_email_fields.html.haml +++ b/app/views/contactable/_additional_email_fields.html.haml @@ -3,17 +3,17 @@ -# or later. See the COPYING file at the top-level directory or at -# https://github.com/hitobito/hitobito_insieme. -%div.col-5.inline - = f.input_field(:email, - placeholder: t('.placeholder_value')) -= contact_method_label_select(f) - -%div.col-2.d-inline.row +%div.d-flex.flex-wrap.w-100.align-items-center + %div.col-11.col-md-11.col-lg-5.col-xl-5.col-xxl-4.me-3 + = f.input_field(:email, + placeholder: t('.placeholder_value')) + %div.col-11.col-md-11.col-lg-5.col-xl-5.col-xxl-3.d-flex.flex-row.me-3.mt-1 + = contact_method_label_select(f) - if entry.is_a?(Person) - = f.label(:mailings, class: 'checkbox d-inline') do + = f.label(:mailings, class: 'col-12 col-sm-2 col-md-12 col-lg-3 col-xl-3 col-xxl-2 mt-sm-2 mt-md-0') do = f.check_box(:mailings) %span{rel: 'tooltip', title: t('.tooltip_mailings')} = t(:"activerecord.attributes.additional_emails.mailings") %i.icon.icon-info-sign -= render 'contactable/public_check_box', f: f + = render 'contactable/public_check_box', f: f diff --git a/app/views/contactable/_phone_number_fields.html.haml b/app/views/contactable/_phone_number_fields.html.haml index 2a5d47df..78632a79 100644 --- a/app/views/contactable/_phone_number_fields.html.haml +++ b/app/views/contactable/_phone_number_fields.html.haml @@ -3,7 +3,9 @@ -# or later. See the COPYING file at the top-level directory or at -# https://github.com/hitobito/hitobito. -%div.col-4.inline +%div.d-flex.flex-wrap.w-100.align-items-center + %div.col-11.col-md-5.me-3.mb-1 = f.input_field(:number, placeholder: PhoneNumber.human_attribute_name(:number)) -= contact_method_label_select(f) -= render 'contactable/public_check_box', f: f + %div.col-11.col-md-4.d-flex.flex-row.me-3 + = contact_method_label_select(f) + = render 'contactable/public_check_box', f: f