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
38984a59
Commit
38984a59
authored
Mar 04, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show active sorting method for projects list
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ee0f5bb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
21 deletions
+26
-21
app/helpers/sorting_helper.rb
app/helpers/sorting_helper.rb
+10
-0
app/views/shared/projects/_dropdown.html.haml
app/views/shared/projects/_dropdown.html.haml
+16
-21
No files found.
app/helpers/sorting_helper.rb
View file @
38984a59
...
@@ -16,6 +16,16 @@ module SortingHelper
...
@@ -16,6 +16,16 @@ module SortingHelper
}
}
end
end
def
projects_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
,
}
end
def
sort_title_oldest_updated
def
sort_title_oldest_updated
'Oldest updated'
'Oldest updated'
end
end
...
...
app/views/shared/projects/_dropdown.html.haml
View file @
38984a59
-
@sort
||=
sort_value_recently_updated
-
archived
=
params
[
:archived
]
.dropdown.inline
.dropdown.inline
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%span
.light
%span
.light
-
if
@sort
.
present?
=
projects_sort_options_hash
[
@sort
]
=
sort_options_hash
[
@sort
]
-
else
=
sort_title_recently_updated
%b
.caret
%b
.caret
%ul
.dropdown-menu.dropdown-menu-align-right
%ul
.dropdown-menu.dropdown-menu-align-right
%li
-
projects_sort_options_hash
.
each
do
|
value
,
title
|
=
link_to
filter_projects_path
(
sort:
sort_value_name
)
do
%li
=
sort_title_name
=
link_to
filter_projects_path
(
sort:
value
,
archived:
archived
)
do
=
link_to
filter_projects_path
(
sort:
sort_value_recently_created
)
do
=
icon
(
'check'
)
if
@sort
==
value
=
sort_title_recently_created
=
title
=
link_to
filter_projects_path
(
sort:
sort_value_oldest_created
)
do
=
sort_title_oldest_created
=
link_to
filter_projects_path
(
sort:
sort_value_recently_updated
)
do
=
sort_title_recently_updated
=
link_to
filter_projects_path
(
sort:
sort_value_oldest_updated
)
do
=
sort_title_oldest_updated
%li
.divider
%li
.divider
%li
%li
-
if
params
[
:archived
].
present?
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
nil
)
do
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
nil
)
do
=
icon
(
'check'
)
unless
params
[
:archived
].
present?
Hide archived projects
Hide archived projects
-
else
%li
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
true
)
do
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
true
)
do
Show archived projects
=
icon
(
'check'
)
if
params
[
:archived
].
present?
Show archived projects
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