BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
sorting_helper.rb
app/helpers/sorting_helper.rb
+18
-0
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