Commit ff25cb934beac5189f9d80341873bba8d635d537
Exists in
master
and in
4 other branches
Merge branch 'feature/repo_size_in_admin' of /home/git/repositories/gitlab/gitlabhq
Showing
3 changed files
with
6 additions
and
2 deletions
Show diff stats
app/helpers/projects_helper.rb
@@ -137,8 +137,8 @@ module ProjectsHelper | @@ -137,8 +137,8 @@ module ProjectsHelper | ||
137 | end | 137 | end |
138 | end | 138 | end |
139 | 139 | ||
140 | - def repository_size | ||
141 | - "#{@project.repository.size} MB" | 140 | + def repository_size(project = nil) |
141 | + "#{(project || @project).repository.size} MB" | ||
142 | rescue | 142 | rescue |
143 | # In order to prevent 500 error | 143 | # In order to prevent 500 error |
144 | # when application cannot allocate memory | 144 | # when application cannot allocate memory |
app/views/admin/groups/show.html.haml
@@ -39,6 +39,8 @@ | @@ -39,6 +39,8 @@ | ||
39 | %li | 39 | %li |
40 | %strong | 40 | %strong |
41 | = link_to project.name_with_namespace, [:admin, project] | 41 | = link_to project.name_with_namespace, [:admin, project] |
42 | + %span.label.label-gray | ||
43 | + = repository_size(project) | ||
42 | %span.pull-right.light | 44 | %span.pull-right.light |
43 | %span.monospace= project.path_with_namespace + ".git" | 45 | %span.monospace= project.path_with_namespace + ".git" |
44 | 46 |
app/views/admin/projects/index.html.haml
@@ -49,6 +49,8 @@ | @@ -49,6 +49,8 @@ | ||
49 | = visibility_level_icon(project.visibility_level) | 49 | = visibility_level_icon(project.visibility_level) |
50 | = link_to project.name_with_namespace, [:admin, project] | 50 | = link_to project.name_with_namespace, [:admin, project] |
51 | .pull-right | 51 | .pull-right |
52 | + %span.label.label-gray | ||
53 | + = repository_size(project) | ||
52 | = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" | 54 | = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" |
53 | = link_to 'Destroy', [project], confirm: remove_project_message(project), method: :delete, class: "btn btn-small btn-remove" | 55 | = link_to 'Destroy', [project], confirm: remove_project_message(project), method: :delete, class: "btn btn-small btn-remove" |
54 | - if @projects.blank? | 56 | - if @projects.blank? |