edit.html.haml 14.2 KB
Newer Older
1
= render "projects/settings/head"
P
Phil Hughes 已提交
2 3 4 5
.project-edit-container
  .row.prepend-top-default
    .col-lg-3.profile-settings-sidebar
      %h4.prepend-top-0
6
        Project settings
P
Phil Hughes 已提交
7
    .col-lg-9
8
      .project-edit-errors
P
Phil Hughes 已提交
9
      = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f|
10
        %fieldset
11 12
          .row
            .form-group.col-md-9
13
              = f.label :name, class: 'label-light', for: 'project_name_edit' do
14 15 16 17 18 19 20 21
                Project name
              = f.text_field :name, class: "form-control", id: "project_name_edit"

            .form-group.col-md-3
              = f.label :id, class: 'label-light' do
                Project ID
              = f.text_field :id, class: 'form-control', readonly: true

P
Phil Hughes 已提交
22 23 24 25 26
          .form-group
            = f.label :description, class: 'label-light' do
              Project description
              %span.light (optional)
            = f.text_area :description, class: "form-control", rows: 3, maxlength: 250
27

P
Phil Hughes 已提交
28
          - unless @project.empty_repo?
29
            .form-group
P
Phil Hughes 已提交
30 31 32 33 34 35 36
              = f.label :default_branch, "Default Branch", class: 'label-light'
              = f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
        .form-group
          = f.label :tag_list, "Tags", class: 'label-light'
          = f.text_field :tag_list, value: @project.tag_list.to_s, maxlength: 2000, class: "form-control"
          %p.help-block Separate tags with commas.
        %hr
37
        %fieldset
P
Phil Hughes 已提交
38
          %h5.prepend-top-0
39
            Sharing & Permissions
A
Annabel Dunstone Gray 已提交
40
          .form_group.prepend-top-20.sharing-and-permissions
41 42 43 44 45 46 47
            .row.js-visibility-select
              .col-md-9
                %label.label-light
                  = label_tag :project_visibility, 'Project Visibility', class: 'label-light'
                  = link_to "(?)", help_page_path("public_access/public_access")
                %span.help-block
              .col-md-3.visibility-select-container
L
Luke "Jared" Bennett 已提交
48
                = render('projects/visibility_select', model_method: :visibility_level, form: f, selected_level: @project.visibility_level)
49 50
            = f.fields_for :project_feature do |feature_fields|
              %fieldset.features
A
Annabel Dunstone Gray 已提交
51 52
                .row
                  .col-md-9.project-feature
53
                    = feature_fields.label :repository_access_level, "Repository", class: 'label-light'
L
Luke "Jared" Bennett 已提交
54
                    %span.help-block View and edit files in this project
55 56
                  .col-md-3.js-repo-access-level
                    = project_feature_access_select(:repository_access_level)
57

A
Annabel Dunstone Gray 已提交
58 59 60 61 62 63
                .row
                  .col-md-9.project-feature.nested
                    = feature_fields.label :merge_requests_access_level, "Merge requests", class: 'label-light'
                    %span.help-block Submit changes to be merged upstream
                  .col-md-3
                    = project_feature_access_select(:merge_requests_access_level)
F
Felipe Artur 已提交
64

A
Annabel Dunstone Gray 已提交
65 66
                .row
                  .col-md-9.project-feature.nested
F
Filipa Lacerda 已提交
67
                    = feature_fields.label :builds_access_level, "Pipelines", class: 'label-light'
A
Annabel Dunstone Gray 已提交
68 69 70
                    %span.help-block Submit, test and deploy your changes before merge
                  .col-md-3
                    = project_feature_access_select(:builds_access_level)
F
Felipe Artur 已提交
71

A
Annabel Dunstone Gray 已提交
72 73 74 75 76 77
                .row
                  .col-md-9.project-feature
                    = feature_fields.label :snippets_access_level, "Snippets", class: 'label-light'
                    %span.help-block Share code pastes with others out of Git repository
                  .col-md-3
                    = project_feature_access_select(:snippets_access_level)
F
Felipe Artur 已提交
78

A
Annabel Dunstone Gray 已提交
79 80 81 82 83 84
                .row
                  .col-md-9.project-feature
                    = feature_fields.label :issues_access_level, "Issues", class: 'label-light'
                    %span.help-block Lightweight issue tracking system for this project
                  .col-md-3
                    = project_feature_access_select(:issues_access_level)
F
Felipe Artur 已提交
85

A
Annabel Dunstone Gray 已提交
86 87 88 89 90 91
                .row
                  .col-md-9.project-feature
                    = feature_fields.label :wiki_access_level, "Wiki", class: 'label-light'
                    %span.help-block Pages for project documentation
                  .col-md-3
                    = project_feature_access_select(:wiki_access_level)
92 93
          .form-group
            = render 'shared/allow_request_access', form: f
94
          - if Gitlab.config.lfs.enabled && current_user.admin?
P
Patricio Cano 已提交
95 96 97 98
            .row
              .col-md-9
                = f.label :lfs_enabled, 'LFS', class: 'label-light'
                %span.help-block
99 100
                  Git Large File Storage
                  = link_to icon('question-circle'), help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs')
P
Patricio Cano 已提交
101 102 103
              .col-md-3
                = f.select :lfs_enabled, [%w(Enabled true), %w(Disabled false)], {}, selected: @project.lfs_enabled?, class: 'pull-right form-control', data: { field: 'lfs_enabled' }

104

105
        - if Gitlab.config.registry.enabled
106
          .form-group.js-container-registry{ style: ("display: none;" if @project.project_feature.send(:repository_access_level) == 0) }
107 108 109 110 111 112 113
            .checkbox
              = f.label :container_registry_enabled do
                = f.check_box :container_registry_enabled
                %strong Container Registry
                %br
                %span.descr Enable Container Registry for this project
                = link_to icon('question-circle'), help_page_path('user/project/container_registry'), target: '_blank'
F
Felipe Artur 已提交
114

115 116
        = render 'merge_request_settings', form: f

117
        %hr
P
Phil Hughes 已提交
118 119 120 121 122
        %fieldset.features.append-bottom-default
          %h5.prepend-top-0
            Project avatar
          .form-group
            - if @project.avatar?
123
              .avatar-container.s160
124
                = project_icon(@project.full_path, alt: '', class: 'avatar project-avatar s160')
P
Phil Hughes 已提交
125 126 127 128 129 130 131 132 133 134 135 136
            %p.light
              - if @project.avatar_in_git
                Project avatar in repository: #{ @project.avatar_in_git }
            %a.choose-btn.btn.js-choose-project-avatar-button
              Browse file...
            %span.file_name.prepend-left-default.js-avatar-filename No file chosen
            = f.file_field :avatar, class: "js-project-avatar-input hidden"
            .help-block The maximum file size allowed is 200KB.
            - if @project.avatar?
              %hr
              = 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"
        = f.submit 'Save changes', class: "btn btn-save"
K
Kamil Trzcinski 已提交
137

P
Phil Hughes 已提交
138 139 140 141 142 143 144 145 146 147 148 149
  .row.prepend-top-default
  %hr
  .row.prepend-top-default
    .col-lg-3
      %h4.prepend-top-0
        Housekeeping
      %p.append-bottom-0
        %p
          Runs a number of housekeeping tasks within the current repository,
          such as compressing file revisions and removing unreachable objects.
    .col-lg-9
      = link_to 'Housekeeping', housekeeping_namespace_project_path(@project.namespace, @project),
150
          method: :post, class: "btn btn-default"
P
Phil Hughes 已提交
151
  %hr
152 153 154 155 156 157
  .row.prepend-top-default
    .col-lg-3
      %h4.prepend-top-0
        Export project
      %p.append-bottom-0
        %p
158 159 160 161
          Export this project with all its related data in order to move your project to a new GitLab instance. Once the export is finished, you can import the file from the "New Project" page.
        %p
          Once the exported file is ready, you will receive a notification email with a download link.

162 163
    .col-lg-9

164 165 166
      - if @project.export_project_path
        = link_to 'Download export',  download_export_namespace_project_path(@project.namespace, @project),
                method: :get, class: "btn btn-default"
J
James Lopez 已提交
167
        = link_to 'Generate new export',  generate_new_export_namespace_project_path(@project.namespace, @project),
168 169 170
                method: :post, class: "btn btn-default"
      - else
        = link_to 'Export project', export_namespace_project_path(@project.namespace, @project),
171
                method: :post, class: "btn btn-default"
J
James Lopez 已提交
172 173 174 175 176 177

      .bs-callout.bs-callout-info
        %p.append-bottom-0
          %p
            The following items will be exported:
          %ul
178
            %li Project and wiki repositories
J
James Lopez 已提交
179
            %li Project uploads
180 181 182 183 184
            %li Project configuration including web hooks and services
            %li Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, and other project entities
          %p
            The following items will NOT be exported:
          %ul
F
Filipa Lacerda 已提交
185
            %li Job traces and artifacts
186
            %li LFS objects
187
            %li Container registry images
188 189
            %li CI variables
            %li Any encrypted tokens
P
Phil Hughes 已提交
190
  - if can? current_user, :archive_project, @project
191
    %hr
P
Phil Hughes 已提交
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
    .row.prepend-top-default
      .col-lg-3
        %h4.warning-title.prepend-top-0
          - if @project.archived?
            Unarchive project
          - else
            Archive project
        %p.append-bottom-0
          - if @project.archived?
            Unarchiving the project will mark its repository as active. The project can be committed to.
          - else
            Archiving the project will mark its repository as read-only. It is hidden from the dashboard and doesn't show up in searches.
      .col-lg-9
        - if @project.archived?
          %p
            %strong Once active this project shows up in the search and on the dashboard.
          = 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
Douwe Maan 已提交
211
        - else
P
Phil Hughes 已提交
212 213 214 215 216 217 218 219 220 221 222
          %p
            %strong Archived projects cannot be committed to!
          = 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"
  %hr
  .row.prepend-top-default
    .col-lg-3
      %h4.prepend-top-0.warning-title
        Rename repository
    .col-lg-9
223
      = render 'projects/errors'
P
Phil Hughes 已提交
224 225 226 227 228 229 230 231 232 233 234 235
      = form_for([@project.namespace.becomes(Namespace), @project]) do |f|
        .form-group.project_name_holder
          = f.label :name, class: 'label-light' do
            Project name
          .form-group
            = f.text_field :name, class: "form-control"
        .form-group
          = f.label :path, class: 'label-light' do
            %span Path
          .form-group
            .input-group
              .input-group-addon
236
                #{URI.join(root_url, @project.namespace.full_path)}/
P
Phil Hughes 已提交
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
              = f.text_field :path, class: 'form-control'
          %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.
        = f.submit 'Rename project', class: "btn btn-warning"
  - if can?(current_user, :change_namespace, @project)
    %hr
    .row.prepend-top-default
      .col-lg-3
        %h4.prepend-top-0.danger-title
          Transfer project
      .col-lg-9
        = form_for([@project.namespace.becomes(Namespace), @project], url: transfer_namespace_project_path(@project.namespace, @project), method: :put, remote: true) do |f|
          .form-group
            = label_tag :new_namespace_id, nil, class: 'label-light' do
              %span Namespace
            .form-group
              = select_tag :new_namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace', class: 'select2' }
            %ul
              %li Be careful. Changing the project's namespace can have unintended side effects.
              %li You can only transfer the project to namespaces you manage.
              %li You will need to update your local repositories to point to the new location.
              %li Project visibility level will be changed to match namespace rules when transfering to a group.
          = f.submit 'Transfer project', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => transfer_project_message(@project) }
  - if @project.forked? && can?(current_user, :remove_fork_project, @project)
    %hr
    .row.prepend-top-default.append-bottom-default
      .col-lg-3
        %h4.prepend-top-0.danger-title
          Remove fork relationship
        %p.append-bottom-0
          %p
            This will remove the fork relationship to source project
            = succeed "." do
              = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
      .col-lg-9
        = form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_namespace_project_path(@project.namespace, @project), method: :delete, remote: true, html: { class: 'transfer-project' }) do |f|
          %p
            %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) }
  - if can?(current_user, :remove_project, @project)
    %hr
    .row.prepend-top-default.append-bottom-default
      .col-lg-3
        %h4.prepend-top-0.danger-title
          Remove project
        %p.append-bottom-0
          Removing the project will delete its repository and all related resources including issues, merge requests etc.
      .col-lg-9
        = form_tag(namespace_project_path(@project.namespace, @project), method: :delete) do
          %p
            %strong Removed projects cannot be restored!
          = button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) }
290

291
.save-project-loader.hide
292
  .center
293
    %h2
S
Sullivan SENECHAL 已提交
294
      %i.fa.fa-spinner.fa-spin
295
      Saving project.
D
Dmitriy Zaporozhets 已提交
296
    %p Please wait a moment, this page will automatically refresh when ready.
297

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