Commit 1d857aae17a2f7a3bc759707f0fb642943d9569e

Authored by Dmitriy Zaporozhets
1 parent ae282f63

project admin area - show project name with namespace

app/models/project.rb
... ... @@ -259,4 +259,14 @@ class Project < ActiveRecord::Base
259 259 save!
260 260 end
261 261 end
  262 +
  263 + def name_with_namespace
  264 + @name_with_namespace ||= begin
  265 + if namespace
  266 + namespace.human_name + " / " + name
  267 + else
  268 + name
  269 + end
  270 + end
  271 + end
262 272 end
... ...
app/views/admin/projects/index.html.haml
... ... @@ -4,14 +4,14 @@
4 4 = link_to 'New Project', new_project_path, class: "btn small right"
5 5 %br
6 6 = form_tag admin_projects_path, method: :get, class: 'form-inline' do
7   - = select_tag :namespace_id, namespaces_options(params[:namespace_id], :all), class: "chosen xlarge", include_blank: true
  7 + = select_tag :namespace_id, namespaces_options(params[:namespace_id], :all), class: "chosen xlarge", prompt: "Project namespace"
8 8 = text_field_tag :name, params[:name], class: "xlarge"
9 9 = submit_tag "Search", class: "btn submit primary"
10 10  
11 11 %table
12 12 %thead
13 13 %th Name
14   - %th Project
  14 + %th Path
15 15 %th Team Members
16 16 %th Last Commit
17 17 %th Edit
... ... @@ -20,10 +20,7 @@
20 20 - @projects.each do |project|
21 21 %tr
22 22 %td
23   - - if project.namespace
24   - = link_to project.namespace.human_name, [:admin, project]
25   - →
26   - = link_to project.name, [:admin, project]
  23 + = link_to project.name_with_namespace, [:admin, project]
27 24 %td
28 25 %span.monospace= project.path_with_namespace + ".git"
29 26 %td= project.users_projects.count
... ...
app/views/admin/projects/show.html.haml
1 1 = render 'admin/shared/projects_head'
2 2 %h3.page_title
3   - Project: #{@project.name}
  3 + Project: #{@project.name_with_namespace}
4 4 = link_to edit_admin_project_path(@project), class: "btn right" do
5 5 %i.icon-edit
6 6 Edit
... ...