summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-01-28 03:32:48 -0500
committerRobert Speicher <rspeicher@gmail.com>2015-01-28 03:48:18 -0500
commit4e7a4cd95696746bcab78a4f9ec071dd4089397a (patch)
treee7abebe5edd248e6369a5eb5ea4e4b28fcf8f6ec /app
parentfe831dcd6f4af535abba1a9dc350c4d8a0f809e9 (diff)
downloadgitlab-ce-4e7a4cd95696746bcab78a4f9ec071dd4089397a.tar.gz
Use `icon` helper method in helper modules
Diffstat (limited to 'app')
-rw-r--r--app/helpers/commits_helper.rb6
-rw-r--r--app/helpers/events_helper.rb11
-rw-r--r--app/helpers/issues_helper.rb2
-rw-r--r--app/helpers/notes_helper.rb6
-rw-r--r--app/helpers/notifications_helper.rb8
-rw-r--r--app/helpers/projects_helper.rb4
-rw-r--r--app/helpers/tree_helper.rb9
7 files changed, 19 insertions, 27 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 2a3e51ada50..1a322ac048f 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -65,8 +65,7 @@ module CommitsHelper
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
+ icon('code-fork') + ' ' + branch
end
end
end.join(" ").html_safe
@@ -78,8 +77,7 @@ module CommitsHelper
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
+ icon('tag') + ' ' + tag
end
end
end.join(" ").html_safe
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
index 903a5009616..d05f6df5f9f 100644
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -27,18 +27,17 @@ module EventsHelper
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
- content_tag(:i, nil, class: icon_for_event[key]) +
- content_tag(:span, ' ' + tooltip)
+ icon(icon_for_event[key]) + content_tag(:span, ' ' + tooltip)
end
end
end
def icon_for_event
{
- EventFilter.push => 'fa fa-upload',
- EventFilter.merged => 'fa fa-check-square-o',
- EventFilter.comments => 'fa fa-comments',
- EventFilter.team => 'fa fa-user',
+ EventFilter.push => 'upload',
+ EventFilter.merged => 'check-square-o',
+ EventFilter.comments => 'comments',
+ EventFilter.team => 'user',
}
end
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 2bf430f9142..5fcc825acca 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -62,7 +62,7 @@ module IssuesHelper
ts << capture_haml do
haml_tag :span do
haml_concat '&middot;'
- 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')
end
end
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 8f493f5d331..d41d5617396 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -22,7 +22,7 @@ module NotesHelper
ts << capture_haml do
haml_tag :span do
haml_concat '&middot;'
- 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')
end
end
@@ -57,7 +57,7 @@ module NotesHelper
button_tag(class: 'btn add-diff-note js-add-diff-note-button',
data: data,
title: 'Add a comment to this line') do
- content_tag :i, nil, class: 'fa fa-comment-o'
+ icon('comment-o')
end
end
@@ -74,7 +74,7 @@ module NotesHelper
button_tag class: 'btn reply-btn js-discussion-reply-button',
data: data, title: 'Add a reply' do
- link_text = content_tag(:i, nil, class: 'fa fa-comment')
+ link_text = icon('comment')
link_text << ' Reply'
end
end
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index bad380e98a8..f771fe761ef 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -1,13 +1,13 @@
module NotificationsHelper
def notification_icon(notification)
if notification.disabled?
- content_tag :i, nil, class: 'fa fa-volume-off ns-mute'
+ icon('volume-off', class: 'ns-mute')
elsif notification.participating?
- content_tag :i, nil, class: 'fa fa-volume-down ns-part'
+ icon('volume-down', class: 'ns-part')
elsif notification.watch?
- content_tag :i, nil, class: 'fa fa-volume-up ns-watch'
+ icon('volume-up', class: 'ns-watch')
else
- content_tag :i, nil, class: 'fa fa-circle-o ns-default'
+ icon('circle-o', class: 'ns-default')
end
end
end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 351641e19af..0b01be79623 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -83,7 +83,7 @@ module ProjectsHelper
' Star'
end
- content_tag('i', ' ', class: 'fa fa-star') + toggle_text
+ icon('star') + toggle_text
end
count_html = content_tag('span', class: 'count') do
@@ -107,7 +107,7 @@ module ProjectsHelper
end
def link_to_toggle_fork
- out = content_tag(:i, '', class: 'fa fa-code-fork')
+ out = icon('code-fork')
out << ' Fork'
out << content_tag(:span, class: 'count') do
@project.forks_count.to_s
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index 727ec3fb231..b6fb7a8aa5a 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -38,13 +38,8 @@ module TreeHelper
#
# type - String type of the tree item; either 'folder' or 'file'
def tree_icon(type)
- icon_class = if type == 'folder'
- 'fa fa-folder'
- else
- 'fa fa-file-o'
- end
-
- content_tag :i, nil, class: icon_class
+ icon_class = type == 'folder' ? 'folder' : 'file-o'
+ icon(icon_class)
end
def tree_hex_class(content)