2018-08-18 07:19:57 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-12-04 05:10:38 -05:00
|
|
|
module SortingHelper
|
2019-09-13 09:26:31 -04:00
|
|
|
prepend_if_ee('::EE::SortingHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
|
|
|
|
|
2015-02-05 22:15:05 -05:00
|
|
|
def sort_options_hash
|
|
|
|
{
|
2019-05-21 18:46:12 -04:00
|
|
|
sort_value_created_date => sort_title_created_date,
|
|
|
|
sort_value_downvotes => sort_title_downvotes,
|
|
|
|
sort_value_due_date => sort_title_due_date,
|
|
|
|
sort_value_due_date_later => sort_title_due_date_later,
|
|
|
|
sort_value_due_date_soon => sort_title_due_date_soon,
|
|
|
|
sort_value_label_priority => sort_title_label_priority,
|
|
|
|
sort_value_largest_group => sort_title_largest_group,
|
|
|
|
sort_value_largest_repo => sort_title_largest_repo,
|
|
|
|
sort_value_milestone => sort_title_milestone,
|
|
|
|
sort_value_milestone_later => sort_title_milestone_later,
|
|
|
|
sort_value_milestone_soon => sort_title_milestone_soon,
|
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_name_desc => sort_title_name_desc,
|
|
|
|
sort_value_oldest_created => sort_title_oldest_created,
|
|
|
|
sort_value_oldest_signin => sort_title_oldest_signin,
|
|
|
|
sort_value_oldest_updated => sort_title_oldest_updated,
|
|
|
|
sort_value_recently_created => sort_title_recently_created,
|
|
|
|
sort_value_recently_signin => sort_title_recently_signin,
|
|
|
|
sort_value_recently_updated => sort_title_recently_updated,
|
|
|
|
sort_value_popularity => sort_title_popularity,
|
|
|
|
sort_value_priority => sort_title_priority,
|
|
|
|
sort_value_upvotes => sort_title_upvotes,
|
|
|
|
sort_value_contacted_date => sort_title_contacted_date,
|
2019-09-18 17:06:34 -04:00
|
|
|
sort_value_relative_position => sort_title_relative_position,
|
|
|
|
sort_value_size => sort_title_size,
|
|
|
|
sort_value_expire_date => sort_title_expire_date
|
2015-02-05 22:15:05 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2016-03-04 11:53:13 -05:00
|
|
|
def projects_sort_options_hash
|
2019-07-09 07:31:57 -04:00
|
|
|
use_old_sorting = Feature.disabled?(:project_list_filter_bar) || current_controller?('admin/projects')
|
2019-04-12 08:14:28 -04:00
|
|
|
|
2019-07-08 02:33:42 -04:00
|
|
|
options = {
|
|
|
|
sort_value_latest_activity => sort_title_latest_activity,
|
|
|
|
sort_value_recently_created => sort_title_created_date,
|
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_stars_desc => sort_title_stars
|
|
|
|
}
|
|
|
|
|
|
|
|
if use_old_sorting
|
|
|
|
options = options.merge({
|
|
|
|
sort_value_oldest_activity => sort_title_oldest_activity,
|
|
|
|
sort_value_oldest_created => sort_title_oldest_created,
|
|
|
|
sort_value_recently_created => sort_title_recently_created,
|
|
|
|
sort_value_stars_desc => sort_title_most_stars
|
|
|
|
})
|
|
|
|
end
|
2016-08-12 15:57:19 -04:00
|
|
|
|
2019-04-17 07:02:34 -04:00
|
|
|
if current_controller?('admin/projects')
|
2017-02-21 18:50:22 -05:00
|
|
|
options[sort_value_largest_repo] = sort_title_largest_repo
|
2016-08-12 15:57:19 -04:00
|
|
|
end
|
|
|
|
|
2019-04-17 07:02:34 -04:00
|
|
|
options
|
|
|
|
end
|
|
|
|
|
2019-04-05 08:41:28 -04:00
|
|
|
def projects_sort_option_titles
|
2019-07-08 02:33:42 -04:00
|
|
|
# Only used for the project filter search bar
|
|
|
|
projects_sort_options_hash.merge({
|
2019-04-05 08:41:28 -04:00
|
|
|
sort_value_oldest_activity => sort_title_latest_activity,
|
2019-04-12 08:14:28 -04:00
|
|
|
sort_value_oldest_created => sort_title_created_date,
|
2019-04-05 08:41:28 -04:00
|
|
|
sort_value_name_desc => sort_title_name,
|
2019-04-19 04:36:16 -04:00
|
|
|
sort_value_stars_asc => sort_title_stars
|
2019-06-16 22:08:10 -04:00
|
|
|
})
|
2019-04-05 08:41:28 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def projects_reverse_sort_options_hash
|
|
|
|
{
|
|
|
|
sort_value_latest_activity => sort_value_oldest_activity,
|
|
|
|
sort_value_recently_created => sort_value_oldest_created,
|
|
|
|
sort_value_name => sort_value_name_desc,
|
2019-04-19 04:36:16 -04:00
|
|
|
sort_value_stars_desc => sort_value_stars_asc,
|
2019-04-05 08:41:28 -04:00
|
|
|
sort_value_oldest_activity => sort_value_latest_activity,
|
|
|
|
sort_value_oldest_created => sort_value_recently_created,
|
|
|
|
sort_value_name_desc => sort_value_name,
|
2019-04-19 04:36:16 -04:00
|
|
|
sort_value_stars_asc => sort_value_stars_desc
|
2019-04-05 08:41:28 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2017-10-04 10:10:24 -04:00
|
|
|
def groups_sort_options_hash
|
2017-12-20 07:09:35 -05:00
|
|
|
{
|
2018-10-11 10:14:44 -04:00
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_name_desc => sort_title_name_desc,
|
2017-10-04 10:10:24 -04:00
|
|
|
sort_value_recently_created => sort_title_recently_created,
|
2018-10-11 10:14:44 -04:00
|
|
|
sort_value_oldest_created => sort_title_oldest_created,
|
2017-10-04 10:10:24 -04:00
|
|
|
sort_value_recently_updated => sort_title_recently_updated,
|
2018-10-11 10:14:44 -04:00
|
|
|
sort_value_oldest_updated => sort_title_oldest_updated
|
2017-10-04 10:10:24 -04:00
|
|
|
}
|
2017-12-20 07:09:35 -05:00
|
|
|
end
|
2017-10-04 10:10:24 -04:00
|
|
|
|
2018-10-11 10:14:44 -04:00
|
|
|
def subgroups_sort_options_hash
|
|
|
|
groups_sort_options_hash.merge(
|
2019-04-19 04:36:16 -04:00
|
|
|
sort_value_stars_desc => sort_title_most_stars
|
2018-10-11 10:14:44 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2017-12-20 07:09:35 -05:00
|
|
|
def admin_groups_sort_options_hash
|
|
|
|
groups_sort_options_hash.merge(
|
|
|
|
sort_value_largest_group => sort_title_largest_group
|
|
|
|
)
|
2017-10-04 10:10:24 -04:00
|
|
|
end
|
|
|
|
|
2016-10-18 08:22:18 -04:00
|
|
|
def member_sort_options_hash
|
|
|
|
{
|
2017-09-22 20:46:53 -04:00
|
|
|
sort_value_access_level_asc => sort_title_access_level_asc,
|
2016-11-16 16:45:35 -05:00
|
|
|
sort_value_access_level_desc => sort_title_access_level_desc,
|
2017-09-22 20:46:53 -04:00
|
|
|
sort_value_last_joined => sort_title_last_joined,
|
|
|
|
sort_value_name => sort_title_name_asc,
|
|
|
|
sort_value_name_desc => sort_title_name_desc,
|
|
|
|
sort_value_oldest_joined => sort_title_oldest_joined,
|
|
|
|
sort_value_oldest_signin => sort_title_oldest_signin,
|
|
|
|
sort_value_recently_signin => sort_title_recently_signin
|
2016-10-18 08:22:18 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2017-03-23 20:39:12 -04:00
|
|
|
def milestone_sort_options_hash
|
|
|
|
{
|
2017-09-22 20:46:53 -04:00
|
|
|
sort_value_name => sort_title_name_asc,
|
|
|
|
sort_value_name_desc => sort_title_name_desc,
|
|
|
|
sort_value_due_date_later => sort_title_due_date_later,
|
|
|
|
sort_value_due_date_soon => sort_title_due_date_soon,
|
|
|
|
sort_value_start_date_later => sort_title_start_date_later,
|
|
|
|
sort_value_start_date_soon => sort_title_start_date_soon
|
2017-03-23 20:39:12 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2017-04-18 08:48:52 -04:00
|
|
|
def branches_sort_options_hash
|
|
|
|
{
|
2017-09-22 20:46:53 -04:00
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_oldest_updated => sort_title_oldest_updated,
|
|
|
|
sort_value_recently_updated => sort_title_recently_updated
|
2017-04-18 08:48:52 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2017-05-03 04:06:28 -04:00
|
|
|
def tags_sort_options_hash
|
|
|
|
{
|
2017-09-22 20:46:53 -04:00
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_oldest_updated => sort_title_oldest_updated,
|
|
|
|
sort_value_recently_updated => sort_title_recently_updated
|
2017-05-03 04:06:28 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2018-09-10 07:38:29 -04:00
|
|
|
def label_sort_options_hash
|
|
|
|
{
|
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_name_desc => sort_title_name_desc,
|
|
|
|
sort_value_recently_created => sort_title_recently_created,
|
|
|
|
sort_value_oldest_created => sort_title_oldest_created,
|
|
|
|
sort_value_recently_updated => sort_title_recently_updated,
|
|
|
|
sort_value_oldest_updated => sort_title_oldest_updated
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2018-11-29 07:00:20 -05:00
|
|
|
def users_sort_options_hash
|
|
|
|
{
|
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_recently_signin => sort_title_recently_signin,
|
|
|
|
sort_value_oldest_signin => sort_title_oldest_signin,
|
|
|
|
sort_value_recently_created => sort_title_recently_created,
|
|
|
|
sort_value_oldest_created => sort_title_oldest_created,
|
|
|
|
sort_value_recently_updated => sort_title_recently_updated,
|
2019-01-07 06:54:41 -05:00
|
|
|
sort_value_oldest_updated => sort_title_oldest_updated,
|
|
|
|
sort_value_recently_last_activity => sort_title_recently_last_activity,
|
|
|
|
sort_value_oldest_last_activity => sort_title_oldest_last_activity
|
2018-11-29 07:00:20 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2019-01-28 07:19:53 -05:00
|
|
|
def starrers_sort_options_hash
|
|
|
|
{
|
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_name_desc => sort_title_name_desc,
|
|
|
|
sort_value_recently_created => sort_title_recently_starred,
|
|
|
|
sort_value_oldest_created => sort_title_oldest_starred
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sortable_item(item, path, sorted_by)
|
|
|
|
link_to item, path, class: sorted_by == item ? 'is-active' : ''
|
2017-03-10 06:10:48 -05:00
|
|
|
end
|
|
|
|
|
2018-12-06 11:57:19 -05:00
|
|
|
def issuable_sort_option_overrides
|
|
|
|
{
|
|
|
|
sort_value_oldest_created => sort_value_created_date,
|
|
|
|
sort_value_oldest_updated => sort_value_recently_updated,
|
2019-05-04 12:16:47 -04:00
|
|
|
sort_value_milestone_later => sort_value_milestone,
|
|
|
|
sort_value_due_date_later => sort_value_due_date,
|
|
|
|
sort_value_least_popular => sort_value_popularity
|
2018-12-06 11:57:19 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def issuable_reverse_sort_order_hash
|
|
|
|
{
|
|
|
|
sort_value_created_date => sort_value_oldest_created,
|
|
|
|
sort_value_recently_created => sort_value_oldest_created,
|
|
|
|
sort_value_recently_updated => sort_value_oldest_updated,
|
2019-05-04 12:16:47 -04:00
|
|
|
sort_value_milestone => sort_value_milestone_later,
|
|
|
|
sort_value_due_date => sort_value_due_date_later,
|
|
|
|
sort_value_due_date_soon => sort_value_due_date_later,
|
|
|
|
sort_value_popularity => sort_value_least_popular,
|
|
|
|
sort_value_most_popular => sort_value_least_popular
|
2018-12-06 11:57:19 -05:00
|
|
|
}.merge(issuable_sort_option_overrides)
|
|
|
|
end
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
def audit_logs_sort_order_hash
|
|
|
|
{
|
|
|
|
sort_value_recently_created => sort_title_recently_created,
|
|
|
|
sort_value_oldest_created => sort_title_oldest_created
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2018-12-06 11:57:19 -05:00
|
|
|
def issuable_sort_option_title(sort_value)
|
|
|
|
sort_value = issuable_sort_option_overrides[sort_value] || sort_value
|
|
|
|
|
|
|
|
sort_options_hash[sort_value]
|
|
|
|
end
|
|
|
|
|
2019-07-08 20:33:30 -04:00
|
|
|
def sort_direction_icon(sort_value)
|
2018-12-12 19:59:31 -05:00
|
|
|
case sort_value
|
|
|
|
when sort_value_milestone, sort_value_due_date, /_asc\z/
|
2019-07-08 20:33:30 -04:00
|
|
|
'sort-lowest'
|
2018-12-12 19:59:31 -05:00
|
|
|
else
|
2019-07-08 20:33:30 -04:00
|
|
|
'sort-highest'
|
2018-12-12 19:59:31 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-07-08 20:33:30 -04:00
|
|
|
def sort_direction_button(reverse_url, reverse_sort, sort_value)
|
2019-07-29 15:19:44 -04:00
|
|
|
link_class = 'btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort'
|
2019-07-08 20:33:30 -04:00
|
|
|
icon = sort_direction_icon(sort_value)
|
|
|
|
url = reverse_url
|
2018-12-06 11:57:19 -05:00
|
|
|
|
2019-07-08 20:33:30 -04:00
|
|
|
unless reverse_sort
|
|
|
|
url = '#'
|
2018-12-06 11:57:19 -05:00
|
|
|
link_class += ' disabled'
|
|
|
|
end
|
|
|
|
|
2019-07-08 20:33:30 -04:00
|
|
|
link_to(url, type: 'button', class: link_class, title: s_('SortOptions|Sort direction')) do
|
|
|
|
sprite_icon(icon, size: 16)
|
2018-12-06 11:57:19 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-07-08 20:33:30 -04:00
|
|
|
def issuable_sort_direction_button(sort_value)
|
|
|
|
reverse_sort = issuable_reverse_sort_order_hash[sort_value]
|
|
|
|
url = page_filter_path(sort: reverse_sort)
|
|
|
|
|
|
|
|
sort_direction_button(url, reverse_sort, sort_value)
|
|
|
|
end
|
|
|
|
|
2019-04-05 08:41:28 -04:00
|
|
|
def project_sort_direction_button(sort_value)
|
|
|
|
reverse_sort = projects_reverse_sort_options_hash[sort_value]
|
2019-07-08 20:33:30 -04:00
|
|
|
url = filter_projects_path(sort: reverse_sort)
|
2019-04-05 08:41:28 -04:00
|
|
|
|
2019-07-08 20:33:30 -04:00
|
|
|
sort_direction_button(url, reverse_sort, sort_value)
|
2019-04-05 08:41:28 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
# Titles.
|
|
|
|
def sort_title_access_level_asc
|
|
|
|
s_('SortOptions|Access level, ascending')
|
2016-03-14 05:46:26 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_access_level_desc
|
|
|
|
s_('SortOptions|Access level, descending')
|
2014-12-04 05:10:38 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_created_date
|
|
|
|
s_('SortOptions|Created date')
|
2014-12-04 05:10:38 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_downvotes
|
|
|
|
s_('SortOptions|Least popular')
|
2017-03-03 05:35:04 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_due_date
|
|
|
|
s_('SortOptions|Due date')
|
2017-03-03 05:35:04 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_due_date_later
|
|
|
|
s_('SortOptions|Due later')
|
2014-12-04 05:10:38 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_due_date_soon
|
|
|
|
s_('SortOptions|Due soon')
|
2014-12-04 05:10:38 -05:00
|
|
|
end
|
2015-02-05 22:15:05 -05:00
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_label_priority
|
|
|
|
s_('SortOptions|Label priority')
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_largest_group
|
|
|
|
s_('SortOptions|Largest group')
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_largest_repo
|
|
|
|
s_('SortOptions|Largest repository')
|
2016-03-10 09:26:56 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_last_joined
|
|
|
|
s_('SortOptions|Last joined')
|
2016-03-10 09:26:56 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_latest_activity
|
|
|
|
s_('SortOptions|Last updated')
|
2017-03-23 20:39:12 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_milestone
|
2018-12-31 04:46:11 -05:00
|
|
|
s_('SortOptions|Milestone due date')
|
2017-09-22 20:46:53 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_milestone_later
|
|
|
|
s_('SortOptions|Milestone due later')
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_milestone_soon
|
|
|
|
s_('SortOptions|Milestone due soon')
|
2017-03-23 20:39:12 -04:00
|
|
|
end
|
|
|
|
|
2015-02-05 22:15:05 -05:00
|
|
|
def sort_title_name
|
2017-09-22 12:01:20 -04:00
|
|
|
s_('SortOptions|Name')
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_name_asc
|
|
|
|
s_('SortOptions|Name, ascending')
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_name_desc
|
|
|
|
s_('SortOptions|Name, descending')
|
2016-11-22 11:58:10 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_oldest_activity
|
|
|
|
s_('SortOptions|Oldest updated')
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_oldest_created
|
|
|
|
s_('SortOptions|Oldest created')
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_oldest_joined
|
|
|
|
s_('SortOptions|Oldest joined')
|
2016-02-17 08:32:02 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_oldest_signin
|
|
|
|
s_('SortOptions|Oldest sign in')
|
2016-02-17 08:32:02 -05:00
|
|
|
end
|
|
|
|
|
2019-01-28 07:19:53 -05:00
|
|
|
def sort_title_oldest_starred
|
|
|
|
s_('SortOptions|Oldest starred')
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_oldest_updated
|
|
|
|
s_('SortOptions|Oldest updated')
|
2016-10-18 08:22:18 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_popularity
|
|
|
|
s_('SortOptions|Popularity')
|
2016-10-18 08:22:18 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_priority
|
|
|
|
s_('SortOptions|Priority')
|
2016-11-16 16:45:35 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_recently_created
|
|
|
|
s_('SortOptions|Last created')
|
2016-11-16 16:45:35 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_recently_signin
|
|
|
|
s_('SortOptions|Recent sign in')
|
2016-10-18 08:22:18 -04:00
|
|
|
end
|
|
|
|
|
2019-01-28 07:19:53 -05:00
|
|
|
def sort_title_recently_starred
|
|
|
|
s_('SortOptions|Recently starred')
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_recently_updated
|
|
|
|
s_('SortOptions|Last updated')
|
2016-10-18 08:22:18 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_start_date_later
|
|
|
|
s_('SortOptions|Start later')
|
2016-10-18 08:22:18 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_start_date_soon
|
|
|
|
s_('SortOptions|Start soon')
|
2016-10-18 08:22:18 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_title_upvotes
|
|
|
|
s_('SortOptions|Most popular')
|
|
|
|
end
|
|
|
|
|
2018-07-12 12:15:03 -04:00
|
|
|
def sort_title_contacted_date
|
|
|
|
s_('SortOptions|Last Contact')
|
|
|
|
end
|
|
|
|
|
2018-09-21 13:06:55 -04:00
|
|
|
def sort_title_most_stars
|
|
|
|
s_('SortOptions|Most stars')
|
|
|
|
end
|
|
|
|
|
2019-04-05 08:41:28 -04:00
|
|
|
def sort_title_stars
|
|
|
|
s_('SortOptions|Stars')
|
|
|
|
end
|
|
|
|
|
2019-01-07 06:54:41 -05:00
|
|
|
def sort_title_oldest_last_activity
|
|
|
|
s_('SortOptions|Oldest last activity')
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_recently_last_activity
|
|
|
|
s_('SortOptions|Recent last activity')
|
|
|
|
end
|
|
|
|
|
2019-05-21 18:46:12 -04:00
|
|
|
def sort_title_relative_position
|
|
|
|
s_('SortOptions|Manual')
|
|
|
|
end
|
|
|
|
|
2019-09-18 17:06:34 -04:00
|
|
|
def sort_title_size
|
|
|
|
s_('SortOptions|Size')
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_expire_date
|
|
|
|
s_('SortOptions|Expired date')
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
# Values.
|
2016-11-16 16:45:35 -05:00
|
|
|
def sort_value_access_level_asc
|
|
|
|
'access_level_asc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_access_level_desc
|
|
|
|
'access_level_desc'
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_created_date
|
|
|
|
'created_date'
|
2016-10-18 08:22:18 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_downvotes
|
|
|
|
'downvotes_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_due_date
|
|
|
|
'due_date'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_due_date_later
|
|
|
|
'due_date_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_due_date_soon
|
|
|
|
'due_date_asc'
|
2016-03-14 05:46:26 -04:00
|
|
|
end
|
|
|
|
|
2017-03-10 06:10:48 -05:00
|
|
|
def sort_value_label_priority
|
|
|
|
'label_priority'
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_largest_group
|
|
|
|
'storage_size_desc'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_largest_repo
|
|
|
|
'storage_size_desc'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_last_joined
|
|
|
|
'last_joined'
|
2017-03-03 05:35:04 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_latest_activity
|
|
|
|
'latest_activity_desc'
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_milestone
|
|
|
|
'milestone'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_milestone_later
|
|
|
|
'milestone_due_desc'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_milestone_soon
|
|
|
|
'milestone_due_asc'
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_name
|
|
|
|
'name_asc'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_name_desc
|
|
|
|
'name_desc'
|
2016-03-10 09:26:56 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_oldest_activity
|
|
|
|
'latest_activity_asc'
|
2016-03-10 09:26:56 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_oldest_created
|
|
|
|
'created_asc'
|
2017-03-23 20:39:12 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_oldest_signin
|
|
|
|
'oldest_sign_in'
|
2017-03-23 20:39:12 -04:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_oldest_joined
|
|
|
|
'oldest_joined'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_oldest_updated
|
|
|
|
'updated_asc'
|
2016-11-22 11:58:10 -05:00
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_popularity
|
|
|
|
'popularity'
|
|
|
|
end
|
|
|
|
|
2019-05-04 12:16:47 -04:00
|
|
|
def sort_value_most_popular
|
|
|
|
'popularity_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_least_popular
|
|
|
|
'popularity_asc'
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_priority
|
|
|
|
'priority'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_recently_created
|
|
|
|
'created_desc'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_recently_signin
|
|
|
|
'recent_sign_in'
|
|
|
|
end
|
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_recently_updated
|
|
|
|
'updated_desc'
|
2015-02-05 22:15:05 -05:00
|
|
|
end
|
2016-02-17 08:32:02 -05:00
|
|
|
|
2017-09-22 20:46:53 -04:00
|
|
|
def sort_value_start_date_later
|
|
|
|
'start_date_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_start_date_soon
|
|
|
|
'start_date_asc'
|
2016-02-17 08:32:02 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_upvotes
|
|
|
|
'upvotes_desc'
|
|
|
|
end
|
2018-07-12 12:15:03 -04:00
|
|
|
|
|
|
|
def sort_value_contacted_date
|
|
|
|
'contacted_asc'
|
|
|
|
end
|
2018-09-21 13:06:55 -04:00
|
|
|
|
2019-04-19 04:36:16 -04:00
|
|
|
def sort_value_stars_desc
|
2018-09-21 13:06:55 -04:00
|
|
|
'stars_desc'
|
|
|
|
end
|
2019-01-07 06:54:41 -05:00
|
|
|
|
2019-04-19 04:36:16 -04:00
|
|
|
def sort_value_stars_asc
|
2019-04-05 08:41:28 -04:00
|
|
|
'stars_asc'
|
|
|
|
end
|
|
|
|
|
2019-01-07 06:54:41 -05:00
|
|
|
def sort_value_oldest_last_activity
|
|
|
|
'last_activity_on_asc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_recently_last_activity
|
|
|
|
'last_activity_on_desc'
|
|
|
|
end
|
2019-05-21 18:46:12 -04:00
|
|
|
|
|
|
|
def sort_value_relative_position
|
|
|
|
'relative_position'
|
|
|
|
end
|
2019-09-18 17:06:34 -04:00
|
|
|
|
|
|
|
def sort_value_size
|
|
|
|
'size_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_expire_date
|
|
|
|
'expired_asc'
|
|
|
|
end
|
2014-12-04 05:10:38 -05:00
|
|
|
end
|