summaryrefslogtreecommitdiff
path: root/app/views/groups/edit.html.haml
blob: 0b15affe785cb92b00fc301a7a8965a9de4e4c35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.row
  .col-md-2
    = render 'settings_nav'
  .col-md-10
    .panel.panel-default
      .panel-heading
        %strong= @group.name
        group settings:
      .panel-body
        = form_for @group, html: { multipart: true, class: "form-horizontal" }, authenticity_token: true do |f|
          - if @group.errors.any?
            .alert.alert-danger
              %span= @group.errors.full_messages.first
          .form-group
            = f.label :name, class: 'control-label' do
              Group name
            .col-sm-10
              = f.text_field :name, placeholder: "Ex. OpenSource", class: "form-control left"

          .form-group.group-description-holder
            = f.label :description, "Details", class: 'control-label'
            .col-sm-10
              = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4

          .form-group
            .col-sm-2
            .col-sm-10
              = image_tag group_icon(@group.to_param), alt: '', class: 'avatar s160'
              %p.light
                - if @group.avatar?
                  You can change your group avatar here
                - else
                  You can upload a group avatar here
              %a.choose-btn.btn.btn-small.js-choose-group-avatar-button
                %i.fa.fa-paperclip
                %span Choose File ...
               
              %span.file_name.js-avatar-filename File name...
              = f.file_field :avatar, class: "js-group-avatar-input hidden"
              .light The maximum file size allowed is 100KB.
              - if @group.avatar?
                %hr
                = link_to 'Remove avatar', group_avatar_path(@group.to_param), data: { confirm: "Group avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-small remove-avatar"

          .form-actions
            = f.submit 'Save group', class: "btn btn-save"

    .panel.panel-danger
      .panel-heading Remove group
      .panel-body
        %p
          Removing group will cause all child projects and resources to be removed.
          %br
          %strong Removed group can not be restored!

        = link_to 'Remove Group', @group, data: {confirm: 'Removed group can not be restored! Are you sure?'}, method: :delete, class: "btn btn-remove"