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
321dbb7b
Commit
321dbb7b
authored
Dec 20, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed project filter
parent
cff95191
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
64 deletions
+26
-64
app/assets/javascripts/projects.js
app/assets/javascripts/projects.js
+0
-24
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+0
-6
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-3
app/views/projects/index.html.haml
app/views/projects/index.html.haml
+23
-24
app/views/projects/index.js.haml
app/views/projects/index.js.haml
+2
-7
No files found.
app/assets/javascripts/projects.js
View file @
321dbb7b
...
...
@@ -7,19 +7,6 @@ var ProjectsList = {
this
.
limit
=
limit
;
this
.
offset
=
limit
;
this
.
initLoadMore
();
$
(
'
.project_search
'
).
keyup
(
function
()
{
var
terms
=
$
(
this
).
val
();
if
(
terms
.
length
>=
2
||
terms
.
length
==
0
)
{
url
=
$
(
'
.project_search
'
).
parent
().
attr
(
'
action
'
);
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
data
:
{
'
terms
'
:
terms
,
'
replace
'
:
true
},
dataType
:
"
script
"
});
}
});
},
getOld
:
...
...
@@ -33,17 +20,6 @@ var ProjectsList = {
dataType
:
"
script
"
});
},
replace
:
function
(
count
,
html
)
{
$
(
"
.tile
"
).
html
(
html
);
if
(
count
==
ProjectsList
.
limit
)
{
this
.
offset
=
count
;
this
.
initLoadMore
();
}
else
{
this
.
offset
=
0
;
}
},
append
:
function
(
count
,
html
)
{
$
(
"
.tile
"
).
append
(
html
);
...
...
app/assets/stylesheets/projects.css.scss
View file @
321dbb7b
...
...
@@ -647,9 +647,3 @@ h4.middle-panel {
border-radius
:
3px
;
float
:left
;
}
.project_search
{
margin
:
1
.5em
0
;
padding
:
8px
!
important
;
width
:
300px
;
}
app/controllers/projects_controller.rb
View file @
321dbb7b
...
...
@@ -12,9 +12,7 @@ class ProjectsController < ApplicationController
def
index
@limit
,
@offset
=
(
params
[
:limit
]
||
16
),
(
params
[
:offset
]
||
0
)
@projects
=
current_user
.
projects
@projects
=
@projects
.
where
(
"name LIKE ?"
,
"%
#{
params
[
:terms
]
}
%"
)
unless
params
[
:terms
].
blank?
@projects
=
@projects
.
limit
(
@limit
).
offset
(
@offset
)
@projects
=
current_user
.
projects
.
limit
(
@limit
).
offset
(
@offset
)
end
def
new
...
...
app/views/projects/index.html.haml
View file @
321dbb7b
-
content_for
(
:body_class
,
"projects-page"
)
-
content_for
(
:page_title
)
do
.container_4
.grid_4
-
if
current_user
.
can_create_project?
%a
.grey-button.right
{
:href
=>
new_project_path
}
Create new project
%h2
.icon
%span
Projects
%center
=
form_tag
projects_path
,
:method
=>
:get
,
:remote
=>
true
,
:id
=>
"projects_search_form"
do
=
search_field_tag
:project_search
,
nil
,
{
:placeholder
=>
'Filter projects by name'
,
:class
=>
'project_search text'
}
.container_4
.grid_4
-
if
current_user
.
can_create_project?
%a
.grey-button.right
{
:href
=>
new_project_path
}
Create new project
%h2
.icon
%span
Projects
%div
.clear
-
unless
@projects
.
empty?
%div
{
:class
=>
"tile"
}
=
render
"tile"
%div
.clear
-
unless
@projects
.
empty?
%div
{
:class
=>
"tile"
}
=
render
"tile"
-# If projects requris paging
-# We add ajax loader & init script
-
if
@projects
.
count
==
@limit
.clear
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
-
if
@projects
.
count
==
@limit
:javascript
$
(
function
(){
ProjectsList
.
init
(
16
);
});
-
else
%center
.prepend-top
%h2
%cite
Nothing here
:javascript
$
(
function
(){
ProjectsList
.
init
(
16
);
});
-
else
%center
.prepend-top
%h2
%cite
Nothing here
app/views/projects/index.js.haml
View file @
321dbb7b
-
if
params
[
:replace
]
:plain
ProjectsList.replace(
#{
@projects
.
count
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'projects/tile'
))
}
");
-
else
:plain
ProjectsList.append(
#{
@projects
.
count
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'projects/tile'
))
}
");
:plain
ProjectsList.append(
#{
@projects
.
count
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'projects/tile'
))
}
");
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