edit.html.haml 11.1 KB
Newer Older
1 2
- @blank_container = true

3 4 5
.project-edit-container
  .project-edit-errors
  .project-edit-content
6 7
    .panel.panel-default
      .panel-heading
8
        Project settings
D
Dmitriy Zaporozhets 已提交
9
      .panel-body
D
Dmitriy Zaporozhets 已提交
10
        = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit_project form-horizontal fieldset-form" }, authenticity_token: true do |f|
11

12
          %fieldset
D
Dmitriy Zaporozhets 已提交
13
            .form-group.project_name_holder
D
Dmitriy Zaporozhets 已提交
14
              = f.label :name, class: 'control-label' do
D
David Pursehouse 已提交
15
                Project name
D
Dmitriy Zaporozhets 已提交
16
              .col-sm-10
17
                = f.text_field :name, placeholder: "Example Project", class: "form-control", id: "project_name_edit"
18 19


D
Dmitriy Zaporozhets 已提交
20
            .form-group
D
Dmitriy Zaporozhets 已提交
21
              = f.label :description, class: 'control-label' do
22 23
                Project description
                %span.light (optional)
D
Dmitriy Zaporozhets 已提交
24
              .col-sm-10
D
Dmitriy Zaporozhets 已提交
25
                = f.text_area :description, placeholder: "Awesome project", class: "form-control", rows: 3, maxlength: 250
26

27
            - if @project.repository.exists? && @project.repository.branch_names.any?
D
Dmitriy Zaporozhets 已提交
28
              .form-group
D
Dmitriy Zaporozhets 已提交
29
                = f.label :default_branch, "Default Branch", class: 'control-label'
30
                .col-sm-10= f.select(:default_branch, @repository.branch_names, {}, {class: 'select2 select-wide'})
31 32


V
Valery Sizov 已提交
33
          = render 'shared/visibility_level', f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can_change_visibility_level?(@project, current_user), form_model: @project
34

35 36 37
          .form-group
            = f.label :tag_list, "Tags", class: 'control-label'
            .col-sm-10
V
Valery Sizov 已提交
38
              = f.text_field :tag_list, value: @project.tag_list.to_s, maxlength: 2000, class: "form-control"
39
              %p.help-block Separate tags with commas.
40 41 42 43

          %fieldset.features
            %legend
              Features:
D
Dmitriy Zaporozhets 已提交
44
            .form-group
D
Dmitriy Zaporozhets 已提交
45
              .col-sm-offset-2.col-sm-10
D
Dmitriy Zaporozhets 已提交
46
                .checkbox
D
Dmitriy Zaporozhets 已提交
47 48 49 50 51
                  = f.label :issues_enabled do
                    = f.check_box :issues_enabled
                    %strong Issues
                    %br
                    %span.descr Lightweight issue tracking system for this project
52

D
Dmitriy Zaporozhets 已提交
53
            .form-group
D
Dmitriy Zaporozhets 已提交
54
              .col-sm-offset-2.col-sm-10
D
Dmitriy Zaporozhets 已提交
55
                .checkbox
D
Dmitriy Zaporozhets 已提交
56 57 58 59
                  = f.label :merge_requests_enabled do
                    = f.check_box :merge_requests_enabled
                    %strong Merge Requests
                    %br
60 61 62 63 64 65 66 67 68 69
                    %span.descr Submit changes to be merged upstream

            .form-group
              .col-sm-offset-2.col-sm-10
                .checkbox
                  = f.label :builds_enabled do
                    = f.check_box :builds_enabled
                    %strong Builds
                    %br
                    %span.descr Test and deploy your changes before merge
70

D
Dmitriy Zaporozhets 已提交
71
            .form-group
D
Dmitriy Zaporozhets 已提交
72
              .col-sm-offset-2.col-sm-10
D
Dmitriy Zaporozhets 已提交
73
                .checkbox
D
Dmitriy Zaporozhets 已提交
74 75 76 77 78
                  = f.label :wiki_enabled do
                    = f.check_box :wiki_enabled
                    %strong Wiki
                    %br
                    %span.descr Pages for project documentation
79

D
Dmitriy Zaporozhets 已提交
80
            .form-group
D
Dmitriy Zaporozhets 已提交
81
              .col-sm-offset-2.col-sm-10
D
Dmitriy Zaporozhets 已提交
82
                .checkbox
D
Dmitriy Zaporozhets 已提交
83 84 85 86 87
                  = f.label :snippets_enabled do
                    = f.check_box :snippets_enabled
                    %strong Snippets
                    %br
                    %span.descr Share code pastes with others out of git repository
88

89 90 91 92
          %fieldset.features
            %legend
              Project avatar:
            .form-group
93
              .col-sm-offset-2.col-sm-10
94
                - if @project.avatar?
V
Vinnie Okada 已提交
95
                  = project_icon("#{@project.namespace.to_param}/#{@project.to_param}", alt: '', class: 'avatar project-avatar s160')
96 97 98 99 100 101 102
                %p.light
                  - if @project.avatar_in_git
                    Project avatar in repository: #{ @project.avatar_in_git }
                %p.light
                  - if @project.avatar?
                    You can change your project avatar here
                  - else
103
                    You can upload a project avatar here
D
Dmitriy Zaporozhets 已提交
104
                %a.choose-btn.btn.btn-sm.js-choose-project-avatar-button
105 106 107 108 109
                  %i.icon-paper-clip
                  %span Choose File ...
                 
                %span.file_name.js-avatar-filename File name...
                = f.file_field :avatar, class: "js-project-avatar-input hidden"
110
                .light The maximum file size allowed is 200KB.
111 112
                - if @project.avatar?
                  %hr
D
Dmitriy Zaporozhets 已提交
113
                  = link_to 'Remove avatar', namespace_project_avatar_path(@project.namespace, @project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
114 115

          .form-actions
116
            = f.submit 'Save changes', class: "btn btn-save"
117

118 119


120 121
    .danger-settings
      - if can? current_user, :archive_project, @project
D
Dmitriy Zaporozhets 已提交
122 123 124
        - if @project.archived?
          .panel.panel-success
            .panel-heading
125
              Unarchive project
D
Dmitriy Zaporozhets 已提交
126
            .panel-body
127 128 129 130 131 132
              %p
                Unarchiving the project will mark its repository as active.
                %br
                The project can be committed to.
                %br
                %strong Once active this project shows up in the search and on the dashboard.
133 134 135 136 137

              .form-actions
                = link_to 'Unarchive project', unarchive_namespace_project_path(@project.namespace, @project),
                    data: { confirm: "Are you sure that you want to unarchive this project?\nWhen this project is unarchived it is active and can be committed to again." },
                    method: :post, class: "btn btn-success"
D
Dmitriy Zaporozhets 已提交
138 139 140 141 142
        - else
          .panel.panel-warning
            .panel-heading
              Archive project
            .panel-body
143 144 145 146 147 148
              %p
                Archiving the project will mark its repository as read-only.
                %br
                It is hidden from the dashboard and doesn't show up in searches.
                %br
                %strong Archived projects cannot be committed to!
149 150 151 152 153

              .form-actions
                = link_to 'Archive project', archive_namespace_project_path(@project.namespace, @project),
                    data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." },
                    method: :post, class: "btn btn-warning"
154 155 156 157 158 159 160
      - else
        .nothing-here-block Only the project owner can archive a project

      .panel.panel-default.panel.panel-warning
        .panel-heading Rename repository
        .errors-holder
        .panel-body
V
Vinnie Okada 已提交
161
          = form_for([@project.namespace.becomes(Namespace), @project], html: { class: 'form-horizontal' }) do |f|
162 163 164 165 166 167
            .form-group.project_name_holder
              = f.label :name, class: 'control-label' do
                Project name
              .col-sm-9
                .form-group
                  = f.text_field :name, placeholder: "Example Project", class: "form-control"
168 169 170 171 172 173
            .form-group
              = f.label :path, class: 'control-label' do
                %span Path
              .col-sm-9
                .form-group
                  .input-group
174 175
                    .input-group-addon
                      #{URI.join(root_url, @project.namespace.path)}/
176 177 178 179 180 181
                    = f.text_field :path, class: 'form-control'
                    %span.input-group-addon .git
                %ul
                  %li Be careful. Renaming a project's repository can have unintended side effects.
                  %li You will need to update your local repositories to point to the new location.
            .form-actions
182
              = f.submit 'Rename project', class: "btn btn-warning"
183 184 185 186

      - if can?(current_user, :change_namespace, @project)
        .panel.panel-default.panel.panel-danger
          .panel-heading Transfer project
187 188
          .errors-holder
          .panel-body
V
Vinnie Okada 已提交
189
            = form_for([@project.namespace.becomes(Namespace), @project], url: transfer_namespace_project_path(@project.namespace, @project), method: :put, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
190
              .form-group
V
Vinnie Okada 已提交
191
                = label_tag :new_namespace_id, nil, class: 'control-label' do
192
                  %span Namespace
M
Metalaka 已提交
193
                .col-sm-9
194
                  .form-group
V
Vinnie Okada 已提交
195
                    = select_tag :new_namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace', class: 'select2' }
196
                  %ul
197 198
                    %li Be careful. Changing the project's namespace can have unintended side effects.
                    %li You can only transfer the project to namespaces you manage.
199 200
                    %li You will need to update your local repositories to point to the new location.
              .form-actions
201
                = f.submit 'Transfer project', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => transfer_project_message(@project) }
202 203
      - else
        .nothing-here-block Only the project owner can transfer a project
204

D
Douwe Maan 已提交
205 206 207 208 209 210 211 212 213 214 215 216 217 218
      - if @project.forked?
        - if can?(current_user, :remove_fork_project, @project)
          = form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_namespace_project_path(@project.namespace, @project), method: :delete, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
            .panel.panel-default.panel.panel-danger
              .panel-heading Remove fork relationship
              .panel-body
                %p
                  This will remove the fork relationship to source project
                  #{link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)}.
                  %br
                  %strong Once removed, the fork relationship cannot be restored and you will no longer be able to send merge requests to the source.
                = button_to 'Remove fork relationship', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_message(@project) }
        - else
          .nothing-here-block Only the project owner can remove the fork relationship.
219

220 221 222 223
      - if can?(current_user, :remove_project, @project)
        .panel.panel-default.panel.panel-danger
          .panel-heading Remove project
          .panel-body
224
            = form_tag(namespace_project_path(@project.namespace, @project), method: :delete, class: 'form-horizontal') do
225 226 227 228
              %p
                Removing the project will delete its repository and all related resources including issues, merge requests etc.
                %br
                %strong Removed projects cannot be restored!
229

230
              = button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) }
231
      - else
D
Douwe Maan 已提交
232
        .nothing-here-block Only the project owner can remove a project.
233

234

235
.save-project-loader.hide
236
  .center
237
    %h2
S
Sullivan SENECHAL 已提交
238
      %i.fa.fa-spinner.fa-spin
239
      Saving project.
D
Dmitriy Zaporozhets 已提交
240
    %p Please wait a moment, this page will automatically refresh when ready.
241 242 243


= render 'shared/confirm_modal', phrase: @project.path