Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
1af84f8c
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,发现更多精彩内容 >>
提交
1af84f8c
编写于
2月 10, 2014
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/blob_last_commit' into 'master'
Feature: show last commit for Blob#show Fixes #970
上级
35fb7d54
9a3d6659
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
1 deletion
+28
-1
app/assets/stylesheets/sections/tree.scss
app/assets/stylesheets/sections/tree.scss
+18
-0
app/controllers/projects/refs_controller.rb
app/controllers/projects/refs_controller.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+4
-0
app/views/projects/blob/_blob.html.haml
app/views/projects/blob/_blob.html.haml
+4
-0
app/views/projects/blob/show.html.haml
app/views/projects/blob/show.html.haml
+1
-0
未找到文件。
app/assets/stylesheets/sections/tree.scss
浏览文件 @
1af84f8c
...
...
@@ -133,3 +133,21 @@
color
:
#777
;
}
}
.blob-commit-info
{
list-style
:
none
;
margin
:
0
;
padding
:
0
;
margin-bottom
:
10px
;
.commit
{
.commit-row-title
{
font-size
:
13px
;
.commit-row-message
{
font-weight
:
normal
;
color
:
#555
;
}
}
}
}
app/controllers/projects/refs_controller.rb
浏览文件 @
1af84f8c
...
...
@@ -34,7 +34,7 @@ class Projects::RefsController < Projects::ApplicationController
contents
=
tree
.
entries
@logs
=
contents
.
map
do
|
content
|
file
=
params
[
:path
]
?
File
.
join
(
params
[
:path
],
content
.
name
)
:
content
.
name
last_commit
=
@repo
.
commits
(
@commit
.
id
,
file
,
1
).
last
last_commit
=
@repo
.
last_commit_for_path
(
@commit
.
id
,
file
)
{
file_name:
content
.
name
,
commit:
last_commit
...
...
app/models/repository.rb
浏览文件 @
1af84f8c
...
...
@@ -204,4 +204,8 @@ class Repository
end
end
end
def
last_commit_for_path
(
sha
,
path
)
commits
(
sha
,
path
,
1
).
last
end
end
app/views/projects/blob/_blob.html.haml
浏览文件 @
1af84f8c
...
...
@@ -15,6 +15,10 @@
-
else
=
link_to
title
,
'#'
%ul
.blob-commit-info.bs-callout.bs-callout-info
-
blob_commit
=
@repository
.
last_commit_for_path
(
@commit
.
id
,
@blob
.
path
)
=
render
blob_commit
,
project:
@project
%div
#tree-content-holder
.tree-content-holder
.file-holder
.file-title
...
...
app/views/projects/blob/show.html.haml
浏览文件 @
1af84f8c
%div
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'blob'
,
path:
@path
%div
#tree-holder
.tree-holder
=
render
'blob'
,
blob:
@blob
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录