Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
5263dd42
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,体验更适合开发者的 AI 搜索 >>
提交
5263dd42
编写于
3月 01, 2012
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Events displayed on project page. \n Fixed theme issue. \n New issue, mr events enabled
上级
00028702
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
153 addition
and
57 deletion
+153
-57
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+51
-14
app/assets/stylesheets/ui_basic.scss
app/assets/stylesheets/ui_basic.scss
+0
-1
app/assets/stylesheets/ui_mars.scss
app/assets/stylesheets/ui_mars.scss
+1
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-2
app/models/event.rb
app/models/event.rb
+30
-2
app/views/dashboard/_projects_feed.html.haml
app/views/dashboard/_projects_feed.html.haml
+1
-0
app/views/dashboard/index.html.haml
app/views/dashboard/index.html.haml
+2
-0
app/views/events/_event.html.haml
app/views/events/_event.html.haml
+7
-31
app/views/events/_event_new_issue.html.haml
app/views/events/_event_new_issue.html.haml
+10
-0
app/views/events/_event_new_merge_request.html.haml
app/views/events/_event_new_merge_request.html.haml
+15
-0
app/views/events/_event_push.html.haml
app/views/events/_event_push.html.haml
+30
-0
app/views/layouts/admin.html.haml
app/views/layouts/admin.html.haml
+1
-1
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+3
-4
未找到文件。
app/assets/stylesheets/common.scss
浏览文件 @
5263dd42
...
...
@@ -610,6 +610,35 @@ p.time {
.dashboard_category
{
margin-bottom
:
30px
;
.ico
{
background
:
url("images.png")
no-repeat
-85px
-77px
;
width
:
19px
;
height
:
16px
;
float
:
left
;
position
:
relative
;
margin-right
:
10px
;
top
:
8px
;
&
.project
{
background-position
:
-37px
-77px
;
}
&
.activities
{
background-position
:
-162px
-22px
;
}
&
.projects
{
background-position
:
-209px
-21px
;
}
}
h3
a
{
color
:
#474D57
;
&
:hover
{
text-decoration
:underline
;
}
}
.dashboard_block
{
width
:
700px
;
margin
:auto
;
...
...
@@ -625,20 +654,6 @@ p.time {
h4
{
color
:
#666
;
}
&
.event_feed
{
min-height
:
40px
;
border-bottom
:
1px
solid
#eee
;
.avatar
{
width
:
32px
;
}
ul
{
margin-left
:
50px
;
margin-bottom
:
5px
;
.avatar
{
width
:
24px
;
}
}
}
}
}
}
...
...
@@ -651,3 +666,25 @@ p.time {
-webkit-box-shadow
:
0
0
5px
#888
;
box-shadow
:
0
0
5px
#888
;
}
.event_feed
{
min-height
:
40px
;
border-bottom
:
1px
solid
#eee
;
.avatar
{
width
:
32px
;
}
ul
{
margin-left
:
50px
;
margin-bottom
:
5px
;
.avatar
{
width
:
24px
;
}
}
padding
:
10px
5px
;
border-bottom
:
1px
solid
#eee
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.05
);
&
:last-child
{
border
:none
}
.wll
:hover
{
background
:none
}
}
app/assets/stylesheets/ui_basic.scss
浏览文件 @
5263dd42
...
...
@@ -70,7 +70,6 @@
width
:
16px
;
height
:
16px
;
padding
:
5px
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
margin
:
0px
;
background
:
#eee
;
...
...
app/assets/stylesheets/ui_mars.scss
浏览文件 @
5263dd42
...
...
@@ -97,14 +97,13 @@
width
:
16px
;
height
:
16px
;
padding
:
5px
;
border
:
1px
solid
#888
;
border-radius
:
4px
;
margin
:
0px
;
background
:
#474D57
;
margin-left
:
20px
;
margin-top
:
4px
;
&
:hover
{
background
:
#
f7f7f7
;
background
:
#
555
;
}
img
{
width
:
16px
;
...
...
app/controllers/projects_controller.rb
浏览文件 @
5263dd42
...
...
@@ -68,8 +68,8 @@ class ProjectsController < ApplicationController
def
show
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
limit
=
(
params
[
:limit
]
||
1
0
).
to_i
@
activities
=
@project
.
activities
(
limit
)
limit
=
(
params
[
:limit
]
||
2
0
).
to_i
@
events
=
@project
.
events
.
recent
.
limit
(
limit
)
end
def
files
...
...
app/models/event.rb
浏览文件 @
5263dd42
...
...
@@ -21,9 +21,12 @@ class Event < ActiveRecord::Base
end
end
# For now only push events enabled for system
# Next events currently enabled for system
# - push
# - new issue
# - merge request
def
allowed?
push?
push?
||
new_issue?
||
new_merge_request?
end
def
push?
...
...
@@ -49,6 +52,28 @@ class Event < ActiveRecord::Base
def
pusher
User
.
find_by_id
(
data
[
:user_id
])
end
def
new_issue?
target_type
==
"Issue"
&&
action
==
Created
end
def
new_merge_request?
target_type
==
"MergeRequest"
&&
action
==
Created
end
def
issue
target
if
target_type
==
"Issue"
end
def
merge_request
target
if
target_type
==
"MergeRequest"
end
def
author
target
.
author
end
def
commits
@commits
||=
data
[
:commits
].
map
do
|
commit
|
...
...
@@ -57,6 +82,9 @@ class Event < ActiveRecord::Base
end
delegate
:id
,
:name
,
:email
,
:to
=>
:pusher
,
:prefix
=>
true
,
:allow_nil
=>
true
delegate
:name
,
:email
,
:to
=>
:author
,
:prefix
=>
true
,
:allow_nil
=>
true
delegate
:title
,
:to
=>
:issue
,
:prefix
=>
true
,
:allow_nil
=>
true
delegate
:title
,
:to
=>
:merge_request
,
:prefix
=>
true
,
:allow_nil
=>
true
end
# == Schema Information
#
...
...
app/views/dashboard/_projects_feed.html.haml
浏览文件 @
5263dd42
...
...
@@ -2,6 +2,7 @@
.wll
=
link_to
project
do
%h4
%span
.ico.project
=
project
.
name
%small
last activity at
...
...
app/views/dashboard/index.html.haml
浏览文件 @
5263dd42
...
...
@@ -8,6 +8,7 @@
%div
.dashboard_category
%h3
%span
.ico.projects
=
link_to
"Projects"
,
"#projects"
,
:id
=>
"projects"
%small
( most recent )
...
...
@@ -59,6 +60,7 @@
-
unless
@events
.
blank?
%div
.dashboard_category
%h3
%span
.ico.activities
=
link_to
"Activities"
,
"#activities"
,
:id
=>
"activities"
%hr
...
...
app/views/events/_event.html.haml
浏览文件 @
5263dd42
-
if
event
.
allowed?
.wll.event_feed
-
if
event
.
push?
-
if
event
.
new_branch?
=
image_tag
gravatar_icon
(
event
.
pusher_email
),
:class
=>
"avatar"
%strong
#{
event
.
pusher_name
}
pushed new branch
=
link_to
project_commits_path
(
event
.
project
,
:ref
=>
event
.
branch_name
)
do
%strong
=
event
.
branch_name
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
-
else
=
image_tag
gravatar_icon
(
event
.
pusher_email
),
:class
=>
"avatar"
%strong
#{
event
.
pusher_name
}
pushed to
=
link_to
project_commits_path
(
event
.
project
,
:ref
=>
event
.
branch_name
)
do
%strong
=
event
.
branch_name
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
-
if
event
.
commits
.
count
>
1
=
link_to
compare_project_commits_path
(
event
.
project
,
:from
=>
event
.
commits
.
first
.
prev_commit_id
,
:to
=>
event
.
commits
.
last
.
id
)
do
Compare
#{
event
.
commits
.
first
.
commit
.
id
[
0
..
8
]
}
...
#{
event
.
commits
.
last
.
id
[
0
..
8
]
}
-
@project
=
event
.
project
%ul
.unstyled
=
render
event
.
commits
.event_feed
-
if
event
.
new_issue?
=
render
"events/event_new_issue"
,
:event
=>
event
-
if
event
.
new_merge_request?
=
render
"events/event_new_merge_request"
,
:event
=>
event
-
elsif
event
.
push?
=
render
"events/event_push"
,
:event
=>
event
app/views/events/_event_new_issue.html.haml
0 → 100644
浏览文件 @
5263dd42
=
image_tag
gravatar_icon
(
event
.
author_email
),
:class
=>
"avatar"
%strong
#{
event
.
author_name
}
created new issue
=
link_to
project_issue_path
(
event
.
project
,
event
.
issue
)
do
%strong
=
truncate
event
.
issue_title
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
app/views/events/_event_new_merge_request.html.haml
0 → 100644
浏览文件 @
5263dd42
=
image_tag
gravatar_icon
(
event
.
author_email
),
:class
=>
"avatar"
%strong
#{
event
.
author_name
}
requested merge
=
link_to
project_merge_request_path
(
event
.
project
,
event
.
merge_request
)
do
%strong
=
truncate
event
.
merge_request_title
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
%br
%span
.label
=
event
.
merge_request
.
source_branch
→
%span
.label
=
event
.
merge_request
.
target_branch
app/views/events/_event_push.html.haml
0 → 100644
浏览文件 @
5263dd42
-
if
event
.
new_branch?
=
image_tag
gravatar_icon
(
event
.
pusher_email
),
:class
=>
"avatar"
%strong
#{
event
.
pusher_name
}
pushed new branch
=
link_to
project_commits_path
(
event
.
project
,
:ref
=>
event
.
branch_name
)
do
%strong
=
event
.
branch_name
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
-
else
=
image_tag
gravatar_icon
(
event
.
pusher_email
),
:class
=>
"avatar"
%strong
#{
event
.
pusher_name
}
pushed to
=
link_to
project_commits_path
(
event
.
project
,
:ref
=>
event
.
branch_name
)
do
%strong
=
event
.
branch_name
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
-
if
event
.
commits
.
count
>
1
=
link_to
compare_project_commits_path
(
event
.
project
,
:from
=>
event
.
commits
.
first
.
prev_commit_id
,
:to
=>
event
.
commits
.
last
.
id
)
do
Compare
#{
event
.
commits
.
first
.
commit
.
id
[
0
..
8
]
}
...
#{
event
.
commits
.
last
.
id
[
0
..
8
]
}
-
@project
=
event
.
project
%ul
.unstyled
=
render
event
.
commits
app/views/layouts/admin.html.haml
浏览文件 @
5263dd42
!!! 5
%html
{
:lang
=>
"en"
}
=
render
"layouts/head"
%body
.ui_basic.admin
%body
{
:class
=>
"#{app_theme} admin"
}
=
render
"layouts/flash"
=
render
"layouts/head_panel"
,
:title
=>
"Admin area"
.container
...
...
app/views/projects/show.html.haml
浏览文件 @
5263dd42
...
...
@@ -14,9 +14,8 @@
=
text_field_tag
:project_clone
,
@project
.
url_to_repo
,
:class
=>
"xlarge one_click_select git_clone_url"
=
simple_format
@project
.
description
-
unless
@activities
.
blank?
.ui-box
%h5
.cgray
Recent Activity
.content_list
=
render
"feed"
-
unless
@events
.
blank?
%h5
.cgray
Recent Activity
.content_list
=
render
@events
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录