From 86eee9424970c96c2a63211bc903bf86b8ca7692 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 16 Dec 2014 20:48:40 +0100 Subject: [PATCH] Add hint for ordergroup address in user form --- app/views/shared/_user_form_fields.html.haml | 4 +++- config/locales/en.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_user_form_fields.html.haml b/app/views/shared/_user_form_fields.html.haml index c327924a..afca2598 100644 --- a/app/views/shared/_user_form_fields.html.haml +++ b/app/views/shared/_user_form_fields.html.haml @@ -13,7 +13,9 @@ - if local_assigns[:with_address] && (f.object.ordergroup || f.object.new_record?) = f.fields_for [:ordergroup, f.object.ordergroup || Ordergroup.new] do |ogf| - = ogf.input :contact_address, label: t('activerecord.attributes.ordergroup.contact_address'), required: false + - address_hint = f.object.ordergroup.users.count > 1 ? t('.contact_address_hint') : nil + = ogf.input :contact_address, label: t('activerecord.attributes.ordergroup.contact_address'), required: false, + input_html: { title: address_hint, data: {toggle: 'tooltip', placement: 'right'} } = f.simple_fields_for :settings_attributes do |s| = s.simple_fields_for :profile, defaults: { inline_label: true } do |profile| diff --git a/config/locales/en.yml b/config/locales/en.yml index cf925ed3..a50adf5e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1423,6 +1423,8 @@ en: title: Current orders total_sum: Total sum who_ordered: Who ordered? + user_form_fields: + contact_address_hint: The address of your ordergroup. If you update this, it changes for other members of the ordergroup as well. workgroup_members: title: Group memberships simple_form: