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
Kazuhiko Shiozaki
gitlab-ce
Commits
2c431f89
Commit
2c431f89
authored
Mar 04, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add projects list sort dropdown to group page
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
bebf34aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+4
-2
app/views/groups/_projects.html.haml
app/views/groups/_projects.html.haml
+5
-4
No files found.
app/controllers/groups_controller.rb
View file @
2c431f89
class
GroupsController
<
Groups
::
ApplicationController
include
FilterProjects
include
IssuesAction
include
MergeRequestsAction
...
...
@@ -41,7 +42,8 @@ class GroupsController < Groups::ApplicationController
def
show
@last_push
=
current_user
.
recent_push
if
current_user
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
filter_projects
(
@projects
)
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
params
[
:filter_projects
].
blank?
respond_to
do
|
format
|
...
...
@@ -98,7 +100,7 @@ class GroupsController < Groups::ApplicationController
end
def
load_projects
@projects
||=
ProjectsFinder
.
new
.
execute
(
current_user
,
group:
group
).
sorted_by_activity
.
non_archived
@projects
||=
ProjectsFinder
.
new
.
execute
(
current_user
,
group:
group
).
sorted_by_activity
end
# Dont allow unauthorized access to group
...
...
app/views/groups/_projects.html.haml
View file @
2c431f89
...
...
@@ -3,9 +3,10 @@
=
form_tag
request
.
original_url
,
method: :get
,
class:
'project-filter-form'
,
id:
'project-filter-form'
do
|
f
|
-
if
@projects
.
present?
=
search_field_tag
:filter_projects
,
nil
,
placeholder:
'Filter by name'
,
class:
'projects-list-filter form-control'
,
spellcheck:
false
-
if
can?
current_user
,
:create_projects
,
@group
=
link_to
new_project_path
(
namespace_id:
@group
.
id
),
class:
'btn btn-new pull-right'
do
=
icon
(
'plus'
)
New Project
=
render
'shared/projects/dropdown'
-
if
can?
current_user
,
:create_projects
,
@group
=
link_to
new_project_path
(
namespace_id:
@group
.
id
),
class:
'btn btn-new pull-right'
do
=
icon
(
'plus'
)
New Project
=
render
'shared/projects/list'
,
projects:
@projects
,
stars:
false
,
skip_namespace:
true
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