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
Boxiang Sun
gitlab-ce
Commits
8b4e9720
Commit
8b4e9720
authored
Feb 06, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract events rendering to own action.
parent
30e022a2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
17 deletions
+22
-17
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+2
-2
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+3
-3
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+14
-10
app/views/groups/show.html.haml
app/views/groups/show.html.haml
+1
-1
app/views/shared/projects/_list.html.haml
app/views/shared/projects/_list.html.haml
+1
-1
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/controllers/dashboard/projects_controller.rb
View file @
8b4e9720
...
@@ -12,7 +12,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -12,7 +12,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects
=
@projects
.
search
(
terms
)
@projects
=
@projects
.
search
(
terms
)
end
end
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
!
terms
.
present?
@last_push
=
current_user
.
recent_push
@last_push
=
current_user
.
recent_push
respond_to
do
|
format
|
respond_to
do
|
format
|
...
@@ -41,7 +41,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -41,7 +41,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects
=
@projects
.
search
(
terms
)
@projects
=
@projects
.
search
(
terms
)
end
end
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
!
terms
.
present?
@last_push
=
current_user
.
recent_push
@last_push
=
current_user
.
recent_push
@groups
=
[]
@groups
=
[]
...
...
app/controllers/explore/projects_controller.rb
View file @
8b4e9720
...
@@ -8,7 +8,7 @@ class Explore::ProjectsController < Explore::ApplicationController
...
@@ -8,7 +8,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
!
params
[
:filter_projects
].
present?
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
@@ -24,7 +24,7 @@ class Explore::ProjectsController < Explore::ApplicationController
...
@@ -24,7 +24,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@projects
=
@projects
.
non_archived
@projects
=
@projects
.
non_archived
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
!
params
[
:filter_projects
].
present?
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
@@ -40,7 +40,7 @@ class Explore::ProjectsController < Explore::ApplicationController
...
@@ -40,7 +40,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
reorder
(
'star_count DESC'
)
@projects
=
@projects
.
reorder
(
'star_count DESC'
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
!
params
[
:filter_projects
].
present?
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
...
app/controllers/groups_controller.rb
View file @
8b4e9720
...
@@ -14,7 +14,7 @@ class GroupsController < Groups::ApplicationController
...
@@ -14,7 +14,7 @@ class GroupsController < Groups::ApplicationController
# Load group projects
# Load group projects
before_action
:load_projects
,
except:
[
:index
,
:new
,
:create
,
:projects
,
:edit
,
:update
,
:autocomplete
]
before_action
:load_projects
,
except:
[
:index
,
:new
,
:create
,
:projects
,
:edit
,
:update
,
:autocomplete
]
before_action
:event_filter
,
only:
:show
before_action
:event_filter
,
only:
[
:show
,
:events
]
layout
:determine_layout
layout
:determine_layout
...
@@ -42,20 +42,15 @@ class GroupsController < Groups::ApplicationController
...
@@ -42,20 +42,15 @@ class GroupsController < Groups::ApplicationController
@last_push
=
current_user
.
recent_push
if
current_user
@last_push
=
current_user
.
recent_push
if
current_user
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
!
params
[
:filter_projects
].
present?
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
json
do
format
.
json
do
if
params
[
:filter_projects
]
render
json:
{
render
json:
{
html:
view_to_html_string
(
"dashboard/projects/_projects"
,
locals:
{
projects:
@projects
})
html:
view_to_html_string
(
"dashboard/projects/_projects"
,
locals:
{
projects:
@projects
})
}
}
else
load_events
pager_json
(
"events/_events"
,
@events
.
count
)
end
end
end
format
.
atom
do
format
.
atom
do
...
@@ -65,6 +60,15 @@ class GroupsController < Groups::ApplicationController
...
@@ -65,6 +60,15 @@ class GroupsController < Groups::ApplicationController
end
end
end
end
def
events
respond_to
do
|
format
|
format
.
json
do
load_events
pager_json
(
"events/_events"
,
@events
.
count
)
end
end
end
def
edit
def
edit
end
end
...
...
app/views/groups/show.html.haml
View file @
8b4e9720
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
=
render
'shared/event_filter'
=
render
'shared/event_filter'
.content_list
.content_list
{
:"data-href"
=>
events_group_path
}
=
spinner
=
spinner
.tab-pane
#projects
.tab-pane
#projects
...
...
app/views/shared/projects/_list.html.haml
View file @
8b4e9720
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#{
projects_limit
}
of
#{
pluralize
(
projects
.
count
,
'project'
)
}
displayed.
#{
projects_limit
}
of
#{
pluralize
(
projects
.
count
,
'project'
)
}
displayed.
=
link_to
'#'
,
class:
'js-expand'
do
=
link_to
'#'
,
class:
'js-expand'
do
Show all
Show all
=
paginate
projects
,
theme:
"gitlab"
if
!
projects
.
kind_of?
(
Array
)
=
paginate
projects
,
theme:
"gitlab"
if
projects
.
respond_to?
:total_pages
-
else
-
else
%h3
No projects found
%h3
No projects found
...
...
config/routes.rb
View file @
8b4e9720
...
@@ -352,6 +352,7 @@ Rails.application.routes.draw do
...
@@ -352,6 +352,7 @@ Rails.application.routes.draw do
get
:issues
get
:issues
get
:merge_requests
get
:merge_requests
get
:projects
get
:projects
get
:events
end
end
scope
module: :groups
do
scope
module: :groups
do
...
...
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