diff options
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r-- | app/helpers/commits_helper.rb | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 0333c29e2fd..7cc56de24e4 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -93,25 +93,18 @@ module CommitsHelper return unless current_controller?(:commits) if @path.blank? - return link_to( - _("Browse Files"), - project_tree_path(project, commit), - class: "btn btn-default" - ) + url = project_tree_path(project, commit) + tooltip = _("Browse Files") elsif @repo.blob_at(commit.id, @path) - return link_to( - _("Browse File"), - project_blob_path(project, - tree_join(commit.id, @path)), - class: "btn btn-default" - ) + url = project_blob_path(project, tree_join(commit.id, @path)) + tooltip = _("Browse File") elsif @path.present? - return link_to( - _("Browse Directory"), - project_tree_path(project, - tree_join(commit.id, @path)), - class: "btn btn-default" - ) + url = project_tree_path(project, tree_join(commit.id, @path)) + tooltip = _("Browse Directory") + end + + link_to url, class: "btn btn-default has-tooltip", title: tooltip, data: { container: "body" } do + sprite_icon('folder-open') end end |