Commit a1f0bdc8 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider

add some tabindexes so tab form navigation is easyer

parent 42403982
...@@ -53,10 +53,10 @@ module ApplicationHelper ...@@ -53,10 +53,10 @@ module ApplicationHelper
}, class: html_class } }, class: html_class }
end end
def checkbox_toggle_collapse(f, field, collapse_selector, check_shows: true, label_html: nil, type: :boolean, disabled: false) def checkbox_toggle_collapse(f, field, collapse_selector, check_shows: true, label_html: nil, type: :boolean, disabled: false, tabindex: nil)
input_html = { data: { collapse: collapse_selector, check_shows: check_shows }, input_html = { data: { collapse: collapse_selector, check_shows: check_shows },
class: 'checkbox-toggle-collapse', class: 'checkbox-toggle-collapse', disabled: disabled }
disabled: disabled } input_html.merge(tabindex: tabindex) if tabindex
f.input(field, type: type, input_html: input_html, label_html: label_html) f.input(field, type: type, input_html: input_html, label_html: label_html)
end end
......
...@@ -11,23 +11,23 @@ ...@@ -11,23 +11,23 @@
.col-xs-12.col-md-6 .col-xs-12.col-md-6
fieldset fieldset
legend= t_attr(:personal_particulars, Contact) legend= t_attr(:personal_particulars, Contact)
= f.input :salutation, as: :select, collection: Client::SALUTATIONS, include_blank: true = f.input :salutation, as: :select, collection: Client::SALUTATIONS, include_blank: true, input_html: { tabindex: 1 }
= f.simple_fields_for :contact do |c| = f.simple_fields_for :contact do |c|
.row .row
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= c.input :first_name, required: true = c.input :first_name, required: true, input_html: { tabindex: 2 }
= f.input :birth_year, as: :select, collection: Client.year_collection, = f.input :birth_year, as: :select, collection: Client.year_collection,
include_blank: true include_blank: true, input_html: { tabindex: 4 }
= f.input :entry_date = f.input :entry_date, input_html: { tabindex: 6 }
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= c.input :last_name, required: true, label: t_attr(:last_name) = c.input :last_name, required: true, label: t_attr(:last_name), input_html: { tabindex: 3 }
= f.input :nationality, as: :country = f.input :nationality, as: :country, input_html: { tabindex: 5 }
= f.input :permit, collection: Client::PERMITS, as: :radio_buttons = f.input :permit, collection: Client::PERMITS, as: :radio_buttons, input_html: { tabindex: 7 }
= f.simple_fields_for :contact do |c| = f.simple_fields_for :contact do |c|
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= render 'contacts/address_fields', f: c = render 'contacts/address_fields', f: c, tabindex_start: 7
= render 'contacts/phone_fields', f: c = render 'contacts/phone_fields', f: c, tabindex_start: 10
fieldset fieldset
legend Sprachkenntnisse legend Sprachkenntnisse
......
- tabindex_start ||= 0
fieldset fieldset
legend= t_attr(:address, Contact) legend= t_attr(:address, Contact)
.row .row
.col-xs-6 .col-xs-6
= f.input :street, required: true = f.input :street, required: true, input_html: { tabindex: tabindex_start + 1 }
.col-xs-6 .col-xs-6
= f.input :extended = f.input :extended
.row .row
.col-xs-4 .col-xs-4
= f.input :postal_code, required: true = f.input :postal_code, required: true, input_html: { tabindex: tabindex_start + 2 }
.col-xs-8 .col-xs-8
= f.input :city, required: true = f.input :city, required: true, input_html: { tabindex: tabindex_start + 3 }
- tabindex_start ||= 0
fieldset fieldset
legend Telefon und Email legend Telefon und Email
.row .row
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= f.input :primary_email, as: :email, required: f.object.needs_primary_email? = f.input :primary_email, as: :email, required: f.object.needs_primary_email?, input_html: { tabindex: tabindex_start + 1 }
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= f.input :primary_phone, as: :tel, required: f.object.needs_primary_phone? = f.input :primary_phone, as: :tel, required: f.object.needs_primary_phone?, input_html: { tabindex: tabindex_start + 2 }
- if controller_name == 'clients' - if controller_name == 'clients'
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= f.input :secondary_phone, as: :tel = f.input :secondary_phone, as: :tel, input_html: { tabindex: tabindex_start + 3 }
- tabindex_start ||= 0
.row .row
- if !f.object.client? - if !f.object.client?
.col-xs-12.col-md-6= f.input :first_name, required: true .col-xs-12.col-md-6= f.input :first_name, required: true, input_html: { tabindex: tabindex_start + 1 }
.col-xs-12.col-md-6= f.input :last_name, required: true, label: t('generic_keys.last_name') .col-xs-12.col-md-6= f.input :last_name, required: true, label: t('generic_keys.last_name'), input_html: { tabindex: tabindex_start + 2 }
...@@ -43,47 +43,47 @@ ...@@ -43,47 +43,47 @@
= f.input :salutation, = f.input :salutation,
as: :select, as: :select,
collection: Volunteer::SALUTATIONS, collection: Volunteer::SALUTATIONS,
include_blank: true include_blank: true, input_html: { tabindex: 1 }
= render 'contacts/user_fields', f: c = render 'contacts/user_fields', f: c, tabindex_start: 1
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= render 'contacts/address_fields', f: c = render 'contacts/address_fields', f: c, tabindex_start: 3
.col-xs-12.col-md-6 .col-xs-12.col-md-6
.row .row
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= f.input :nationality, as: :country = f.input :nationality, as: :country, input_html: { tabindex: 9 }
= f.input :birth_year, = f.input :birth_year,
as: :select, as: :select,
collection: Volunteer.year_collection, collection: Volunteer.year_collection,
include_blank: true include_blank: true, input_html: { tabindex: 10 }
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= f.input :additional_nationality, as: :country = f.input :additional_nationality, as: :country
= f.input :avatar, as: :file = f.input :avatar, as: :file
.row .row
.col-xs-8 .col-xs-8
= f.input :profession = f.input :profession, input_html: { tabindex: 11 }
.col-xs-4 .col-xs-4
= f.input :working_percent = f.input :working_percent, input_html: { tabindex: 12 }
.col-xs-6 .col-xs-6
= f.input :own_kids = f.input :own_kids, input_html: { tabindex: 13 }
.col-xs-6 .col-xs-6
= f.input :education = f.input :education, input_html: { tabindex: 14 }
.col-xs-12 .col-xs-12
= f.input :motivation = f.input :motivation, input_html: { tabindex: 15 }
.col-xs-12 .col-xs-12
= checkbox_toggle_collapse(f, :experience, '#experience-desc') = checkbox_toggle_collapse(f, :experience, '#experience-desc', tabindex: 16)
.col-xs-12.collapse#experience-desc .col-xs-12.collapse#experience-desc
= f.input :volunteer_experience_desc = f.input :volunteer_experience_desc, input_html: { tabindex: 17 }
.col-xs-12.col-md-6 .col-xs-12.col-md-6
= render 'contacts/phone_fields', f: c = render 'contacts/phone_fields', f: c, tabindex_start: 6
.col-xs-12.col-md-6 .col-xs-12.col-md-6
- if current_user.present? - if current_user.present?
.col-xs-12.col-md-6 .col-xs-12.col-md-6
fieldset.bank-data fieldset.bank-data
legend Bankdaten für Spesen legend Bankdaten für Spesen
= checkbox_toggle_collapse(f, :waive, '.waiver-collapse', check_shows: false) = checkbox_toggle_collapse(f, :waive, '.waiver-collapse', check_shows: false, tabindex: 18)
= f.input :bank, wrapper_html: { class: 'waiver-collapse' } = f.input :bank, wrapper_html: { class: 'waiver-collapse' }, input_html: { tabindex: 19 }
= f.input :iban, wrapper_html: { class: 'waiver-collapse' } = f.input :iban, wrapper_html: { class: 'waiver-collapse' }, input_html: { tabindex: 20 }
.row .row
.col-xs-12.col-md-6 .col-xs-12.col-md-6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment