Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
40e1ad90
Commit
40e1ad90
authored
Jan 14, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to sort forks. #2406
parent
af501845
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
app/controllers/projects/forks_controller.rb
app/controllers/projects/forks_controller.rb
+2
-0
app/views/projects/forks/index.html.haml
app/views/projects/forks/index.html.haml
+5
-4
No files found.
app/controllers/projects/forks_controller.rb
View file @
40e1ad90
...
@@ -5,6 +5,8 @@ class Projects::ForksController < Projects::ApplicationController
...
@@ -5,6 +5,8 @@ class Projects::ForksController < Projects::ApplicationController
def
index
def
index
@all_forks
=
project
.
forks
.
includes
(
:creator
)
@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
|
@public_forks
,
@protected_forks
=
@all_forks
.
partition
do
|
project
|
can?
(
current_user
,
:read_project
,
project
)
can?
(
current_user
,
:read_project
,
project
)
end
end
...
...
app/views/projects/forks/index.html.haml
View file @
40e1ad90
...
@@ -20,13 +20,14 @@
...
@@ -20,13 +20,14 @@
%b
.caret
%b
.caret
%ul
.dropdown-menu.dropdown-menu-align-right
%ul
.dropdown-menu.dropdown-menu-align-right
%li
%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
=
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
=
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
=
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
=
sort_title_oldest_updated
.fork_link.inline
.fork_link.inline
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment