Skip to content
代码片段 群组 项目
提交 a4095a8d 编辑于 作者: Abdul Wadood's avatar Abdul Wadood 提交者: drew stachon
浏览文件

Migrate buttons to Pajamas

Migrate sort buttons to use Pajamas component.

Changelog: other
上级 1aa9d2d6
No related branches found
No related tags found
无相关合并请求
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
module SortingHelper module SortingHelper
include SortingTitlesValuesHelper include SortingTitlesValuesHelper
include ButtonHelper
# rubocop: disable Metrics/AbcSize # rubocop: disable Metrics/AbcSize
def sort_options_hash def sort_options_hash
...@@ -167,10 +168,6 @@ def starrers_sort_options_hash ...@@ -167,10 +168,6 @@ def starrers_sort_options_hash
} }
end end
def sortable_item(item, path, sorted_by)
link_to item, path, class: sorted_by == item ? 'is-active' : ''
end
def issuable_sort_option_overrides def issuable_sort_option_overrides
{ {
sort_value_oldest_created => sort_value_created_date, sort_value_oldest_created => sort_value_created_date,
...@@ -275,7 +272,7 @@ def sort_direction_icon(sort_value) ...@@ -275,7 +272,7 @@ def sort_direction_icon(sort_value)
end end
def sort_direction_button(reverse_url, reverse_sort, sort_value) def sort_direction_button(reverse_url, reverse_sort, sort_value)
link_class = 'gl-button btn btn-default btn-icon has-tooltip reverse-sort-btn rspec-reverse-sort' link_class = 'has-tooltip reverse-sort-btn rspec-reverse-sort'
icon = sort_direction_icon(sort_value) icon = sort_direction_icon(sort_value)
url = reverse_url url = reverse_url
...@@ -284,9 +281,7 @@ def sort_direction_button(reverse_url, reverse_sort, sort_value) ...@@ -284,9 +281,7 @@ def sort_direction_button(reverse_url, reverse_sort, sort_value)
link_class += ' disabled' link_class += ' disabled'
end end
link_to(url, type: 'button', class: link_class, title: s_('SortOptions|Sort direction')) do link_button_to nil, url, class: link_class, title: s_('SortOptions|Sort direction'), icon: icon
sprite_icon(icon)
end
end end
def issuable_sort_direction_button(sort_value) def issuable_sort_direction_button(sort_value)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册