Commit 470aa7675e07724ff48f159ee12da40409949222
1 parent
c50ec72b
Exists in
master
and in
4 other branches
Fix project.code-related functionality
Showing
8 changed files
with
9 additions
and
16 deletions
Show diff stats
app/models/project.rb
... | ... | @@ -86,7 +86,7 @@ class Project < ActiveRecord::Base |
86 | 86 | |
87 | 87 | def create_by_user(params, user) |
88 | 88 | namespace_id = params.delete(:namespace_id) |
89 | - namespace_id ||= current_user.namespace_id | |
89 | + namespace_id ||= user.namespace_id | |
90 | 90 | |
91 | 91 | project = Project.new params |
92 | 92 | ... | ... |
app/views/admin/groups/index.html.haml
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | %table |
15 | 15 | %thead |
16 | 16 | %th Name |
17 | - %th Code | |
17 | + %th Path | |
18 | 18 | %th Projects |
19 | 19 | %th Edit |
20 | 20 | %th.cred Danger Zone! |
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | - @groups.each do |group| |
23 | 23 | %tr |
24 | 24 | %td= link_to group.name, [:admin, group] |
25 | - %td= group.code | |
25 | + %td= group.path | |
26 | 26 | %td= group.projects.count |
27 | 27 | %td= link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn small" |
28 | 28 | %td.bgred= link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn small danger" | ... | ... |
app/views/admin/groups/show.html.haml
app/views/admin/projects/show.html.haml
app/views/dashboard/_groups.html.haml
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | %ul.unstyled |
12 | 12 | - groups.each do |group| |
13 | 13 | %li.wll |
14 | - = link_to group_path(id: group.code), class: dom_class(group) do | |
14 | + = link_to group_path(id: group.path), class: dom_class(group) do | |
15 | 15 | %strong.group_name= truncate(group.name, length: 25) |
16 | 16 | %span.arrow |
17 | 17 | → | ... | ... |
app/views/layouts/_init_auto_complete.html.haml
1 | 1 | :javascript |
2 | 2 | $(function() { |
3 | - GitLab.GfmAutoComplete.Members.url = "#{ "/api/v2/projects/#{@project.code}/members" if @project }"; | |
3 | + GitLab.GfmAutoComplete.Members.url = "#{ "/api/v2/projects/#{@project.path}/members" if @project }"; | |
4 | 4 | GitLab.GfmAutoComplete.Members.params.private_token = "#{current_user.private_token}"; |
5 | 5 | |
6 | 6 | GitLab.GfmAutoComplete.Emoji.data = #{raw emoji_autocomplete_source}; | ... | ... |
app/views/layouts/project_resource.html.haml
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | .container |
8 | 8 | %ul.main_menu |
9 | 9 | = nav_link(html_options: {class: "home #{project_tab_class}"}) do |
10 | - = link_to @project.code, project_path(@project), title: "Project" | |
10 | + = link_to @project.path, project_path(@project), title: "Project" | |
11 | 11 | |
12 | 12 | - if @project.repo_exists? |
13 | 13 | - if can? current_user, :download_code, @project | ... | ... |
spec/factories.rb
... | ... | @@ -26,13 +26,12 @@ FactoryGirl.define do |
26 | 26 | factory :project do |
27 | 27 | sequence(:name) { |n| "project#{n}" } |
28 | 28 | path { name.downcase.gsub(/\s/, '_') } |
29 | - code { name.downcase.gsub(/\s/, '_') } | |
30 | 29 | owner |
31 | 30 | end |
32 | 31 | |
33 | 32 | factory :namespace do |
34 | 33 | sequence(:name) { |n| "group#{n}" } |
35 | - code { name.downcase.gsub(/\s/, '_') } | |
34 | + path { name.downcase.gsub(/\s/, '_') } | |
36 | 35 | owner |
37 | 36 | |
38 | 37 | factory :group do | ... | ... |