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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
2ad09413
Commit
2ad09413
authored
Feb 03, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various filter fixes
parent
2c871ca1
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
90 additions
and
62 deletions
+90
-62
app/assets/javascripts/dashboard.js.coffee
app/assets/javascripts/dashboard.js.coffee
+30
-3
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+1
-1
app/assets/javascripts/issues.js.coffee
app/assets/javascripts/issues.js.coffee
+1
-1
app/assets/javascripts/projects_list.js.coffee
app/assets/javascripts/projects_list.js.coffee
+16
-27
app/assets/javascripts/user.js.coffee
app/assets/javascripts/user.js.coffee
+1
-1
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+2
-2
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+11
-3
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+6
-6
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+1
-0
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+2
-1
app/models/event.rb
app/models/event.rb
+1
-1
app/views/dashboard/_projects_head.html.haml
app/views/dashboard/_projects_head.html.haml
+2
-2
app/views/dashboard/projects/_projects.html.haml
app/views/dashboard/projects/_projects.html.haml
+2
-2
app/views/explore/projects/_projects.html.haml
app/views/explore/projects/_projects.html.haml
+2
-2
app/views/explore/projects/starred.html.haml
app/views/explore/projects/starred.html.haml
+2
-2
app/views/explore/projects/trending.html.haml
app/views/explore/projects/trending.html.haml
+1
-1
app/views/projects/show.atom.builder
app/views/projects/show.atom.builder
+1
-1
app/views/shared/projects/_list.html.haml
app/views/shared/projects/_list.html.haml
+8
-6
No files found.
app/assets/javascripts/dashboard.js.coffee
View file @
2ad09413
class
@
Dashboard
@
Dashboard
=
constructor
:
->
init
:
->
ProjectsList
.
init
()
this
.
initSearch
()
initSearch
:
->
@
timer
=
null
$
(
"#project-filter-form-field"
).
keyup
->
clearTimeout
(
@
timer
)
@
timer
=
setTimeout
(
Dashboard
.
filterResults
,
500
)
filterResults
:
=>
$
(
'.projects-list-holder'
).
css
(
"opacity"
,
'0.5'
)
form
=
null
form
=
$
(
"#project-filter-form"
)
search
=
$
(
"#project-filter-form-field"
).
val
()
project_filter_url
=
form
.
attr
(
'action'
)
+
'?'
+
form
.
serialize
()
$
.
ajax
type
:
"GET"
url
:
form
.
attr
(
'action'
)
data
:
form
.
serialize
()
complete
:
->
$
(
'.projects-list-holder'
).
css
(
"opacity"
,
'1.0'
)
success
:
(
data
)
->
$
(
'div.projects-list-holder'
).
replaceWith
(
data
.
html
)
# Change url so if user reload a page - search results are saved
history
.
replaceState
{
page
:
project_filter_url
},
document
.
title
,
project_filter_url
dataType
:
"json"
#uiBox.find("ul.projects-list li.bottom").hide()
app/assets/javascripts/dispatcher.js.coffee
View file @
2ad09413
...
@@ -58,7 +58,7 @@ class Dispatcher
...
@@ -58,7 +58,7 @@ class Dispatcher
shortcut_handler
=
new
ShortcutsNavigation
()
shortcut_handler
=
new
ShortcutsNavigation
()
MergeRequests
.
init
()
MergeRequests
.
init
()
when
'dashboard:show'
,
'root:show'
when
'dashboard:show'
,
'root:show'
new
Dashboard
()
Dashboard
.
init
()
when
'dashboard:activity'
when
'dashboard:activity'
new
Activities
()
new
Activities
()
when
'dashboard:projects:starred'
when
'dashboard:projects:starred'
...
...
app/assets/javascripts/issues.js.coffee
View file @
2ad09413
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
filterResults
:
=>
filterResults
:
=>
form
=
$
(
"#issue_search_form"
)
form
=
$
(
"#issue_search_form"
)
search
=
$
(
"#
projects-list-filter
"
).
val
()
search
=
$
(
"#
issue_search
"
).
val
()
$
(
'.issues-holder'
).
css
(
"opacity"
,
'0.5'
)
$
(
'.issues-holder'
).
css
(
"opacity"
,
'0.5'
)
issues_url
=
form
.
attr
(
'action'
)
+
'?'
+
form
.
serialize
()
issues_url
=
form
.
attr
(
'action'
)
+
'?'
+
form
.
serialize
()
...
...
app/assets/javascripts/projects_list.js.coffee
View file @
2ad09413
@
ProjectsList
=
class
@
ProjectsList
init
:
->
constructor
:
->
$
(
".projects-list .js-expand"
).
on
'click'
,
(
e
)
->
$
(
".projects-list .js-expand"
).
on
'click'
,
(
e
)
->
e
.
preventDefault
()
e
.
preventDefault
()
list
=
$
(
this
).
closest
(
'.projects-list'
)
list
=
$
(
this
).
closest
(
'.projects-list'
)
list
.
find
(
"li"
).
show
()
list
.
find
(
"li"
).
show
()
list
.
find
(
"li.bottom"
).
hide
()
list
.
find
(
"li.bottom"
).
hide
()
this
.
initSearch
()
initSearch
:
->
$
(
".projects-list-filter"
).
keyup
->
@
timer
=
null
terms
=
$
(
this
).
val
()
$
(
"#projects-list-filter"
).
keyup
->
uiBox
=
$
(
'div.projects-list-holder'
)
clearTimeout
(
@
timer
)
filterSelector
=
$
(
this
).
data
(
'filter-selector'
)
||
'span.filter-title'
@
timer
=
setTimeout
(
ProjectsList
.
filterResults
,
500
)
filterResults
:
=>
if
terms
==
""
||
terms
==
undefined
form
=
$
(
"#project-list-form"
)
uiBox
.
find
(
"ul.projects-list li"
).
show
()
search
=
$
(
"#issue_search"
).
val
()
else
uiBox
=
$
(
'div.projects-list-holder'
)
uiBox
.
find
(
"ul.projects-list li"
).
each
(
index
)
->
name
=
$
(
this
).
find
(
filterSelector
).
text
()
$
(
'.projects-list-holder'
).
css
(
"opacity"
,
'0.5'
)
if
name
.
toLowerCase
().
search
(
terms
.
toLowerCase
())
==
-
1
$
(
this
).
hide
()
project_filter_url
=
form
.
attr
(
'action'
)
+
'?'
+
form
.
serialize
()
else
$
.
ajax
$
(
this
).
show
()
type
:
"GET"
uiBox
.
find
(
"ul.projects-list li.bottom"
).
hide
()
url
:
form
.
attr
(
'action'
)
data
:
form
.
serialize
()
complete
:
->
$
(
'.projects-list-holder'
).
css
(
"opacity"
,
'1.0'
)
success
:
(
data
)
->
$
(
'.projects-list-holder'
).
html
(
data
.
html
)
# Change url so if user reload a page - search results are saved
history
.
replaceState
{
page
:
project_filter_url
},
document
.
title
,
project_filter_url
dataType
:
"json"
uiBox
.
find
(
"ul.projects-list li.bottom"
).
hide
()
app/assets/javascripts/user.js.coffee
View file @
2ad09413
class
@
User
class
@
User
constructor
:
->
constructor
:
->
$
(
'.profile-groups-avatars'
).
tooltip
(
"placement"
:
"top"
)
$
(
'.profile-groups-avatars'
).
tooltip
(
"placement"
:
"top"
)
ProjectsList
.
ini
t
()
new
ProjectsLis
t
()
$
(
'.hide-project-limit-message'
).
on
'click'
,
(
e
)
->
$
(
'.hide-project-limit-message'
).
on
'click'
,
(
e
)
->
path
=
'/'
path
=
'/'
...
...
app/controllers/application_controller.rb
View file @
2ad09413
...
@@ -277,9 +277,9 @@ class ApplicationController < ActionController::Base
...
@@ -277,9 +277,9 @@ class ApplicationController < ActionController::Base
}
}
end
end
def
view_to_html_string
(
partial
,
locals
=
nil
)
def
view_to_html_string
(
partial
,
locals
=
{}
)
render_to_string
(
render_to_string
(
partial
:
partial
,
partial
,
locals:
locals
,
locals:
locals
,
layout:
false
,
layout:
false
,
formats:
[
:html
]
formats:
[
:html
]
...
...
app/controllers/dashboard/projects_controller.rb
View file @
2ad09413
...
@@ -24,7 +24,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -24,7 +24,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
end
format
.
json
do
format
.
json
do
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
})
}
}
end
end
end
end
...
@@ -34,6 +34,13 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -34,6 +34,13 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects
=
current_user
.
starred_projects
@projects
=
current_user
.
starred_projects
@projects
=
@projects
.
includes
(
:namespace
,
:forked_from_project
,
:tags
)
@projects
=
@projects
.
includes
(
:namespace
,
:forked_from_project
,
:tags
)
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
terms
=
params
[
'filter_projects'
]
if
terms
.
present?
@projects
=
@projects
.
search
(
terms
)
end
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@last_push
=
current_user
.
recent_push
@last_push
=
current_user
.
recent_push
@groups
=
[]
@groups
=
[]
...
@@ -42,8 +49,9 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -42,8 +49,9 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
format
.
html
format
.
html
format
.
json
do
format
.
json
do
load_events
render
json:
{
pager_json
(
"events/_events"
,
@events
.
count
)
html:
view_to_html_string
(
"dashboard/projects/projects"
,
locals:
{
projects:
@projects
})
}
end
end
end
end
end
end
...
...
app/controllers/explore/projects_controller.rb
View file @
2ad09413
...
@@ -11,14 +11,14 @@ class Explore::ProjectsController < Explore::ApplicationController
...
@@ -11,14 +11,14 @@ class Explore::ProjectsController < Explore::ApplicationController
end
end
def
trending
def
trending
@projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@
trending_
projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@
projects
=
@
projects
.
non_archived
@
trending_projects
=
@trending_
projects
.
non_archived
@
projects
=
@
projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@
trending_projects
=
@trending_
projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
starred
def
starred
@projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@
starred_
projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@
projects
=
@
projects
.
reorder
(
'star_count DESC'
)
@
starred_projects
=
@starred_
projects
.
reorder
(
'star_count DESC'
)
@
projects
=
@
projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@
starred_projects
=
@starred_
projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
end
end
app/controllers/groups_controller.rb
View file @
2ad09413
...
@@ -41,6 +41,7 @@ class GroupsController < Groups::ApplicationController
...
@@ -41,6 +41,7 @@ class GroupsController < Groups::ApplicationController
def
show
def
show
@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
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
...
app/controllers/users_controller.rb
View file @
2ad09413
...
@@ -4,8 +4,9 @@ class UsersController < ApplicationController
...
@@ -4,8 +4,9 @@ class UsersController < ApplicationController
def
show
def
show
@contributed_projects
=
contributed_projects
.
joined
(
@user
).
reject
(
&
:forked?
)
@contributed_projects
=
contributed_projects
.
joined
(
@user
).
reject
(
&
:forked?
)
@projects
=
PersonalProjectsFinder
.
new
(
@user
).
execute
(
current_user
)
@projects
=
PersonalProjectsFinder
.
new
(
@user
).
execute
(
current_user
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@groups
=
@user
.
groups
.
order_id_desc
@groups
=
@user
.
groups
.
order_id_desc
...
...
app/models/event.rb
View file @
2ad09413
...
@@ -49,7 +49,7 @@ class Event < ActiveRecord::Base
...
@@ -49,7 +49,7 @@ class Event < ActiveRecord::Base
scope
:code_push
,
->
{
where
(
action:
PUSHED
)
}
scope
:code_push
,
->
{
where
(
action:
PUSHED
)
}
scope
:in_projects
,
->
(
projects
)
do
scope
:in_projects
,
->
(
projects
)
do
where
(
project_id:
projects
.
select
(
:id
).
reorder
(
nil
)).
recent
where
(
project_id:
projects
.
map
(
&
:id
)).
recent
end
end
scope
:with_associations
,
->
{
includes
(
project: :namespace
)
}
scope
:with_associations
,
->
{
includes
(
project: :namespace
)
}
...
...
app/views/dashboard/_projects_head.html.haml
View file @
2ad09413
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
Explore Projects
Explore Projects
.nav-controls
.nav-controls
=
form_tag
''
,
method: :get
,
class:
'project-list-form'
,
id:
'project-list
-form'
do
|
f
|
=
form_tag
request
.
original_url
,
method: :get
,
class:
'project-filter-form'
,
id:
'project-filter
-form'
do
|
f
|
.append-right-10.hidden-xs.hidden-sm
.append-right-10.hidden-xs.hidden-sm
=
search_field_tag
:filter_projects
,
params
[
:filter_projects
],
placeholder:
'Filter by name...'
,
class:
'project
s-list-filter form-control search-text-input'
,
spellcheck:
false
,
id:
'projects-list-filter
'
=
search_field_tag
:filter_projects
,
params
[
:filter_projects
],
placeholder:
'Filter by name...'
,
class:
'project
-filter-form-field form-control search-text-input'
,
spellcheck:
false
,
id:
'project-filter-form-field
'
-
if
current_user
.
can_create_project?
-
if
current_user
.
can_create_project?
=
link_to
new_project_path
,
class:
'btn btn-new'
do
=
link_to
new_project_path
,
class:
'btn btn-new'
do
=
icon
(
'plus'
)
=
icon
(
'plus'
)
...
...
app/views/dashboard/projects/_projects.html.haml
View file @
2ad09413
.projects-list-holder
.projects-list-holder
=
render
'shared/projects/list'
,
ci:
true
=
render
'shared/projects/list'
,
projects:
@projects
,
ci:
true
:javascript
:javascript
ProjectsList
.
init
()
Dashboard
.
init
()
app/views/explore/projects/_projects.html.haml
View file @
2ad09413
-
if
@
projects
.
any?
-
if
projects
.
any?
.public-projects
.public-projects
=
render
'shared/projects/list'
=
render
'shared/projects/list'
,
projects:
projects
-
else
-
else
.nothing-here-block
.nothing-here-block
No such projects
No such projects
app/views/explore/projects/starred.html.haml
View file @
2ad09413
...
@@ -7,5 +7,5 @@
...
@@ -7,5 +7,5 @@
=
render
'explore/head'
=
render
'explore/head'
=
render
'explore/projects/nav'
=
render
'explore/projects/nav'
=
render
'projects'
,
projects:
@projects
=
render
'projects'
,
projects:
@
starred_
projects
=
paginate
@projects
,
theme:
'gitlab'
=
paginate
@projects
,
theme:
'gitlab'
if
@projects
app/views/explore/projects/trending.html.haml
View file @
2ad09413
...
@@ -7,4 +7,4 @@
...
@@ -7,4 +7,4 @@
=
render
'explore/head'
=
render
'explore/head'
=
render
'explore/projects/nav'
=
render
'explore/projects/nav'
=
render
'projects'
,
projects:
@projects
=
render
'projects'
,
projects:
@
trending_
projects
app/views/projects/show.atom.builder
View file @
2ad09413
...
@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
...
@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: namespace_project_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: namespace_project_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html"
xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html"
xml.id namespace_project_url(@project.namespace, @project)
xml.id namespace_project_url(@project.namespace, @project)
xml.updated @events[0].updated_at.xmlschema if @events[0
?
xml.updated @events[0].updated_at.xmlschema if @events[0
]
@events.each do |event|
@events.each do |event|
event_to_atom(xml, event)
event_to_atom(xml, event)
...
...
app/views/shared/projects/_list.html.haml
View file @
2ad09413
...
@@ -8,20 +8,22 @@
...
@@ -8,20 +8,22 @@
-
show_last_commit_as_description
=
false
unless
local_assigns
[
:show_last_commit_as_description
]
==
true
-
show_last_commit_as_description
=
false
unless
local_assigns
[
:show_last_commit_as_description
]
==
true
%ul
.projects-list
%ul
.projects-list
-
if
@
projects
.
any?
-
if
projects
.
any?
-
@
projects
.
each_with_index
do
|
project
,
i
|
-
projects
.
each_with_index
do
|
project
,
i
|
-
css_class
=
(
i
>=
projects_limit
)
?
'hide'
:
nil
-
css_class
=
(
i
>=
projects_limit
)
?
'hide'
:
nil
=
render
"shared/projects/project"
,
project:
project
,
skip_namespace:
skip_namespace
,
=
render
"shared/projects/project"
,
project:
project
,
skip_namespace:
skip_namespace
,
avatar:
avatar
,
stars:
stars
,
css_class:
css_class
,
ci:
ci
,
use_creator_avatar:
use_creator_avatar
,
avatar:
avatar
,
stars:
stars
,
css_class:
css_class
,
ci:
ci
,
use_creator_avatar:
use_creator_avatar
,
forks:
forks
,
show_last_commit_as_description:
show_last_commit_as_description
forks:
forks
,
show_last_commit_as_description:
show_last_commit_as_description
-
if
@
projects
.
size
>
projects_limit
-
if
projects
.
size
>
projects_limit
%li
.bottom.center
%li
.bottom.center
.light
.light
#{
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"
=
paginate
projects
,
theme:
"gitlab"
if
!
projects
.
kind_of?
(
Array
)
-
else
-
else
%h3
No projects found
%h3
No projects found
%p
.slead
Try searching for a different project.
:javascript
new
ProjectsList
();
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