Use icon
helper method in helper modules
This commit is contained in:
parent
fe831dcd6f
commit
4e7a4cd956
7 changed files with 19 additions and 27 deletions
|
@ -65,8 +65,7 @@ module CommitsHelper
|
||||||
branches.sort.map do |branch|
|
branches.sort.map do |branch|
|
||||||
link_to(project_tree_path(project, branch)) do
|
link_to(project_tree_path(project, branch)) do
|
||||||
content_tag :span, class: 'label label-gray' do
|
content_tag :span, class: 'label label-gray' do
|
||||||
content_tag(:i, nil, class: 'fa fa-code-fork') + ' ' +
|
icon('code-fork') + ' ' + branch
|
||||||
branch
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end.join(" ").html_safe
|
end.join(" ").html_safe
|
||||||
|
@ -78,8 +77,7 @@ module CommitsHelper
|
||||||
sorted.map do |tag|
|
sorted.map do |tag|
|
||||||
link_to(project_commits_path(project, project.repository.find_tag(tag).name)) do
|
link_to(project_commits_path(project, project.repository.find_tag(tag).name)) do
|
||||||
content_tag :span, class: 'label label-gray' do
|
content_tag :span, class: 'label label-gray' do
|
||||||
content_tag(:i, nil, class: 'fa fa-tag') + ' ' +
|
icon('tag') + ' ' + tag
|
||||||
tag
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end.join(" ").html_safe
|
end.join(" ").html_safe
|
||||||
|
|
|
@ -27,18 +27,17 @@ module EventsHelper
|
||||||
|
|
||||||
content_tag :li, class: "filter_icon #{active}" do
|
content_tag :li, class: "filter_icon #{active}" do
|
||||||
link_to request.path, class: 'has_tooltip event_filter_link', id: "#{key}_event_filter", 'data-original-title' => tooltip do
|
link_to request.path, class: 'has_tooltip event_filter_link', id: "#{key}_event_filter", 'data-original-title' => tooltip do
|
||||||
content_tag(:i, nil, class: icon_for_event[key]) +
|
icon(icon_for_event[key]) + content_tag(:span, ' ' + tooltip)
|
||||||
content_tag(:span, ' ' + tooltip)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def icon_for_event
|
def icon_for_event
|
||||||
{
|
{
|
||||||
EventFilter.push => 'fa fa-upload',
|
EventFilter.push => 'upload',
|
||||||
EventFilter.merged => 'fa fa-check-square-o',
|
EventFilter.merged => 'check-square-o',
|
||||||
EventFilter.comments => 'fa fa-comments',
|
EventFilter.comments => 'comments',
|
||||||
EventFilter.team => 'fa fa-user',
|
EventFilter.team => 'user',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ module IssuesHelper
|
||||||
ts << capture_haml do
|
ts << capture_haml do
|
||||||
haml_tag :span do
|
haml_tag :span do
|
||||||
haml_concat '·'
|
haml_concat '·'
|
||||||
haml_concat '<i class="fa fa-edit" title="edited"></i> '
|
haml_concat icon('edit', title: 'edited')
|
||||||
haml_concat time_ago_with_tooltip(issue.updated_at, 'bottom', 'issue_edited_ago')
|
haml_concat time_ago_with_tooltip(issue.updated_at, 'bottom', 'issue_edited_ago')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,7 +22,7 @@ module NotesHelper
|
||||||
ts << capture_haml do
|
ts << capture_haml do
|
||||||
haml_tag :span do
|
haml_tag :span do
|
||||||
haml_concat '·'
|
haml_concat '·'
|
||||||
haml_concat '<i class="fa fa-edit" title="edited"></i> '
|
haml_concat icon('edit', title: 'edited')
|
||||||
haml_concat time_ago_with_tooltip(note.updated_at, 'bottom', 'note_edited_ago')
|
haml_concat time_ago_with_tooltip(note.updated_at, 'bottom', 'note_edited_ago')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -57,7 +57,7 @@ module NotesHelper
|
||||||
button_tag(class: 'btn add-diff-note js-add-diff-note-button',
|
button_tag(class: 'btn add-diff-note js-add-diff-note-button',
|
||||||
data: data,
|
data: data,
|
||||||
title: 'Add a comment to this line') do
|
title: 'Add a comment to this line') do
|
||||||
content_tag :i, nil, class: 'fa fa-comment-o'
|
icon('comment-o')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ module NotesHelper
|
||||||
|
|
||||||
button_tag class: 'btn reply-btn js-discussion-reply-button',
|
button_tag class: 'btn reply-btn js-discussion-reply-button',
|
||||||
data: data, title: 'Add a reply' do
|
data: data, title: 'Add a reply' do
|
||||||
link_text = content_tag(:i, nil, class: 'fa fa-comment')
|
link_text = icon('comment')
|
||||||
link_text << ' Reply'
|
link_text << ' Reply'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
module NotificationsHelper
|
module NotificationsHelper
|
||||||
def notification_icon(notification)
|
def notification_icon(notification)
|
||||||
if notification.disabled?
|
if notification.disabled?
|
||||||
content_tag :i, nil, class: 'fa fa-volume-off ns-mute'
|
icon('volume-off', class: 'ns-mute')
|
||||||
elsif notification.participating?
|
elsif notification.participating?
|
||||||
content_tag :i, nil, class: 'fa fa-volume-down ns-part'
|
icon('volume-down', class: 'ns-part')
|
||||||
elsif notification.watch?
|
elsif notification.watch?
|
||||||
content_tag :i, nil, class: 'fa fa-volume-up ns-watch'
|
icon('volume-up', class: 'ns-watch')
|
||||||
else
|
else
|
||||||
content_tag :i, nil, class: 'fa fa-circle-o ns-default'
|
icon('circle-o', class: 'ns-default')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -83,7 +83,7 @@ module ProjectsHelper
|
||||||
' Star'
|
' Star'
|
||||||
end
|
end
|
||||||
|
|
||||||
content_tag('i', ' ', class: 'fa fa-star') + toggle_text
|
icon('star') + toggle_text
|
||||||
end
|
end
|
||||||
|
|
||||||
count_html = content_tag('span', class: 'count') do
|
count_html = content_tag('span', class: 'count') do
|
||||||
|
@ -107,7 +107,7 @@ module ProjectsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_to_toggle_fork
|
def link_to_toggle_fork
|
||||||
out = content_tag(:i, '', class: 'fa fa-code-fork')
|
out = icon('code-fork')
|
||||||
out << ' Fork'
|
out << ' Fork'
|
||||||
out << content_tag(:span, class: 'count') do
|
out << content_tag(:span, class: 'count') do
|
||||||
@project.forks_count.to_s
|
@project.forks_count.to_s
|
||||||
|
|
|
@ -38,13 +38,8 @@ module TreeHelper
|
||||||
#
|
#
|
||||||
# type - String type of the tree item; either 'folder' or 'file'
|
# type - String type of the tree item; either 'folder' or 'file'
|
||||||
def tree_icon(type)
|
def tree_icon(type)
|
||||||
icon_class = if type == 'folder'
|
icon_class = type == 'folder' ? 'folder' : 'file-o'
|
||||||
'fa fa-folder'
|
icon(icon_class)
|
||||||
else
|
|
||||||
'fa fa-file-o'
|
|
||||||
end
|
|
||||||
|
|
||||||
content_tag :i, nil, class: icon_class
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def tree_hex_class(content)
|
def tree_hex_class(content)
|
||||||
|
|
Loading…
Reference in a new issue