edit.html.haml 10.5 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

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

P
Phil Hughes 已提交
25 26 27 28
            .form-group.col-md-3
              = f.label :id, class: 'label-light' do
                Project ID
              = f.text_field :id, class: 'form-control', readonly: true
29

P
Phil Hughes 已提交
30
          .form-group
P
Phil Hughes 已提交
31 32 33 34 35 36
            = f.label :description, class: 'label-light' do
              Project description
              %span.light (optional)
            = f.text_area :description, class: "form-control", rows: 3, maxlength: 250

          - unless @project.empty_repo?
T
tauriedavis 已提交
37
            .form-group
P
Phil Hughes 已提交
38 39 40 41 42 43 44
              = 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.sort.join(', '), maxlength: 2000, class: "form-control"
          %p.help-block Separate tags with commas.
        %fieldset.features
45
          %h5.prepend-top-0= _("Project avatar")
P
Phil Hughes 已提交
46 47
          .form-group
            - if @project.avatar?
48
              .avatar-container.s160.append-bottom-15
P
Phil Hughes 已提交
49
                = project_icon(@project.full_path, alt: '', class: 'avatar project-avatar s160')
50 51 52 53 54 55 56 57
            - 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...")
              %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.")
P
Phil Hughes 已提交
58 59
            - if @project.avatar?
              %hr
60
              = 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"
61
        = f.submit 'Save changes', class: "btn btn-success js-btn-save-general-project-settings"
K
Kamil Trzcinski 已提交
62

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

78
  %section.settings.merge-requests-feature.no-animate{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] }
T
tauriedavis 已提交
79 80 81
    .settings-header
      %h4
        Merge request settings
82
      %button.btn.js-settings-toggle{ type: 'button' }
T
tauriedavis 已提交
83 84 85
        = expanded ? 'Collapse' : 'Expand'
      %p
        Customize your merge request restrictions.
86
    .settings-content
T
tauriedavis 已提交
87
      = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f|
T
tauriedavis 已提交
88
        = render 'merge_request_settings', form: f
F
Felipe Artur 已提交
89
        = f.submit 'Save changes', class: "btn btn-save qa-save-merge-request-changes"
90

91
  = render 'export', project: @project
92

93
  %section.settings.advanced-settings.no-animate{ class: ('expanded' if expanded) }
T
tauriedavis 已提交
94 95 96
    .settings-header
      %h4
        Advanced settings
97
      %button.btn.js-settings-toggle{ type: 'button' }
T
tauriedavis 已提交
98 99
        = expanded ? 'Collapse' : 'Expand'
      %p
100
        Perform advanced options such as housekeeping, archiving, renaming, transferring, or removing your project.
101
    .settings-content
102
      .sub-section
T
tauriedavis 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
        %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),
            method: :post, class: "btn btn-default"
      - if can? current_user, :archive_project, @project
        .sub-section
          %h4.warning-title
            - if @project.archived?
              Unarchive project
            - else
              Archive project
          - if @project.archived?
            %p
              Unarchiving the project will mark its repository as active. The project can be committed to.
              %strong Once active this project shows up in the search and on the dashboard.
            = link_to 'Unarchive project', unarchive_project_path(@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"
          - else
            %p
              Archiving the project will mark its repository as read-only. It is hidden from the dashboard and doesn't show up in searches.
              %strong Archived projects cannot be committed to!
            = link_to 'Archive project', archive_project_path(@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"
      .sub-section.rename-respository
        %h4.warning-title
          Rename repository
        = render 'projects/errors'
        = 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"
P
Phil Hughes 已提交
139
          .form-group
T
tauriedavis 已提交
140 141
            = f.label :path, class: 'label-light' do
              %span Path
P
Phil Hughes 已提交
142
            .form-group
T
tauriedavis 已提交
143 144 145 146
              .input-group
                .input-group-addon
                  #{URI.join(root_url, @project.namespace.full_path)}/
                = f.text_field :path, class: 'form-control'
P
Phil Hughes 已提交
147
            %ul
T
tauriedavis 已提交
148
              %li Be careful. Renaming a project's repository can have unintended side effects.
P
Phil Hughes 已提交
149
              %li You will need to update your local repositories to point to the new location.
150
              - if @project.deployment_platform.present?
T
tauriedavis 已提交
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
                %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
              = label_tag :new_namespace_id, nil, class: 'label-light' do
                %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.
M
Mehdi Lahmam 已提交
167
                %li Project visibility level will be changed to match namespace rules when transferring to a group.
T
tauriedavis 已提交
168 169 170 171 172
            = 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
P
Phil Hughes 已提交
173
          %p
T
tauriedavis 已提交
174 175
            This will remove the fork relationship to source project
            = succeed "." do
176 177 178 179
              - if @project.fork_source
                = link_to(fork_source_name(@project), project_path(@project.fork_source))
              - else
                = fork_source_name(@project)
T
tauriedavis 已提交
180 181 182 183 184 185 186 187
          = 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
P
Phil Hughes 已提交
188
          %p
T
tauriedavis 已提交
189 190 191 192 193
            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) }
194

195
.save-project-loader.hide
196
  .center
197
    %h2
S
Sullivan SENECHAL 已提交
198
      %i.fa.fa-spinner.fa-spin
199
      Saving project.
D
Dmitriy Zaporozhets 已提交
200
    %p Please wait a moment, this page will automatically refresh when ready.
201

T
tauriedavis 已提交
202
= render 'shared/confirm_modal', phrase: @project.path