diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2018-08-25 18:32:59 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2018-09-04 19:05:40 +0300 |
commit | b47015ad9babf464c1e58ac78c92b8feb7084019 (patch) | |
tree | 83c08a4beddc893b95a91d3bc92da2457d5f25a5 /app/views/projects | |
parent | afb49b044bcb71702edd3f5ef0139599ddc54ef5 (diff) |
Move project default branch settings under 'Repository'
- Updates specs accordingly
- Updates docs accordingly
- Brews a fresh pot
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/default_branch/_show.html.haml | 21 | ||||
-rw-r--r-- | app/views/projects/edit.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/settings/repository/show.html.haml | 1 |
3 files changed, 22 insertions, 5 deletions
diff --git a/app/views/projects/default_branch/_show.html.haml b/app/views/projects/default_branch/_show.html.haml new file mode 100644 index 00000000000..ff6a9d49a61 --- /dev/null +++ b/app/views/projects/default_branch/_show.html.haml @@ -0,0 +1,21 @@ +- expanded = Rails.env.test? + +%section.settings.no-animate#default-branch-settings{ class: ('expanded' if expanded) } + .settings-header + %h4= _('Default Branch') + %button.btn.js-settings-toggle + = expanded ? _('Collapse') : _('Expand') + %p + = _('Select the branch you want to set as the default for this project. All merge requests and commits will automatically be made against this branch unless you specify a different one.') + + .settings-content + - if @project.empty_repo? + .text-secondary + = _('A default branch cannot be chosen for an empty project.') + - else + = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, anchor: 'default-branch-settings' }, authenticity_token: true do |f| + %fieldset + .form-group + = f.label :default_branch, "Default Branch", class: 'label-bold' + = f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'}) + = f.submit 'Save changes', class: "btn btn-success" diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index fb837b27207..acdde9e0f70 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -36,11 +36,6 @@ = render_if_exists 'projects/classification_policy_settings', f: f - - unless @project.empty_repo? - .form-group - = f.label :default_branch, "Default Branch", class: 'label-bold' - = f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'}) - = render_if_exists 'shared/repository_size_limit_setting', form: f, type: :project .form-group diff --git a/app/views/projects/settings/repository/show.html.haml b/app/views/projects/settings/repository/show.html.haml index 98c609d7bd4..a0bcaaf3c54 100644 --- a/app/views/projects/settings/repository/show.html.haml +++ b/app/views/projects/settings/repository/show.html.haml @@ -2,6 +2,7 @@ - page_title _("Repository") - @content_class = "limit-container-width" unless fluid_layout += render "projects/default_branch/show" = render "projects/mirrors/show" -# Protected branches & tags use a lot of nested partials. |