BigW Consortium Gitlab

_form.html.haml 3.28 KB
Newer Older
gitlabhq committed
1
.user_new
2
  = form_for [:admin, @user], html: { class: 'form-horizontal fieldset-form' } do |f|
3
    -if @user.errors.any?
gitlabhq committed
4
      #error_explanation
5
        .alert.alert-danger
6
          - @user.errors.full_messages.each do |msg|
7
            %p= msg
gitlabhq committed
8

9 10
    %fieldset
      %legend Account
11
      .form-group
Dmitriy Zaporozhets committed
12
        = f.label :name, class: 'control-label'
13
        .col-sm-10
Dmitriy Zaporozhets committed
14
          = f.text_field :name, required: true, autocomplete: "off", class: 'form-control'
15
          %span.help-inline * required
16
      .form-group
Dmitriy Zaporozhets committed
17
        = f.label :username, class: 'control-label'
18
        .col-sm-10
Dmitriy Zaporozhets committed
19
          = f.text_field :username, required: true, autocomplete: "off", class: 'form-control'
20
          %span.help-inline * required
21
      .form-group
Dmitriy Zaporozhets committed
22
        = f.label :email, class: 'control-label'
23
        .col-sm-10
Dmitriy Zaporozhets committed
24
          = f.text_field :email, required: true, autocomplete: "off", class: 'form-control'
25
          %span.help-inline * required
26

27
    - if @user.new_record?
28 29
      %fieldset
        %legend Password
30
        .form-group
Dmitriy Zaporozhets committed
31
          = f.label :password, class: 'control-label'
32
          .col-sm-10
33 34 35 36 37 38 39
            %strong
              A temporary password will be generated and sent to user.
              %br
              User will be forced to change it after first sign in
    - else
      %fieldset
        %legend Password
40
        .form-group
Dmitriy Zaporozhets committed
41 42
          = f.label :password, class: 'control-label'
          .col-sm-10= f.password_field :password, disabled: f.object.force_random_password, class: 'form-control'
43
        .form-group
Dmitriy Zaporozhets committed
44 45
          = f.label :password_confirmation, class: 'control-label'
          .col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password, class: 'form-control'
46 47 48

    %fieldset
      %legend Access
Dmitriy Zaporozhets committed
49 50 51
      .form-group
        = f.label :projects_limit, class: 'control-label'
        .col-sm-10= f.number_field :projects_limit, class: 'form-control'
52

Dmitriy Zaporozhets committed
53 54 55
      .form-group
        = f.label :can_create_group, class: 'control-label'
        .col-sm-10= f.check_box :can_create_group
56

Dmitriy Zaporozhets committed
57 58
      .form-group
        = f.label :admin, class: 'control-label'
59 60 61 62 63
        - if current_user == @user
          .col-sm-10= f.check_box :admin, disabled: true
          .col-sm-10 You cannot remove your own admin rights
        - else
          .col-sm-10= f.check_box :admin
64 65
    %fieldset
      %legend Profile
66 67 68 69 70
      .form-group
        = f.label :avatar, class: 'control-label'
        .col-sm-10
          = f.file_field :avatar

71
      .form-group
Dmitriy Zaporozhets committed
72 73
        = f.label :skype, class: 'control-label'
        .col-sm-10= f.text_field :skype, class: 'form-control'
74
      .form-group
Dmitriy Zaporozhets committed
75 76
        = f.label :linkedin, class: 'control-label'
        .col-sm-10= f.text_field :linkedin, class: 'form-control'
77
      .form-group
Dmitriy Zaporozhets committed
78 79
        = f.label :twitter, class: 'control-label'
        .col-sm-10= f.text_field :twitter, class: 'form-control'
Jerome Dalbert committed
80
      .form-group
81
        = f.label :website_url, 'Website', class: 'control-label'
Jerome Dalbert committed
82
        .col-sm-10= f.text_field :website_url, class: 'form-control'
randx committed
83

84
    .form-actions
85
      - if @user.new_record?
86
        = f.submit 'Create user', class: "btn btn-create"
87
        = link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
Tiago Ribeiro committed
88
      - else
89
        = f.submit 'Save changes', class: "btn btn-save"
90
        = link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"