Commit 44920811 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show bare repository size in admin area(projects page)

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 071de30f
...@@ -137,8 +137,8 @@ module ProjectsHelper ...@@ -137,8 +137,8 @@ module ProjectsHelper
end end
end end
def repository_size def repository_size(project = nil)
"#{@project.repository.size} MB" "#{(project || @project).repository.size} MB"
rescue rescue
# In order to prevent 500 error # In order to prevent 500 error
# when application cannot allocate memory # when application cannot allocate memory
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
%li %li
%strong %strong
= link_to project.name_with_namespace, [:admin, project] = link_to project.name_with_namespace, [:admin, project]
%span.label.label-gray
= repository_size(project)
%span.pull-right.light %span.pull-right.light
%span.monospace= project.path_with_namespace + ".git" %span.monospace= project.path_with_namespace + ".git"
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
= link_to project.name_with_namespace, [:admin, project] = link_to project.name_with_namespace, [:admin, project]
.pull-right .pull-right
%span.label.label-gray
= repository_size(project)
= link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= link_to 'Destroy', [project], confirm: remove_project_message(project), method: :delete, class: "btn btn-small btn-remove" = link_to 'Destroy', [project], confirm: remove_project_message(project), method: :delete, class: "btn btn-small btn-remove"
- if @projects.blank? - if @projects.blank?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment