Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
321dbb7b
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
321dbb7b
编写于
12月 20, 2011
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
removed project filter
上级
cff95191
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
26 addition
and
64 deletion
+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
未找到文件。
app/assets/javascripts/projects.js
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
321dbb7b
-
content_for
(
:body_class
,
"projects-page"
)
-
content_for
(
:page_title
)
do
.container_4
.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'
}
%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
);
...
...
app/views/projects/index.js.haml
浏览文件 @
321dbb7b
-
if
params
[
:replace
]
:plain
ProjectsList.replace(
#{
@projects
.
count
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'projects/tile'
))
}
");
-
else
:plain
:plain
ProjectsList.append(
#{
@projects
.
count
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'projects/tile'
))
}
");
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录