2015-04-26 12:48:37 +05:30
|
|
|
module SortingHelper
|
|
|
|
def sort_options_hash
|
|
|
|
{
|
|
|
|
sort_value_name => sort_title_name,
|
|
|
|
sort_value_recently_updated => sort_title_recently_updated,
|
|
|
|
sort_value_oldest_updated => sort_title_oldest_updated,
|
|
|
|
sort_value_recently_created => sort_title_recently_created,
|
|
|
|
sort_value_oldest_created => sort_title_oldest_created,
|
|
|
|
sort_value_milestone_soon => sort_title_milestone_soon,
|
|
|
|
sort_value_milestone_later => sort_title_milestone_later,
|
|
|
|
sort_value_largest_repo => sort_title_largest_repo,
|
|
|
|
sort_value_recently_signin => sort_title_recently_signin,
|
|
|
|
sort_value_oldest_signin => sort_title_oldest_signin,
|
2016-04-02 18:10:28 +05:30
|
|
|
sort_value_downvotes => sort_title_downvotes,
|
|
|
|
sort_value_upvotes => sort_title_upvotes
|
2015-04-26 12:48:37 +05:30
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_oldest_updated
|
|
|
|
'Oldest updated'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_recently_updated
|
2016-01-14 18:37:52 +05:30
|
|
|
'Last updated'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_oldest_created
|
|
|
|
'Oldest created'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_recently_created
|
2016-01-14 18:37:52 +05:30
|
|
|
'Last created'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_milestone_soon
|
|
|
|
'Milestone due soon'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_milestone_later
|
|
|
|
'Milestone due later'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_name
|
|
|
|
'Name'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_largest_repo
|
|
|
|
'Largest repository'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_recently_signin
|
|
|
|
'Recent sign in'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_oldest_signin
|
|
|
|
'Oldest sign in'
|
|
|
|
end
|
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
def sort_title_downvotes
|
|
|
|
'Least popular'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_title_upvotes
|
|
|
|
'Most popular'
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
def sort_value_oldest_updated
|
|
|
|
'updated_asc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_recently_updated
|
|
|
|
'updated_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_oldest_created
|
2016-01-14 18:37:52 +05:30
|
|
|
'id_asc'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_recently_created
|
2016-01-14 18:37:52 +05:30
|
|
|
'id_desc'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_milestone_soon
|
|
|
|
'milestone_due_asc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_milestone_later
|
|
|
|
'milestone_due_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_name
|
|
|
|
'name_asc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_largest_repo
|
|
|
|
'repository_size_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_recently_signin
|
|
|
|
'recent_sign_in'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_oldest_signin
|
|
|
|
'oldest_sign_in'
|
|
|
|
end
|
2016-04-02 18:10:28 +05:30
|
|
|
|
|
|
|
def sort_value_downvotes
|
|
|
|
'downvotes_desc'
|
|
|
|
end
|
|
|
|
|
|
|
|
def sort_value_upvotes
|
|
|
|
'upvotes_desc'
|
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|