app/views/users/settings.html.slim

Summary

Maintainability
Test Coverage
- title t('.account_settings')
.container
  == render 'shared/flash_messages'

  .page-header
    h1 = yield :title
  p.lead = t('.user_profile_details')

  = simple_form_for @user, validate: true do |f|
    == render 'shared/error_messages', object: f.object

    fieldset
      legend = t('.vehicle_information')
      = f.input :vehicle_avg_consumption do
        .input-group
          = f.text_field :vehicle_avg_consumption, class: 'form-control text-end'
          span.input-group-text = "#{APP_CONFIG.fuel_currency}/km"
      p.form-text
        = t('.vehicle_avg_consumption_help')

    fieldset
      legend = t('.application_settings')
      = f.input :locale, collection: I18n.available_locales.map { |locale| [t('lang_native_name', locale: locale), locale] }, disabled: I18n.available_locales.one?
      = f.input :time_zone, include_blank: false
    fieldset
      legend = t('.send_email')
      = f.input :send_email_messages, as: :boolean
      p.form-text
        = t('.send_email_at_address')
        b< = current_user.email

    .form-group
      = f.button :button, class: 'btn btn-primary', data: { disable_with: t('helpers.disable_with') }