Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

edit.html.haml 11.7 KB
Newer Older
1
- breadcrumb_title "General Settings"
2
- page_title "General"
3
- @content_class = "limit-container-width" unless fluid_layout
4
- expanded = Rails.env.test?
5

tauriedavis's avatar
tauriedavis committed
6
.project-edit-container
7
  %section.settings.general-settings.no-animate#js-general-project-settings{ class: ('expanded' if expanded) }
tauriedavis's avatar
tauriedavis committed
8
9
    .settings-header
      %h4
10
        General project
11
      %button.btn.js-settings-toggle{ type: 'button' }
tauriedavis's avatar
tauriedavis committed
12
13
14
        = expanded ? 'Collapse' : 'Expand'
      %p
        Update your project name, description, avatar, and other general settings.
15
    .settings-content
tauriedavis's avatar
tauriedavis committed
16
      .project-edit-errors
Phil Hughes's avatar
Phil Hughes committed
17
      = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f|
18
        %input{ name: 'update_section', type: 'hidden', value: 'js-general-project-settings' }
Phil Hughes's avatar
Phil Hughes committed
19
20
21
        %fieldset
          .row
            .form-group.col-md-9
22
              = f.label :name, class: 'label-bold', for: 'project_name_edit' do
Phil Hughes's avatar
Phil Hughes committed
23
24
                Project name
              = f.text_field :name, class: "form-control", id: "project_name_edit"
25

Phil Hughes's avatar
Phil Hughes committed
26
            .form-group.col-md-3
27
              = f.label :id, class: 'label-bold' do
Phil Hughes's avatar
Phil Hughes committed
28
29
                Project ID
              = f.text_field :id, class: 'form-control', readonly: true
30

Phil Hughes's avatar
Phil Hughes committed
31
          .form-group
32
            = f.label :description, class: 'label-bold' do
Phil Hughes's avatar
Phil Hughes committed
33
34
35
36
              Project description
              %span.light (optional)
            = f.text_area :description, class: "form-control", rows: 3, maxlength: 250

37
38
39
40
          = render_if_exists 'projects/classification_policy_settings', f: f

        = render_if_exists 'shared/repository_size_limit_setting', form: f, type: :project

Phil Hughes's avatar
Phil Hughes committed
41
        .form-group
42
          = f.label :tag_list, "Tags", class: 'label-bold'
43
          = f.text_field :tag_list, value: @project.tag_list.join(', '), maxlength: 2000, class: "form-control"
44
          %p.form-text.text-muted Separate tags with commas.
Phil Hughes's avatar
Phil Hughes committed
45
        %fieldset.features
46
          %h5.prepend-top-0= _("Project avatar")
Phil Hughes's avatar
Phil Hughes committed
47
48
          .form-group
            - if @project.avatar?
49
              .avatar-container.s160.append-bottom-15
50
                = project_icon(@project, alt: '', class: 'avatar project-avatar s160', width: 160, height: 160)
51
52
53
54
55
            - if @project.avatar_in_git
              %p.light
                = _("Project avatar in repository: %{link}").html_safe % { link: @project.avatar_in_git }
            .prepend-top-5.append-bottom-10
              %button.btn.js-choose-project-avatar-button{ type: 'button' }= _("Choose file...")
56
              %span.file_name.prepend-left-default.js-filename= _("No file chosen")
57
              = f.file_field :avatar, class: "js-project-avatar-input hidden"
58
            .form-text.text-muted= _("The maximum file size allowed is 200KB.")
Phil Hughes's avatar
Phil Hughes committed
59
60
            - if @project.avatar?
              %hr
61
              = link_to _('Remove avatar'), project_avatar_path(@project), data: { confirm: _("Avatar will be removed. Are you sure?") }, method: :delete, class: "btn btn-danger btn-inverted"
62
        = f.submit 'Save changes', class: "btn btn-success js-btn-success-general-project-settings"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
63

64
  %section.settings.sharing-permissions.no-animate#js-shared-permissions{ class: ('expanded' if expanded) }
tauriedavis's avatar
tauriedavis committed
65
66
    .settings-header
      %h4
67
        Permissions
68
      %button.btn.js-settings-toggle{ type: 'button' }
tauriedavis's avatar
tauriedavis committed
69
70
71
        = expanded ? 'Collapse' : 'Expand'
      %p
        Enable or disable certain project features and choose access levels.
72
    .settings-content
tauriedavis's avatar
tauriedavis committed
73
      = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f|
74
        %input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' }
75
        -# haml-lint:disable InlineJavaScript
76
        %script.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data_json(@project)
77
        .js-project-permissions-form
78
        = f.submit 'Save changes', class: "btn btn-success"
79

80
81
  = render_if_exists 'projects/issues_settings'

82
  %section.qa-merge-request-settings.settings.merge-requests-feature.no-animate#js-merge-request-settings{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] }
tauriedavis's avatar
tauriedavis committed
83
84
    .settings-header
      %h4
85
        Merge request
86
      %button.btn.js-settings-toggle{ type: 'button' }
tauriedavis's avatar
tauriedavis committed
87
88
89
        = expanded ? 'Collapse' : 'Expand'
      %p
        Customize your merge request restrictions.
90
    .settings-content
91
92
      = render_if_exists 'shared/promotions/promote_mr_features'

tauriedavis's avatar
tauriedavis committed
93
      = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f|
94
        %input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' }
95
        = render 'projects/merge_request_settings', form: f
96
        = f.submit 'Save changes', class: "btn btn-success qa-save-merge-request-changes"
97

98
99
  = render_if_exists 'projects/merge_request_approvals_settings', expanded: expanded

100
101
  = render_if_exists 'projects/service_desk_settings'

102
103
104
105
106
107
108
109
110
111
112
113
  %section.settings.no-animate{ class: ('expanded' if expanded) }
    .settings-header
      %h4
        = s_('ProjectSettings|Badges')
      %button.btn.js-settings-toggle{ type: 'button' }
        = expanded ? 'Collapse' : 'Expand'
      %p
        = s_('ProjectSettings|Customize your project badges.')
        = link_to s_('ProjectSettings|Learn more about badges.'), help_page_path('user/project/badges')
    .settings-content
      = render 'shared/badges/badge_settings'

114
  = render 'export', project: @project
115

116
  %section.qa-advanced-settings.settings.advanced-settings.no-animate#js-project-advanced-settings{ class: ('expanded' if expanded) }
tauriedavis's avatar
tauriedavis committed
117
118
    .settings-header
      %h4
119
        Advanced
120
      %button.btn.js-settings-toggle{ type: 'button' }
tauriedavis's avatar
tauriedavis committed
121
122
        = expanded ? 'Collapse' : 'Expand'
      %p
123
        Perform advanced options such as housekeeping, archiving, renaming, transferring, or removing your project.
124
    .settings-content
125
      .sub-section
tauriedavis's avatar
tauriedavis committed
126
127
128
129
        %h4 Housekeeping
        %p
          Runs a number of housekeeping tasks within the current repository, such as compressing file revisions and removing unreachable objects.
        = link_to 'Run housekeeping', housekeeping_project_path(@project),
130
            method: :post, class: "btn btn-default"
tauriedavis's avatar
tauriedavis committed
131
132
133
134
135
136
137
138
139
      - if can? current_user, :archive_project, @project
        .sub-section
          %h4.warning-title
            - if @project.archived?
              Unarchive project
            - else
              Archive project
          - if @project.archived?
            %p
140
141
              Unarchiving the project will restore people's ability to make changes to it.
              The repository can be committed to, and issues, comments and other entities can be created.
tauriedavis's avatar
tauriedavis committed
142
143
              %strong Once active this project shows up in the search and on the dashboard.
            = link_to 'Unarchive project', unarchive_project_path(@project),
144
                data: { confirm: "Are you sure that you want to unarchive this project?" },
tauriedavis's avatar
tauriedavis committed
145
146
147
                method: :post, class: "btn btn-success"
          - else
            %p
148
149
              Archiving the project will make it entirely read-only. It is hidden from the dashboard and doesn't show up in searches.
              %strong The repository cannot be committed to, and no issues, comments or other entities can be created.
tauriedavis's avatar
tauriedavis committed
150
            = link_to 'Archive project', archive_project_path(@project),
151
                data: { confirm: "Are you sure that you want to archive this project?" },
tauriedavis's avatar
tauriedavis committed
152
                method: :post, class: "btn btn-warning"
153
      .sub-section.rename-repository
tauriedavis's avatar
tauriedavis committed
154
155
156
157
158
        %h4.warning-title
          Rename repository
        = render 'projects/errors'
        = form_for([@project.namespace.becomes(Namespace), @project]) do |f|
          .form-group.project_name_holder
159
            = f.label :name, class: 'label-bold' do
tauriedavis's avatar
tauriedavis committed
160
161
162
              Project name
            .form-group
              = f.text_field :name, class: "form-control"
Phil Hughes's avatar
Phil Hughes committed
163
          .form-group
164
            = f.label :path, class: 'label-bold' do
tauriedavis's avatar
tauriedavis committed
165
              %span Path
Phil Hughes's avatar
Phil Hughes committed
166
            .form-group
tauriedavis's avatar
tauriedavis committed
167
              .input-group
168
169
                .input-group-prepend
                  .input-group-text
170
                    #{Gitlab::Utils.append_path(root_url, @project.namespace.full_path)}/
tauriedavis's avatar
tauriedavis committed
171
                = f.text_field :path, class: 'form-control'
Phil Hughes's avatar
Phil Hughes committed
172
            %ul
tauriedavis's avatar
tauriedavis committed
173
              %li Be careful. Renaming a project's repository can have unintended side effects.
Phil Hughes's avatar
Phil Hughes committed
174
              %li You will need to update your local repositories to point to the new location.
175
              - if @project.deployment_platform.present?
tauriedavis's avatar
tauriedavis committed
176
177
178
179
180
181
182
183
                %li Your deployment services will be broken, you will need to manually fix the services after renaming.
          = f.submit 'Rename project', class: "btn btn-warning"
      - if can?(current_user, :change_namespace, @project)
        .sub-section
          %h4.danger-title
            Transfer project
          = form_for([@project.namespace.becomes(Namespace), @project], url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } ) do |f|
            .form-group
184
              = label_tag :new_namespace_id, nil, class: 'label-bold' do
tauriedavis's avatar
tauriedavis committed
185
186
187
188
189
190
191
                %span  Select a new namespace
              .form-group
                = select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, 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.
Mehdi Lahmam's avatar
Mehdi Lahmam committed
192
                %li Project visibility level will be changed to match namespace rules when transferring to a group.
tauriedavis's avatar
tauriedavis committed
193
194
195
196
197
            = 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)
        .sub-section
          %h4.danger-title
            Remove fork relationship
Phil Hughes's avatar
Phil Hughes committed
198
          %p
tauriedavis's avatar
tauriedavis committed
199
200
            This will remove the fork relationship to source project
            = succeed "." do
201
202
203
204
              - if @project.fork_source
                = link_to(fork_source_name(@project), project_path(@project.fork_source))
              - else
                = fork_source_name(@project)
tauriedavis's avatar
tauriedavis committed
205
206
207
208
209
210
211
212
          = form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_project_path(@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)
        .sub-section
          %h4.danger-title
            Remove project
Phil Hughes's avatar
Phil Hughes committed
213
          %p
tauriedavis's avatar
tauriedavis committed
214
215
216
217
218
            Removing the project will delete its repository and all related resources including issues, merge requests etc.
          = form_tag(project_path(@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) }
219

220
.save-project-loader.hide
221
  .center
222
    %h2
223
      %i.fa.fa-spinner.fa-spin
224
      Saving project.
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
225
    %p Please wait a moment, this page will automatically refresh when ready.
226

tauriedavis's avatar
tauriedavis committed
227
= render 'shared/confirm_modal', phrase: @project.path