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
f0b7dcba
Commit
f0b7dcba
authored
Jan 11, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to filter by namespace. #2406
parent
55707f95
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
app/assets/javascripts/projects_list.js.coffee
app/assets/javascripts/projects_list.js.coffee
+3
-1
app/views/projects/forks/index.html.haml
app/views/projects/forks/index.html.haml
+17
-11
No files found.
app/assets/javascripts/projects_list.js.coffee
View file @
f0b7dcba
...
@@ -9,11 +9,13 @@ class @ProjectsList
...
@@ -9,11 +9,13 @@ class @ProjectsList
$
(
".projects-list-filter"
).
keyup
->
$
(
".projects-list-filter"
).
keyup
->
terms
=
$
(
this
).
val
()
terms
=
$
(
this
).
val
()
uiBox
=
$
(
'div.projects-list-holder'
)
uiBox
=
$
(
'div.projects-list-holder'
)
filterSelector
=
$
(
this
).
data
(
'filter-selector'
)
||
'span.filter-title'
if
terms
==
""
||
terms
==
undefined
if
terms
==
""
||
terms
==
undefined
uiBox
.
find
(
"ul.projects-list li"
).
show
()
uiBox
.
find
(
"ul.projects-list li"
).
show
()
else
else
uiBox
.
find
(
"ul.projects-list li"
).
each
(
index
)
->
uiBox
.
find
(
"ul.projects-list li"
).
each
(
index
)
->
name
=
$
(
this
).
find
(
"span.filter-title"
).
text
()
name
=
$
(
this
).
find
(
filterSelector
).
text
()
if
name
.
toLowerCase
().
search
(
terms
.
toLowerCase
())
==
-
1
if
name
.
toLowerCase
().
search
(
terms
.
toLowerCase
())
==
-
1
$
(
this
).
hide
()
$
(
this
).
hide
()
...
...
app/views/projects/forks/index.html.haml
View file @
f0b7dcba
.gray-content-block.top-block.white
.gray-content-block.top-block.clearfix.white
.pull-left
-
public_count
=
@public_forks
.
size
-
protected_count
=
@protected_forks
.
size
-
full_count_title
=
[
"
#{
public_count
}
public"
,
"
#{
protected_count
}
protected"
].
join
(
' and '
)
==
#{
pluralize
(
@all_forks
.
size
,
'fork'
)
}
:
#{
full_count_title
}
.pull-right
.projects-search-form
=
search_field_tag
:filter_projects
,
nil
,
placeholder:
'Search forks'
,
class:
'projects-list-filter form-control'
,
spellcheck:
false
,
data:
{
'filter-selector'
=>
'span.namespace-name'
}
-
if
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
-
if
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
=
link_to
namespace_project_path
(
current_user
,
current_user
.
fork_of
(
@project
)),
title:
'Go to your fork'
,
class:
'pull-right btn btn-new'
do
=
link_to
namespace_project_path
(
current_user
,
current_user
.
fork_of
(
@project
)),
title:
'Go to your fork'
,
class:
'pull-right btn btn-new'
do
=
icon
(
'code-fork fw'
)
=
icon
(
'code-fork fw'
)
...
@@ -8,11 +19,6 @@
...
@@ -8,11 +19,6 @@
=
icon
(
'code-fork fw'
)
=
icon
(
'code-fork fw'
)
Fork
Fork
.oneline
-
public_count
=
@public_forks
.
size
-
protected_count
=
@protected_forks
.
size
-
full_count_title
=
[
"
#{
public_count
}
public"
,
"
#{
protected_count
}
protected"
].
join
(
' and '
)
==
#{
pluralize
(
@all_forks
.
size
,
'fork'
)
}
:
#{
full_count_title
}
.projects-list-holder
.projects-list-holder
=
render
'shared/projects/list'
,
projects:
@public_forks
,
use_creator_avatar:
true
,
=
render
'shared/projects/list'
,
projects:
@public_forks
,
use_creator_avatar:
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