BigW Consortium Gitlab

_form.html.haml 3.43 KB
Newer Older
gitlabhq committed
1
.user_new
2
  = form_for [:admin, @user], html: { class: 'form-horizontal fieldset-form' } do |f|
3
    = form_errors(@user)
gitlabhq committed
4

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

23
    - if @user.new_record?
24 25
      %fieldset
        %legend Password
26
        .form-group
Dmitriy Zaporozhets committed
27
          = f.label :password, class: 'control-label'
28
          .col-sm-10
29
            %strong
30
              Reset link will be generated and sent to the user.
31
              %br
32
              User will be forced to set the password on first sign in.
33 34 35
    - else
      %fieldset
        %legend Password
36
        .form-group
Dmitriy Zaporozhets committed
37 38
          = f.label :password, class: 'control-label'
          .col-sm-10= f.password_field :password, disabled: f.object.force_random_password, class: 'form-control'
39
        .form-group
Dmitriy Zaporozhets committed
40 41
          = f.label :password_confirmation, class: 'control-label'
          .col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password, class: 'form-control'
42 43 44

    %fieldset
      %legend Access
Dmitriy Zaporozhets committed
45 46 47
      .form-group
        = f.label :projects_limit, class: 'control-label'
        .col-sm-10= f.number_field :projects_limit, class: 'form-control'
48

Dmitriy Zaporozhets committed
49 50 51
      .form-group
        = f.label :can_create_group, class: 'control-label'
        .col-sm-10= f.check_box :can_create_group
52

Dmitriy Zaporozhets committed
53 54
      .form-group
        = f.label :admin, class: 'control-label'
55 56
        - if current_user == @user
          .col-sm-10= f.check_box :admin, disabled: true
57
          .col-sm-10 You cannot remove your own admin rights.
58 59
        - else
          .col-sm-10= f.check_box :admin
Zeger-Jan van de Weg committed
60 61 62 63

      .form-group
        = f.label :external, class: 'control-label'
        .col-sm-10= f.check_box :external
64
        .col-sm-10 External users cannot see internal or private projects unless access is explicitly granted. Also, external users cannot create projects or groups.
Zeger-Jan van de Weg committed
65

66 67
    %fieldset
      %legend Profile
68 69 70 71 72
      .form-group
        = f.label :avatar, class: 'control-label'
        .col-sm-10
          = f.file_field :avatar

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

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