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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
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
}
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
'Oldest updated'
end
...
...
app/views/shared/projects/_dropdown.html.haml
View file @
38984a59
-
@sort
||=
sort_value_recently_updated
-
archived
=
params
[
:archived
]
.dropdown.inline
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%span
.light
-
if
@sort
.
present?
=
sort_options_hash
[
@sort
]
-
else
=
sort_title_recently_updated
=
projects_sort_options_hash
[
@sort
]
%b
.caret
%ul
.dropdown-menu.dropdown-menu-align-right
%li
=
link_to
filter_projects_path
(
sort:
sort_value_name
)
do
=
sort_title_name
=
link_to
filter_projects_path
(
sort:
sort_value_recently_created
)
do
=
sort_title_recently_created
=
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
-
projects_sort_options_hash
.
each
do
|
value
,
title
|
%li
=
link_to
filter_projects_path
(
sort:
value
,
archived:
archived
)
do
=
icon
(
'check'
)
if
@sort
==
value
=
title
%li
.divider
%li
-
if
params
[
:archived
].
present?
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
nil
)
do
Hide archived projects
-
else
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
true
)
do
Show archived projects
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
nil
)
do
=
icon
(
'check'
)
unless
params
[
:archived
].
present?
Hide archived projects
%li
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
true
)
do
=
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