views: factor out FontAwesome icons.
Factor out FontAwesome icons into a set of helpers. This is so that it's easier to keep track of which icons we're using and easier to change icons globally.
This commit is contained in:
@@ -29,9 +29,9 @@ module PaginationHelper
|
||||
window = 4
|
||||
|
||||
if records.current_page >= 2
|
||||
html << "<li class='arrow'>" + link_to(content_tag(:i, nil, class: "fas fa-chevron-left"), nav_params_for(records.current_page - 1), rel: "prev", id: "paginator-prev", "data-shortcut": "a left") + "</li>"
|
||||
html << "<li class='arrow'>" + link_to(chevron_left_icon, nav_params_for(records.current_page - 1), rel: "prev", id: "paginator-prev", "data-shortcut": "a left") + "</li>"
|
||||
else
|
||||
html << "<li class='arrow'><span>" + content_tag(:i, nil, class: "fas fa-chevron-left") + "</span></li>"
|
||||
html << "<li class='arrow'><span>" + chevron_left_icon + "</span></li>"
|
||||
end
|
||||
|
||||
if records.total_pages <= (window * 2) + 5
|
||||
@@ -69,9 +69,9 @@ module PaginationHelper
|
||||
end
|
||||
|
||||
if records.current_page < records.total_pages && records.present?
|
||||
html << "<li class='arrow'>" + link_to(content_tag(:i, nil, class: "fas fa-chevron-right"), nav_params_for(records.current_page + 1), rel: "next", id: "paginator-next", "data-shortcut": "d right") + "</li>"
|
||||
html << "<li class='arrow'>" + link_to(chevron_right_icon, nav_params_for(records.current_page + 1), rel: "next", id: "paginator-next", "data-shortcut": "d right") + "</li>"
|
||||
else
|
||||
html << "<li class='arrow'><span>" + content_tag(:i, nil, class: "fas fa-chevron-right") + "</span></li>"
|
||||
html << "<li class='arrow'><span>" + chevron_right_icon + "</span></li>"
|
||||
end
|
||||
|
||||
html << "</menu></div>"
|
||||
@@ -92,7 +92,7 @@ module PaginationHelper
|
||||
html = []
|
||||
if page == "..."
|
||||
html << "<li class='more'>"
|
||||
html << content_tag(:i, nil, class: "fas fa-ellipsis-h")
|
||||
html << ellipsis_icon
|
||||
html << "</li>"
|
||||
elsif page == current_page
|
||||
html << "<li class='current-page'>"
|
||||
|
||||
Reference in New Issue
Block a user