Sha256: 038745ffe03fa3270ee7f5b1a7d061da0ae728b51e15e09c4e8c5aa59879e547

Contents?: true

Size: 1.63 KB

Versions: 6

Compression:

Stored size: 1.63 KB

Contents

class @AntsAdmins
  constructor: (title='Admins', apiPath='/admin') ->
    config =
      title: title
      showWithParent: true

      arrayStore: new RailsArrayStore({
        resource:    'admin'
        path:        "#{ apiPath }/admins"
        sortBy:      'name'
        searchable:  true
      })

      formSchema:
        name:
          type:        'string'
          required:    true
          label:       "Name"
          placeholder: 'Full name'
          onInitialize: (input) ->
            if input.object
              input.$el.removeClass 'input-required'
              input.config.disabled = true
              input._add_disabled()

        email:
          type:        'string'
          required:    true
          placeholder: 'Email'

          onInitialize: (input) ->
            if input.object
              input.$el.removeClass 'input-required'
              input.config.disabled = true
              input._add_disabled()

              input.$actions   =$ "<span class='input-actions'></span>"
              input.$avatarBtn =$ "<a href='https://en.gravatar.com/' target='_blank'>Update avatar</a>"
              input.$label.append input.$actions
              input.$actions.append input.$avatarBtn

        password:
          type:        'password'
          required:    true
          placeholder: 'Password'
          onInitialize: (input) ->
            if input.object
              input.$el.removeClass 'input-required'
              input.$label.html 'Change Password'
              input.config.placeholder = 'Type new password here to update the current one'
              input._add_placeholder()

    return config

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ants-0.2.8 app/assets/javascripts/ants/admins.coffee
ants-0.2.7 app/assets/javascripts/ants/admins.coffee
ants-0.2.6 app/assets/javascripts/ants/admins.coffee
ants-0.2.5 app/assets/javascripts/ants/admins.coffee
ants-0.2.4 app/assets/javascripts/ants/admins.coffee
ants-0.2.3 app/assets/javascripts/ants/admins.coffee