OSDN Git Service

Ability to manage and remove group as owner outside of admin area
[wvm/gitlab.git] / app / views / projects / _form.html.haml
1 = form_for(@project, remote: true) do |f|
2   - if @project.errors.any?
3     .alert.alert-error
4       %ul
5         - @project.errors.full_messages.each do |msg|
6           %li= msg
7   .clearfix.project_name_holder
8     = f.label :name do
9       Project name is
10     .input
11       = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
12   - unless @repository.heads.empty?
13     .clearfix
14       = f.label :default_branch, "Default Branch"
15       .input= f.select(:default_branch, @repository.heads.map(&:name), {}, style: "width:210px;")
16
17
18   %fieldset.features
19     %legend Features:
20
21     .control-group
22       = f.label :issues_enabled, "Issues", class: 'control-label'
23       .controls
24         = f.check_box :issues_enabled
25         %span.descr Lightweight issue tracking system for this project
26
27     .control-group
28       = f.label :merge_requests_enabled, "Merge Requests", class: 'control-label'
29       .controls
30         = f.check_box :merge_requests_enabled
31         %span.descr Submit changes to be merged upstream.
32
33     .control-group
34       = f.label :wall_enabled, "Wall", class: 'control-label'
35       .controls
36         = f.check_box :wall_enabled
37         %span.descr Simple chat system for broadcasting inside project
38
39     .control-group
40       = f.label :wiki_enabled, "Wiki", class: 'control-label'
41       .controls
42         = f.check_box :wiki_enabled
43         %span.descr Pages for project documentation
44
45   - if can?(current_user, :change_public_mode, @project)
46     %fieldset.features
47       %legend
48         %i.icon-share
49         Public mode:
50       .control-group
51         = f.label :public, class: 'control-label' do
52           %span Public clone access
53         .controls
54           = f.check_box :public
55           %span.descr
56             If checked, this project can be cloned
57             %em without any
58             authentification.
59             It will also be listed on the #{link_to "public access directory", public_root_path}.
60
61
62   - if can? current_user, :change_namespace, @project
63     %fieldset.features
64       %legend Transfer:
65       .control-group
66         = f.label :namespace_id do
67           %span Namespace
68         .controls
69           = f.select :namespace_id, namespaces_options(@project.namespace_id || Namespace::global_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'}
70           %br
71           %ul.prepend-top-10.cred
72             %li Be careful. Changing project namespace can have unintended side effects
73             %li You can transfer project only to namespaces you can manage
74             %li You will need to update your local repositories to point to the new location.
75
76
77   %br
78
79   .actions
80     = f.submit 'Save', class: "btn btn-save"
81     = link_to 'Cancel', @project, class: "btn"
82     - unless @project.new_record?
83       - if can?(current_user, :remove_project, @project)
84         .pull-right
85           = link_to 'Remove Project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn btn-remove"