diff options
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r-- | app/helpers/commits_helper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 4d27cf2851e..9643a0a965c 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -180,6 +180,18 @@ module CommitsHelper return old_lines, new_lines end + def link_to_browse_code(project, commit) + if current_controller?(:projects, :commits) + if @repo.blob_at(commit.id, @path) + link_to "Browse File »", project_blob_path(project, tree_join(commit.id, @path)), class: "pull-right" + else + link_to "Browse Dir »", project_tree_path(project, tree_join(commit.id, @path)), class: "pull-right" + end + else + link_to "Browse Code »", project_tree_path(project, commit), class: "pull-right" + end + end + protected # Private: Returns a link to a person. If the person has a matching user and |