diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-23 21:31:09 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-23 21:31:09 +0300 |
commit | 470aa7675e07724ff48f159ee12da40409949222 (patch) | |
tree | d01536cb3529b04cc5031714f12dd808dfa87be7 /app | |
parent | c50ec72b52e9ed7270f7c81c2c71fd8e5a28eeb0 (diff) | |
download | gitlab-ce-470aa7675e07724ff48f159ee12da40409949222.tar.gz |
Fix project.code-related functionality
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/views/admin/groups/index.html.haml | 4 | ||||
-rw-r--r-- | app/views/admin/groups/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/admin/projects/show.html.haml | 6 | ||||
-rw-r--r-- | app/views/dashboard/_groups.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/_init_auto_complete.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/project_resource.html.haml | 2 |
7 files changed, 8 insertions, 14 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 2de5b2f3168..3cd495fbae5 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -86,7 +86,7 @@ class Project < ActiveRecord::Base def create_by_user(params, user) namespace_id = params.delete(:namespace_id) - namespace_id ||= current_user.namespace_id + namespace_id ||= user.namespace_id project = Project.new params diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index 6a0794cfd44..534fa1dbcdd 100644 --- a/app/views/admin/groups/index.html.haml +++ b/app/views/admin/groups/index.html.haml @@ -14,7 +14,7 @@ %table %thead %th Name - %th Code + %th Path %th Projects %th Edit %th.cred Danger Zone! @@ -22,7 +22,7 @@ - @groups.each do |group| %tr %td= link_to group.name, [:admin, group] - %td= group.code + %td= group.path %td= group.projects.count %td= link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn small" %td.bgred= link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn small danger" diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index 309a10e5bb4..0254d98a0f9 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -20,9 +20,9 @@ %tr %td %b - Code: + Path: %td - = @group.code + = @group.path %tr %td %b diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index ae5da372e1a..7e4fe3fb7ad 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -29,12 +29,6 @@ %tr %td %b - Code: - %td - = @project.code - %tr - %td - %b Path: %td %code= @project.path_to_repo diff --git a/app/views/dashboard/_groups.html.haml b/app/views/dashboard/_groups.html.haml index 7c5e9f3fab0..a15396aaf03 100644 --- a/app/views/dashboard/_groups.html.haml +++ b/app/views/dashboard/_groups.html.haml @@ -11,7 +11,7 @@ %ul.unstyled - groups.each do |group| %li.wll - = link_to group_path(id: group.code), class: dom_class(group) do + = link_to group_path(id: group.path), class: dom_class(group) do %strong.group_name= truncate(group.name, length: 25) %span.arrow → diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml index 502f289ec05..7b2a291d05c 100644 --- a/app/views/layouts/_init_auto_complete.html.haml +++ b/app/views/layouts/_init_auto_complete.html.haml @@ -1,6 +1,6 @@ :javascript $(function() { - GitLab.GfmAutoComplete.Members.url = "#{ "/api/v2/projects/#{@project.code}/members" if @project }"; + GitLab.GfmAutoComplete.Members.url = "#{ "/api/v2/projects/#{@project.path}/members" if @project }"; GitLab.GfmAutoComplete.Members.params.private_token = "#{current_user.private_token}"; GitLab.GfmAutoComplete.Emoji.data = #{raw emoji_autocomplete_source}; diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml index b1dbe41ce65..2158e342036 100644 --- a/app/views/layouts/project_resource.html.haml +++ b/app/views/layouts/project_resource.html.haml @@ -7,7 +7,7 @@ .container %ul.main_menu = nav_link(html_options: {class: "home #{project_tab_class}"}) do - = link_to @project.code, project_path(@project), title: "Project" + = link_to @project.path, project_path(@project), title: "Project" - if @project.repo_exists? - if can? current_user, :download_code, @project |