Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
188e6a7a
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 搜索 >>
提交
188e6a7a
编写于
3月 30, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3369 from hiroponz/display-note-count
Display note count on network graph.
上级
c918000b
b49c1cb1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
16 deletion
+19
-16
app/assets/javascripts/branch-graph.js.coffee
app/assets/javascripts/branch-graph.js.coffee
+9
-13
app/helpers/graph_helper.rb
app/helpers/graph_helper.rb
+9
-2
app/views/graph/show.json.erb
app/views/graph/show.json.erb
+1
-1
未找到文件。
app/assets/javascripts/branch-graph.js.coffee
浏览文件 @
188e6a7a
...
...
@@ -131,7 +131,7 @@ class BranchGraph
shortrefs
=
refs
# Truncate if longer than 15 chars
shortrefs
=
shortrefs
.
substr
(
0
,
15
)
+
"…"
if
shortrefs
.
length
>
17
text
=
r
.
text
(
x
+
8
,
y
,
shortrefs
).
attr
(
text
=
r
.
text
(
x
+
4
,
y
,
shortrefs
).
attr
(
"text-anchor"
:
"start"
font
:
"10px Monaco, monospace"
fill
:
"#FFF"
...
...
@@ -139,7 +139,7 @@ class BranchGraph
)
textbox
=
text
.
getBBox
()
# Create rectangle based on the size of the textbox
rect
=
r
.
rect
(
x
,
y
-
7
,
textbox
.
width
+
1
5
,
textbox
.
height
+
5
,
4
).
attr
(
rect
=
r
.
rect
(
x
,
y
-
7
,
textbox
.
width
+
5
,
textbox
.
height
+
5
,
4
).
attr
(
fill
:
"#000"
"fill-opacity"
:
.
5
stroke
:
"none"
...
...
@@ -206,22 +206,19 @@ class BranchGraph
# Build line shape
if
parent
[
1
]
is
commit
.
space
d1
=
[
0
,
5
]
d2
=
[
0
,
10
]
arrow
=
"l-2,5,4,0,-2,-5"
offset
=
[
0
,
5
]
arrow
=
"l-2,5,4,0,-2,-5,0,5"
else
if
parent
[
1
]
<
commit
.
space
d1
=
[
3
,
3
]
d2
=
[
7
,
5
]
arrow
=
"l5,0,-2,4,-3,-4"
offset
=
[
3
,
3
]
arrow
=
"l5,0,-2,4,-3,-4,4,2"
else
d1
=
[
-
3
,
3
]
d2
=
[
-
7
,
5
]
arrow
=
"l-5,0,2,4,3,-4"
offset
=
[
-
3
,
3
]
arrow
=
"l-5,0,2,4,3,-4,-4,2"
# Start point
route
=
[
"M"
,
x
+
d1
[
0
],
y
+
d1
[
1
]]
route
=
[
"M"
,
x
+
offset
[
0
],
y
+
offset
[
1
]]
# Add arrow if not first parent
if
i
>
0
...
...
@@ -230,7 +227,6 @@ class BranchGraph
# Circumvent if overlap
if
commit
.
space
isnt
parentCommit
.
space
or
commit
.
space
isnt
parent
[
1
]
route
.
push
(
"L"
,
x
+
d2
[
0
],
y
+
d2
[
1
],
"L"
,
parentX2
,
y
+
10
,
"L"
,
parentX2
,
parentY
-
5
,
)
...
...
app/helpers/graph_helper.rb
浏览文件 @
188e6a7a
module
GraphHelper
def
join_with_space
(
ary
)
ary
.
collect
{
|
r
|
r
.
name
}.
join
(
" "
)
unless
ary
.
nil?
def
get_refs
(
commit
)
refs
=
""
refs
+=
commit
.
refs
.
collect
{
|
r
|
r
.
name
}.
join
(
" "
)
if
commit
.
refs
# append note count
notes
=
@project
.
notes
.
for_commit_id
(
commit
.
id
)
refs
+=
"[
#{
notes
.
count
}
]"
if
notes
.
any?
refs
end
def
parents_zip_spaces
(
parents
,
parent_spaces
)
...
...
app/views/graph/show.json.erb
浏览文件 @
188e6a7a
...
...
@@ -13,7 +13,7 @@
},
time:
c
.
time
,
space:
c
.
spaces
.
first
,
refs:
join_with_space
(
c
.
refs
),
refs:
get_refs
(
c
),
id:
c
.
sha
,
date:
c
.
date
,
message:
c
.
message
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录