Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
42c46f37
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,发现更多精彩内容 >>
提交
42c46f37
编写于
12月 15, 2011
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Dashboard tabs restyle, messages if no issue or merge request
上级
ed3f3a0d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
65 addition
and
44 deletion
+65
-44
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+12
-3
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+3
-1
app/views/dashboard/_issues_feed.html.haml
app/views/dashboard/_issues_feed.html.haml
+24
-18
app/views/dashboard/_menu.html.haml
app/views/dashboard/_menu.html.haml
+3
-3
app/views/dashboard/_merge_requests_feed.html.haml
app/views/dashboard/_merge_requests_feed.html.haml
+23
-19
未找到文件。
app/assets/stylesheets/projects.css.scss
浏览文件 @
42c46f37
...
@@ -496,14 +496,23 @@ h4.dash-tabs {
...
@@ -496,14 +496,23 @@ h4.dash-tabs {
font-weight
:
bold
;
text-transform
:
uppercase
;
font-weight
:
bold
;
text-transform
:
uppercase
;
background
:
#F7F7F7
;
background
:
#F7F7F7
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
height
:
13px
;
}
}
.dash-button
{
.dash-button
{
margin-right
:
5px
;
border-right
:
1px
solid
#ddd
;
@include
round-borders-all
(
4px
);
border
:
1px
solid
#ddd
;
background
:none
;
background
:none
;
padding
:
10px
15px
;
float
:left
;
position
:relative
;
top
:
-10px
;
left
:
0px
;
height
:
13px
;
&
:first-child
{
border-left
:
1px
solid
#ddd
;
}
&
.active
{
&
.active
{
background
:
#eaeaea
;
background
:
#eaeaea
;
}
}
...
...
app/controllers/dashboard_controller.rb
浏览文件 @
42c46f37
...
@@ -11,9 +11,10 @@ class DashboardController < ApplicationController
...
@@ -11,9 +11,10 @@ class DashboardController < ApplicationController
end
end
end
end
# Get authored or assigned open merge requests
def
merge_requests
def
merge_requests
@projects
=
current_user
.
projects
.
all
@projects
=
current_user
.
projects
.
all
@merge_requests
=
current_user
.
assigned_merge_requests
.
order
(
"created_at DESC"
).
limit
(
40
)
@merge_requests
=
MergeRequest
.
where
(
"author_id = :id or assignee_id = :id"
,
:id
=>
current_user
.
id
).
opened
.
order
(
"created_at DESC"
).
limit
(
40
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
@@ -21,6 +22,7 @@ class DashboardController < ApplicationController
...
@@ -21,6 +22,7 @@ class DashboardController < ApplicationController
end
end
end
end
# Get only assigned issues
def
issues
def
issues
@projects
=
current_user
.
projects
.
all
@projects
=
current_user
.
projects
.
all
@user
=
current_user
@user
=
current_user
...
...
app/views/dashboard/_issues_feed.html.haml
浏览文件 @
42c46f37
#feeds_content_holder
#feeds_content_holder
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
unless
@issues
.
empty?
.data
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
@issues
.
each
do
|
update
|
.data
%a
.project-update
{
:href
=>
dashboard_feed_path
(
update
.
project
,
update
)}
-
@issues
.
each
do
|
update
|
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%a
.project-update
{
:href
=>
dashboard_feed_path
(
update
.
project
,
update
)}
%span
.update-title
%strong
.issue-number
=
"#
#{
update
.
id
}
"
=
truncate
update
.
title
,
:length
=>
50
%span
.update-title
.right
=
update
.
project
.
name
=
truncate
update
.
title
,
:length
=>
35
%span
.update-author
.right
=
truncate
update
.
project
.
name
%strong
=
update
.
author_name
%span
.update-author
authored
%strong
=
update
.
author_name
=
time_ago_in_words
(
update
.
created_at
)
authored
ago
=
time_ago_in_words
(
update
.
created_at
)
.right
ago
-
if
update
.
critical
.right
%span
.tag.high
critical
-
if
update
.
critical
-
if
update
.
today?
%span
.tag.high
critical
%span
.tag.today
today
-
if
update
.
today?
%span
.tag.today
today
-
else
%h2
No assigned
%span
.tag.open
open
issues
app/views/dashboard/_menu.html.haml
浏览文件 @
42c46f37
%h4
.dash-tabs
%h4
.dash-tabs
=
link_to
"Activities"
,
dashboard_path
,
:remote
=>
true
,
:class
=>
"
button-small
dash-button
#{
"active"
if
current_page?
(
dashboard_path
)
||
current_page?
(
root_path
)
}
"
,
:id
=>
"activities_slide"
=
link_to
"Activities"
,
dashboard_path
,
:remote
=>
true
,
:class
=>
"dash-button
#{
"active"
if
current_page?
(
dashboard_path
)
||
current_page?
(
root_path
)
}
"
,
:id
=>
"activities_slide"
=
link_to
"Issues"
,
dashboard_issues_path
,
:remote
=>
true
,
:class
=>
"
button-small
dash-button
#{
"active"
if
current_page?
(
dashboard_issues_path
)
}
"
,
:id
=>
"issues_slide"
=
link_to
"Issues"
,
dashboard_issues_path
,
:remote
=>
true
,
:class
=>
"dash-button
#{
"active"
if
current_page?
(
dashboard_issues_path
)
}
"
,
:id
=>
"issues_slide"
=
link_to
"Merge Requests"
,
dashboard_merge_requests_path
,
:remote
=>
true
,
:class
=>
"
button-small
dash-button
#{
"active"
if
current_page?
(
dashboard_merge_requests_path
)
}
"
,
:id
=>
"merge_requests_slide"
=
link_to
"Merge Requests"
,
dashboard_merge_requests_path
,
:remote
=>
true
,
:class
=>
"dash-button
#{
"active"
if
current_page?
(
dashboard_merge_requests_path
)
}
"
,
:id
=>
"merge_requests_slide"
=
image_tag
"ajax-loader-facebook.gif"
,
:class
=>
"dashboard-loader"
=
image_tag
"ajax-loader-facebook.gif"
,
:class
=>
"dashboard-loader"
:javascript
:javascript
...
...
app/views/dashboard/_merge_requests_feed.html.haml
浏览文件 @
42c46f37
#feeds_content_holder
#feeds_content_holder
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
unless
@merge_requests
.
empty?
.data
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
@merge_requests
.
each
do
|
update
|
.data
%a
.project-update
{
:href
=>
project_merge_request_path
(
update
.
project
,
update
)}
-
@merge_requests
.
each
do
|
update
|
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%a
.project-update
{
:href
=>
project_merge_request_path
(
update
.
project
,
update
)}
%span
.update-title
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
-
state
=
update
.
closed
?
'closed'
:
'open'
%span
.update-title
%span
.tag
{
:class
=>
state
}
#{
state
.
capitalize
}
=
truncate
update
.
title
,
:length
=>
35
=
truncate
update
.
title
,
:length
=>
70
.right
=
truncate
update
.
project
.
name
.right
=
update
.
project
.
name
%span
.update-author
%span
.update-author
%strong
=
update
.
author_name
%strong
=
update
.
author_name
authored
authored
=
time_ago_in_words
(
update
.
created_at
)
=
time_ago_in_words
(
update
.
created_at
)
ago
ago
.right
.right
%span
.tag.commit
=
update
.
source_branch
%span
.tag.commit
=
update
.
source_branch
→
→
%span
.tag.commit
=
update
.
target_branch
%span
.tag.commit
=
update
.
target_branch
-
else
%h2
No authored or assigned
%span
.tag.open
open
merge requests
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录