Commit beb324c1c6518f4ad20039b4122ef6d59ba430c2
1 parent
d8f7748d
Exists in
master
and in
4 other branches
Fixed updir method. Fixed breadcrumbs for commits
Showing
2 changed files
with
6 additions
and
6 deletions
Show diff stats
app/decorators/tree_decorator.rb
| @@ -6,7 +6,7 @@ class TreeDecorator < ApplicationDecorator | @@ -6,7 +6,7 @@ class TreeDecorator < ApplicationDecorator | ||
| 6 | part_path = "" | 6 | part_path = "" |
| 7 | parts = path.split("\/") | 7 | parts = path.split("\/") |
| 8 | 8 | ||
| 9 | - #parts = parts[0...-1] if is_blob? | 9 | + #parts = parts[0...-1] if is_blob? |
| 10 | 10 | ||
| 11 | yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links | 11 | yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links |
| 12 | 12 | ||
| @@ -21,7 +21,7 @@ class TreeDecorator < ApplicationDecorator | @@ -21,7 +21,7 @@ class TreeDecorator < ApplicationDecorator | ||
| 21 | end | 21 | end |
| 22 | 22 | ||
| 23 | def up_dir? | 23 | def up_dir? |
| 24 | - !!path | 24 | + path.present? |
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | def up_dir_path | 27 | def up_dir_path |
| @@ -36,8 +36,8 @@ class TreeDecorator < ApplicationDecorator | @@ -36,8 +36,8 @@ class TreeDecorator < ApplicationDecorator | ||
| 36 | def mb_size | 36 | def mb_size |
| 37 | size = (tree.size / 1024) | 37 | size = (tree.size / 1024) |
| 38 | if size < 1024 | 38 | if size < 1024 |
| 39 | - "#{size} KB" | ||
| 40 | - else | 39 | + "#{size} KB" |
| 40 | + else | ||
| 41 | "#{size/1024} MB" | 41 | "#{size/1024} MB" |
| 42 | end | 42 | end |
| 43 | end | 43 | end |
app/views/commits/show.html.haml
| 1 | = render "head" | 1 | = render "head" |
| 2 | 2 | ||
| 3 | -- if params[:path] | 3 | +- if @path |
| 4 | %ul.breadcrumb | 4 | %ul.breadcrumb |
| 5 | %li | 5 | %li |
| 6 | %span.arrow | 6 | %span.arrow |
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | %span.divider | 9 | %span.divider |
| 10 | \/ | 10 | \/ |
| 11 | %li | 11 | %li |
| 12 | - %a{href: "#"}= params[:path].split("/").join(" / ") | 12 | + %a{href: "#"}= @path.split("/").join(" / ") |
| 13 | 13 | ||
| 14 | %div{id: dom_id(@project)} | 14 | %div{id: dom_id(@project)} |
| 15 | #commits_list= render "commits" | 15 | #commits_list= render "commits" |