Commit beb324c1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fixed updir method. Fixed breadcrumbs for commits

parent d8f7748d
...@@ -6,7 +6,7 @@ class TreeDecorator < ApplicationDecorator ...@@ -6,7 +6,7 @@ class TreeDecorator < ApplicationDecorator
part_path = "" part_path = ""
parts = path.split("\/") parts = path.split("\/")
#parts = parts[0...-1] if is_blob? #parts = parts[0...-1] if is_blob?
yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links
...@@ -21,7 +21,7 @@ class TreeDecorator < ApplicationDecorator ...@@ -21,7 +21,7 @@ class TreeDecorator < ApplicationDecorator
end end
def up_dir? def up_dir?
!!path path.present?
end end
def up_dir_path def up_dir_path
...@@ -36,8 +36,8 @@ class TreeDecorator < ApplicationDecorator ...@@ -36,8 +36,8 @@ class TreeDecorator < ApplicationDecorator
def mb_size def mb_size
size = (tree.size / 1024) size = (tree.size / 1024)
if size < 1024 if size < 1024
"#{size} KB" "#{size} KB"
else else
"#{size/1024} MB" "#{size/1024} MB"
end end
end end
......
= render "head" = render "head"
- if params[:path] - if @path
%ul.breadcrumb %ul.breadcrumb
%li %li
%span.arrow %span.arrow
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
%span.divider %span.divider
\/ \/
%li %li
%a{href: "#"}= params[:path].split("/").join(" / ") %a{href: "#"}= @path.split("/").join(" / ")
%div{id: dom_id(@project)} %div{id: dom_id(@project)}
#commits_list= render "commits" #commits_list= render "commits"
......
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