Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
63a67bb4
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,发现更多精彩内容 >>
提交
63a67bb4
编写于
6月 19, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove second search. More compact list. Additional filter
上级
6e35acef
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
63 deletion
+38
-63
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+8
-6
app/views/dashboard/projects.html.haml
app/views/dashboard/projects.html.haml
+30
-57
未找到文件。
app/controllers/dashboard_controller.rb
浏览文件 @
63a67bb4
class
DashboardController
<
ApplicationController
respond_to
:html
before_filter
:load_projects
before_filter
:load_projects
,
except:
[
:projects
]
before_filter
:event_filter
,
only: :show
def
show
...
...
@@ -26,16 +26,18 @@ class DashboardController < ApplicationController
def
projects
@projects
=
case
params
[
:scope
]
when
'personal'
then
@projects
.
personal
(
current_user
)
current_user
.
namespace
.
projects
when
'joined'
then
@projects
.
joined
(
current_user
)
current_user
.
authorized_projects
.
joined
(
current_user
)
when
'owned'
then
current_user
.
owned_projects
else
@
projects
end
current_user
.
authorized_
projects
end
.
sorted_by_activity
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@labels
=
Project
.
where
(
id:
@projects
.
map
(
&
:id
))
.
tags_on
(
:labels
)
@labels
=
current_user
.
authorized_projects
.
tags_on
(
:labels
)
@projects
=
@projects
.
tagged_with
(
params
[
:label
])
if
params
[
:label
].
present?
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
...
...
app/views/dashboard/projects.html.haml
浏览文件 @
63a67bb4
%h3
.page_title
Projects
%span
(
#{
@projects
.
total_count
}
)
-
if
current_user
.
can_create_project?
%span
.pull-right
=
link_to
new_project_path
,
class:
"btn btn-tiny info"
do
%i
.icon-plus
New Project
%hr
.row
.span3
%ul
.nav.nav-pills.nav-stacked
...
...
@@ -19,58 +7,43 @@
=
link_to
"Personal"
,
projects_dashboard_path
(
scope:
'personal'
)
=
nav_tab
:scope
,
'joined'
do
=
link_to
"Joined"
,
projects_dashboard_path
(
scope:
'joined'
)
=
nav_tab
:scope
,
'owned'
do
=
link_to
"Owned"
,
projects_dashboard_path
(
scope:
'owned'
)
%p
.light
Filter by label:
%ul
.bordered-list
-
@labels
.
each
do
|
label
|
%li
{
class:
(
label
.
name
==
params
[
:label
])
?
'active'
:
'light'
}
=
link_to
projects_dashboard_path
(
scope:
params
[
:scope
],
label:
label
.
name
)
do
%i
.icon-tag
=
label
.
name
-
if
@labels
.
present?
%p
.light
Filter by label:
%ul
.bordered-list
-
@labels
.
each
do
|
label
|
%li
{
class:
(
label
.
name
==
params
[
:label
])
?
'active'
:
'light'
}
=
link_to
projects_dashboard_path
(
scope:
params
[
:scope
],
label:
label
.
name
)
do
%i
.icon-tag
=
label
.
name
.span9
=
form_tag
projects_dashboard_path
,
method:
'get'
do
%fieldset
.dashboard-search-filter
=
hidden_field_tag
"scope"
,
params
[
:scope
]
=
search_field_tag
"search"
,
params
[
:search
],
{
id:
'dashboard_projects_search'
,
placeholder:
'Search'
,
class:
'left input-xxlarge'
}
=
button_tag
type:
'submit'
,
class:
'btn'
do
%i
.icon-search
%ul
.bordered-list
-
@projects
.
each
do
|
project
|
%li
.clearfix
.clearfix
%h5
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
-
if
project
.
namespace
=
project
.
namespace
.
human_name
%span
=
"/"
%strong
=
truncate
(
project
.
name
,
length:
45
)
.pull-right.light
-
if
project
.
owner
==
current_user
%i
.icon-wrench
-
tm
=
project
.
team
.
get_tm
(
current_user
.
id
)
-
if
tm
%strong
=
tm
.
project_access_human
.clearfix
.left
-
if
project
.
description
.
present?
%span
.light
=
project
.
description
-
project
.
labels
.
each
do
|
label
|
%span
.label.label-info
%i
.icon-tag
=
label
.
name
.ui-box
%h5
.title
Projects (
#{
@projects
.
total_count
}
)
%ul
.well-list
-
@projects
.
each
do
|
project
|
%li
-
if
project
.
public
=
public_icon
-
else
=
private_icon
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
%strong
=
project
.
name_with_namespace
-
if
project
.
description
.
present?
%span
.light
=
truncate
project
.
description
,
length:
80
.pull-right.light
%small
.light
Last activity
#{
project_last_activity
(
project
)
}
%small
Last activity
#{
project_last_activity
(
project
)
}
-
if
@projects
.
blank?
%li
%h3
.nothing_here_message
There are no projects here.
-
if
@projects
.
blank?
%li
%h3
.nothing_here_message
There are no projects here.
.bottom
%hr
=
paginate
@projects
,
theme:
"gitlab"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录