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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7783267d
Commit
7783267d
authored
Nov 16, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to sort group/project members by access level
parent
59d43bea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
app/helpers/sorting_helper.rb
app/helpers/sorting_helper.rb
+18
-0
app/models/member.rb
app/models/member.rb
+2
-0
No files found.
app/helpers/sorting_helper.rb
View file @
7783267d
...
...
@@ -37,6 +37,8 @@ module SortingHelper
def
member_sort_options_hash
{
sort_value_access_level_asc
=>
sort_title_access_level_asc
,
sort_value_access_level_desc
=>
sort_title_access_level_desc
,
sort_value_last_joined
=>
sort_title_last_joined
,
sort_value_oldest_joined
=>
sort_title_oldest_joined
,
sort_value_name
=>
sort_title_name_asc
,
...
...
@@ -114,6 +116,14 @@ module SortingHelper
'Oldest joined'
end
def
sort_title_access_level_asc
'Access level, ascending'
end
def
sort_title_access_level_desc
'Access level, descending'
end
def
sort_title_name_asc
'Name, ascending'
end
...
...
@@ -130,6 +140,14 @@ module SortingHelper
'oldest_joined'
end
def
sort_value_access_level_asc
'access_level_asc'
end
def
sort_value_access_level_desc
'access_level_desc'
end
def
sort_value_name_desc
'name_desc'
end
...
...
app/models/member.rb
View file @
7783267d
...
...
@@ -83,6 +83,8 @@ class Member < ActiveRecord::Base
def
sort
(
method
)
case
method
.
to_s
when
'access_level_asc'
then
reorder
(
access_level: :asc
)
when
'access_level_desc'
then
reorder
(
access_level: :desc
)
when
'recent_sign_in'
then
order_recent_sign_in
when
'oldest_sign_in'
then
order_oldest_sign_in
when
'last_joined'
then
order_created_desc
...
...
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