summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/commits_helper.rb18
-rw-r--r--app/views/projects/commit/_commit_box.html.haml30
2 files changed, 30 insertions, 18 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 8214df40073..2a3e51ada50 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -62,13 +62,27 @@ module CommitsHelper
# Returns the sorted alphabetically links to branches, separated by a comma
def commit_branches_links(project, branches)
- branches.sort.map { |branch| link_to(branch, project_tree_path(project, branch)) }.join(", ").html_safe
+ branches.sort.map do |branch|
+ link_to(project_tree_path(project, branch)) do
+ content_tag :span, class: 'label label-gray' do
+ content_tag(:i, nil, class: 'fa fa-code-fork') + ' ' +
+ branch
+ end
+ end
+ end.join(" ").html_safe
end
# Returns the sorted links to tags, separated by a comma
def commit_tags_links(project, tags)
sorted = VersionSorter.rsort(tags)
- sorted.map { |tag| link_to(tag, project_commits_path(project, project.repository.find_tag(tag).name)) }.join(", ").html_safe
+ sorted.map do |tag|
+ link_to(project_commits_path(project, project.repository.find_tag(tag).name)) do
+ content_tag :span, class: 'label label-gray' do
+ content_tag(:i, nil, class: 'fa fa-tag') + ' ' +
+ tag
+ end
+ end
+ end.join(" ").html_safe
end
def link_to_browse_code(project, commit)
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
index 1d4658432ae..b41fb1437f2 100644
--- a/app/views/projects/commit/_commit_box.html.haml
+++ b/app/views/projects/commit/_commit_box.html.haml
@@ -37,25 +37,23 @@
- @commit.parents.each do |parent|
= link_to parent.short_id, project_commit_path(@project, parent)
-- if @branches.any?
- .commit-info-row
- %span.cgray
- Exists in
+.commit-info-row
+ - if @branches.any?
%span
- branch = commit_default_branch(@project, @branches)
- = link_to(branch, project_tree_path(@project, branch))
- - if @branches.any?
- and in
- = link_to("#{pluralize(@branches.count, "other branch")}", "#", class: "js-details-expand")
+ = link_to(project_tree_path(@project, branch)) do
+ %span.label.label-gray
+ %i.fa.fa-code-fork
+ = branch
+ - if @branches.any? || @tags.any?
+ = link_to("#", class: "js-details-expand") do
+ %span.label.label-gray
+ \...
%span.js-details-content.hide
- = commit_branches_links(@project, @branches)
-
-- if @tags.any?
- .commit-info-row
- %span.cgray
- Tags:
- %span
- = commit_tags_links(@project, @tags)
+ - if @branches.any?
+ = commit_branches_links(@project, @branches)
+ - if @tags.any?
+ = commit_tags_links(@project, @tags)
.commit-box
%h3.commit-title