Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_70890014
gitlabhq
提交
35748269
G
gitlabhq
项目概览
m0_70890014
/
gitlabhq
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlabhq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
35748269
编写于
9月 20, 2012
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use Commits#show instead of Commits#index
Takes tree-ish + path as ID
上级
169f16fb
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
45 deletion
+19
-45
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+5
-31
app/views/commits/show.atom.builder
app/views/commits/show.atom.builder
+0
-0
app/views/commits/show.html.haml
app/views/commits/show.html.haml
+0
-0
app/views/commits/show.js.haml
app/views/commits/show.js.haml
+0
-0
app/views/layouts/_project_menu.html.haml
app/views/layouts/_project_menu.html.haml
+1
-1
config/routes.rb
config/routes.rb
+13
-13
未找到文件。
app/controllers/commits_controller.rb
浏览文件 @
35748269
...
...
@@ -4,18 +4,19 @@ class CommitsController < ApplicationController
before_filter
:project
layout
"project"
include
ExtractsPath
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_read_project!
before_filter
:authorize_code_access!
before_filter
:require_non_empty_project
before_filter
:load_refs
,
only: :index
# load @branch, @tag & @ref
def
index
@repo
=
project
.
repo
def
show
@repo
=
@
project
.
repo
@limit
,
@offset
=
(
params
[
:limit
]
||
40
),
(
params
[
:offset
]
||
0
)
@commits
=
@project
.
commits
(
@ref
,
params
[
:path
]
,
@limit
,
@offset
)
@commits
=
@project
.
commits
(
@ref
,
@path
,
@limit
,
@offset
)
@commits
=
CommitDecorator
.
decorate
(
@commits
)
respond_to
do
|
format
|
...
...
@@ -25,26 +26,6 @@ class CommitsController < ApplicationController
end
end
# def show
# result = CommitLoad.new(project, current_user, params).execute
# @commit = result[:commit]
# if @commit
# @suppress_diff = result[:suppress_diff]
# @note = result[:note]
# @line_notes = result[:line_notes]
# @notes_count = result[:notes_count]
# @comments_allowed = true
# else
# return git_not_found!
# end
# if result[:status] == :huge_commit
# render "huge_commit" and return
# end
# end
def
patch
@commit
=
project
.
commit
(
params
[
:id
])
...
...
@@ -55,11 +36,4 @@ class CommitsController < ApplicationController
filename:
"
#{
@commit
.
id
}
.patch"
)
end
protected
def
load_refs
@ref
||=
params
[
:ref
].
presence
||
params
[
:branch
].
presence
||
params
[
:tag
].
presence
@ref
||=
@ref
||
@project
.
try
(
:default_branch
)
||
'master'
end
end
app/views/commits/
index
.atom.builder
→
app/views/commits/
show
.atom.builder
浏览文件 @
35748269
文件已移动
app/views/commits/
index
.html.haml
→
app/views/commits/
show
.html.haml
浏览文件 @
35748269
文件已移动
app/views/commits/
index
.js.haml
→
app/views/commits/
show
.js.haml
浏览文件 @
35748269
文件已移动
app/views/layouts/_project_menu.html.haml
浏览文件 @
35748269
...
...
@@ -8,7 +8,7 @@
=
link_to
project_tree_path
(
@project
,
@project
.
root_ref
)
do
Files
%li
{
class:
commit_tab_class
}
=
link_to
"Commits"
,
project_
commits_path
(
@project
)
=
link_to
"Commits"
,
project_
history_path
(
@project
,
@project
.
root_ref
)
%li
{
class:
tab_class
(
:network
)}
=
link_to
"Network"
,
graph_project_path
(
@project
)
...
...
config/routes.rb
浏览文件 @
35748269
...
...
@@ -159,13 +159,20 @@ Gitlab::Application.routes.draw do
end
end
resources
:commit
,
only:
[
:show
],
constraints:
{
id:
/[[:alnum:]]{6,40}/
}
# XXX: WIP
resources
:commit
,
only:
[
:show
],
constraints:
{
id:
/[[:alnum:]]{6,40}/
}
resources
:commits
,
only:
[
:show
],
constraints:
{
id:
/.+/
},
as:
'history'
resources
:blame
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:blob
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
# resources :raw, only: [:show], constraints: {id: /.+/}
resources
:tree
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
match
"/compare/:from...:to"
=>
"compare#show"
,
as:
"compare"
,
constraints:
{
from:
/.+/
,
to:
/.+/
}
resources
:commits
,
only:
[
:index
,
:show
]
do
member
do
get
:patch
end
end
# resources :commits, only: [:show], as: 'history'
do
#
member do
#
get :patch
#
end
#
end
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:team_members
...
...
@@ -184,13 +191,6 @@ Gitlab::Application.routes.draw do
post
:preview
end
end
# XXX: WIP
resources
:blame
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:blob
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
# resources :raw, only: [:show], constraints: {id: /.+/}
resources
:tree
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
match
"/compare/:from...:to"
=>
"compare#show"
,
as:
"compare"
,
constraints:
{
from:
/.+/
,
to:
/.+/
}
end
root
to:
"dashboard#index"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录