Commit df92d4ff6796c2c8d85cdf9fe29ab496eb97c30a
Exists in
master
and in
4 other branches
Merge pull request #5072 from jbornschein/proj-new-public
Add "public-project?" checkbox to new-project view
Showing
3 changed files
with
14 additions
and
8 deletions
Show diff stats
app/assets/stylesheets/sections/projects.scss
app/contexts/projects/create_context.rb
| @@ -18,7 +18,7 @@ module Projects | @@ -18,7 +18,7 @@ module Projects | ||
| 18 | snippets_enabled: default_features.snippets, | 18 | snippets_enabled: default_features.snippets, |
| 19 | merge_requests_enabled: default_features.merge_requests, | 19 | merge_requests_enabled: default_features.merge_requests, |
| 20 | public: default_features.public | 20 | public: default_features.public |
| 21 | - } | 21 | + }.stringify_keys |
| 22 | 22 | ||
| 23 | @project = Project.new(default_opts.merge(params)) | 23 | @project = Project.new(default_opts.merge(params)) |
| 24 | 24 |
app/views/projects/new.html.haml
| @@ -2,13 +2,7 @@ | @@ -2,13 +2,7 @@ | ||
| 2 | .project-edit-errors | 2 | .project-edit-errors |
| 3 | = render 'projects/errors' | 3 | = render 'projects/errors' |
| 4 | .project-edit-content | 4 | .project-edit-content |
| 5 | - - if Gitlab.config.gitlab.default_projects_features.public | ||
| 6 | - %p.slead | ||
| 7 | - New projects are public by default. Any signed in user can see your project but cannot commit to it unless granted access. | ||
| 8 | - - else | ||
| 9 | - %p.slead | ||
| 10 | - New projects are private by default. You choose who can see the project and commit to repository. | ||
| 11 | - %hr | 5 | + |
| 12 | = form_for @project, remote: true do |f| | 6 | = form_for @project, remote: true do |f| |
| 13 | .control-group.project-name-holder | 7 | .control-group.project-name-holder |
| 14 | = f.label :name do | 8 | = f.label :name do |
| @@ -53,6 +47,12 @@ | @@ -53,6 +47,12 @@ | ||
| 53 | %span.light (optional) | 47 | %span.light (optional) |
| 54 | .controls | 48 | .controls |
| 55 | = f.text_area :description, placeholder: "awesome project", class: "input-xlarge", rows: 3, maxlength: 250, tabindex: 3 | 49 | = f.text_area :description, placeholder: "awesome project", class: "input-xlarge", rows: 3, maxlength: 250, tabindex: 3 |
| 50 | + .control-group.project-public-holder | ||
| 51 | + = f.label :public do | ||
| 52 | + %span Public project | ||
| 53 | + .controls | ||
| 54 | + = f.check_box :public, { checked: Gitlab.config.gitlab.default_projects_features.public }, true, false | ||
| 55 | + %span.help-inline Make project visible to everyone | ||
| 56 | 56 | ||
| 57 | .form-actions | 57 | .form-actions |
| 58 | = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 | 58 | = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 |