Sha256: 71b7ede0193a9971d221c9e68ec68cd9e67543dc6ef36f30d80873d567982fd8

Contents?: true

Size: 948 Bytes

Versions: 5

Compression:

Stored size: 948 Bytes

Contents

module Effective
  module FormInputs
    class PasswordField < Effective::FormInput

      def input_html_options
        { class: 'form-control effective_password', id: tag_id }
      end

      def input_group_options
        { input_group: { class: 'input-group' }, append: eyes }
      end

      def eyes
        content_tag(:button, icon('eye'),
          class: 'btn input-group-text',
          title: 'Show password',
          'data-effective-password': 'text'
        ) +
        content_tag(:button, icon('eye-off'),
          class: 'btn input-group-text',
          title: 'Hide password',
          style: 'display: none;',
          'data-effective-password': 'password'
        )
      end

      def feedback_options
        case layout
        when :inline
          false
        else
          { valid: { class: 'valid-feedback' }, invalid: { class: 'invalid-feedback' }, reset: true }
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_bootstrap-0.9.18 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.17 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.16 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.15 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.14 app/models/effective/form_inputs/password_field.rb