Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
325569ac
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,发现更多精彩内容 >>
提交
325569ac
编写于
10月 08, 2012
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'alexleutgoeb-feature/dashboardfeed'
上级
fd232084
bcdb1687
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
5 deletion
+39
-5
app/decorators/event_decorator.rb
app/decorators/event_decorator.rb
+21
-4
app/views/dashboard/index.atom.builder
app/views/dashboard/index.atom.builder
+2
-1
app/views/events/_event_issue.atom.haml
app/views/events/_event_issue.atom.haml
+2
-0
app/views/events/_event_push.atom.haml
app/views/events/_event_push.atom.haml
+14
-0
未找到文件。
app/decorators/event_decorator.rb
浏览文件 @
325569ac
...
...
@@ -3,11 +3,11 @@ class EventDecorator < ApplicationDecorator
def
feed_title
if
self
.
issue?
"
#{
self
.
author_name
}
#{
self
.
action_name
}
issue #
#{
self
.
target_id
}
:
"
+
self
.
issue_title
"
#{
self
.
author_name
}
#{
self
.
action_name
}
issue #
#{
self
.
target_id
}
:
#{
self
.
issue_title
}
at
#{
self
.
project
.
name
}
"
elsif
self
.
merge_request?
"
#{
self
.
author_name
}
#{
self
.
action_name
}
MR #
#{
self
.
target_id
}
:
"
+
self
.
merge_request_title
"
#{
self
.
author_name
}
#{
self
.
action_name
}
MR #
#{
self
.
target_id
}
:
#{
self
.
merge_request_title
}
at
#{
self
.
project
.
name
}
"
elsif
self
.
push?
"
#{
self
.
author_name
}
#{
self
.
push_action_name
}
#{
self
.
ref_type
}
"
+
self
.
ref_name
"
#{
self
.
author_name
}
#{
self
.
push_action_name
}
#{
self
.
ref_type
}
#{
self
.
ref_name
}
at
#{
self
.
project
.
name
}
"
elsif
self
.
membership_changed?
"
#{
self
.
author_name
}
#{
self
.
action_name
}
#{
self
.
project
.
name
}
"
else
...
...
@@ -20,8 +20,25 @@ class EventDecorator < ApplicationDecorator
h
.
project_issue_url
(
self
.
project
,
self
.
issue
)
elsif
self
.
merge_request?
h
.
project_merge_request_url
(
self
.
project
,
self
.
merge_request
)
elsif
self
.
push?
if
self
.
push_with_commits?
if
self
.
commits_count
>
1
h
.
project_compare_url
(
self
.
project
,
:from
=>
self
.
parent_commit
.
id
,
:to
=>
self
.
last_commit
.
id
)
else
h
.
project_commit_url
(
self
.
project
,
:id
=>
self
.
last_commit
.
id
)
end
else
h
.
project_commits_url
(
self
.
project
,
self
.
ref_name
)
end
end
end
def
feed_summary
if
self
.
issue?
h
.
render
"events/event_issue"
,
issue:
self
.
issue
elsif
self
.
push?
h
.
project_commits_url
(
self
.
project
,
self
.
ref_name
)
h
.
render
"events/event_push"
,
event:
self
end
end
end
app/views/dashboard/index.atom.builder
浏览文件 @
325569ac
...
...
@@ -12,6 +12,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.entry do
event_link = event.feed_url
event_title = event.feed_title
event_summary = event.feed_summary
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.link :href => event_link
...
...
@@ -22,7 +23,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.name event.author_name
xml.email event.author_email
end
xml.summary
event_title
xml.summary
(:type => "xhtml") { |x| x << event_summary unless event_summary.nil? }
end
end
end
...
...
app/views/events/_event_issue.atom.haml
0 → 100644
浏览文件 @
325569ac
%div
{
:xmlns
=>
"http://www.w3.org/1999/xhtml"
}
%p
=
simple_format
issue
.
description
app/views/events/_event_push.atom.haml
0 → 100644
浏览文件 @
325569ac
%div
{
:xmlns
=>
"http://www.w3.org/1999/xhtml"
}
-
event
.
commits
.
first
(
15
).
each
do
|
commit
|
%p
%strong
=
commit
.
author_name
=
link_to
"(#
#{
commit
.
short_id
}
)"
,
project_commit_path
(
event
.
project
,
:id
=>
commit
.
id
)
%i
at
=
commit
.
committed_date
.
strftime
(
"%Y-%m-%d %H:%M:%S"
)
%blockquote
=
simple_format
(
escape_once
(
commit
.
safe_message
))
-
if
event
.
commits_count
>
15
%p
%i
\... and
=
pluralize
(
event
.
commits_count
-
15
,
"more commit"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录