Commit 40e1ad90 authored by Rubén Dávila's avatar Rubén Dávila

Add ability to sort forks. #2406

parent af501845
......@@ -5,6 +5,8 @@ class Projects::ForksController < Projects::ApplicationController
def index
@all_forks = project.forks.includes(:creator)
@all_forks = @all_forks.sort(params[:sort]) if params[:sort]
@public_forks, @protected_forks = @all_forks.partition do |project|
can?(current_user, :read_project, project)
end
......
......@@ -20,13 +20,14 @@
%b.caret
%ul.dropdown-menu.dropdown-menu-align-right
%li
= link_to page_filter_path(sort: sort_value_recently_created) do
- excluded_filters = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id]
= link_to page_filter_path(sort: sort_value_recently_created, without: excluded_filters) do
= sort_title_recently_created
= link_to page_filter_path(sort: sort_value_oldest_created) do
= link_to page_filter_path(sort: sort_value_oldest_created, without: excluded_filters) do
= sort_title_oldest_created
= link_to page_filter_path(sort: sort_value_recently_updated) do
= link_to page_filter_path(sort: sort_value_recently_updated, without: excluded_filters) do
= sort_title_recently_updated
= link_to page_filter_path(sort: sort_value_oldest_updated) do
= link_to page_filter_path(sort: sort_value_oldest_updated, without: excluded_filters) do
= sort_title_oldest_updated
.fork_link.inline
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment