edit.html.haml 3.01 KB
Newer Older
1
.row
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2
3
4
5
6
7
8
9
10
11
12
13
  .span3
    %ul.nav.nav-pills.nav-stacked
      %li.active
        = link_to 'Projects', '#tab-projects', 'data-toggle' => 'tab'
      %li
        = link_to 'Edit Team', '#tab-edit', 'data-toggle' => 'tab'
      %li
        = link_to 'Remove', '#tab-remove', 'data-toggle' => 'tab'

  .span9
    .tab-content
      .tab-pane.active#tab-projects
14
        .ui-box.projects-table
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
          %h5.title Projects
          %ul.well-list
            - @projects.each do |project|
              %li
                - if project.public
                  %i.icon-share
                - else
                  %i.icon-lock.cgreen
                = link_to project.name_with_namespace, project
                .pull-right
                  = link_to 'Edit max access', edit_team_project_path(@team, project), class: "btn btn-small"
                  = link_to 'Relegate', team_project_path(@team, project), confirm: 'Remove project from team and move to global namespace. Are you sure?', method: :delete, class: "btn btn-remove small"
        .form-holder
          = form_tag team_projects_path(@team), id: "assign_projects", class: "bulk_import", method: :post  do
            %table.headless
              %tr
                %td= select_tag :project_ids, options_from_collection_for_select(@avaliable_projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span4'
                %td= select_tag :greatest_project_access, options_for_select(UserTeam.access_roles), {class: "project-access-select chosen" }
                %td= submit_tag 'Add Project', class: "btn btn-create", id: :assign_projects_to_team


      .tab-pane#tab-edit
        .ui-box
          %h5.title Edit Team
          %div.form-holder
            = form_for @team, url: team_path(@team) do |f|
              - if @team.errors.any?
                .alert.alert-error
                  %span= @team.errors.full_messages.first
              .clearfix
                = f.label :name do
                  Team name is
                .input
                  = f.text_field :name, placeholder: "Ex. OpenSource", class: "xlarge left"

              .clearfix.team-description-holder
                = f.label :description, "Details"
                .input
                  = f.text_area :description, maxlength: 250, class: "xlarge js-gfm-input", rows: 4

              .clearfix
                = f.label :path do
                  Team path is
                .input
                  = f.text_field :path, placeholder: "opensource", class: "xlarge left"

              .form-actions
                = f.submit 'Save team changes', class: "btn btn-primary"

      .tab-pane#tab-remove
        .ui-box.ui-box-danger
          %h5.title Remove team
          .ui-box-body
            %p
              Remove of team will cause removing members access to projects.
            %p
              %strong Removed team can not be restored!

            = link_to 'Remove team', team_path(@team), method: :delete, confirm: "You are sure?", class: "btn btn-remove btn-small"