Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
35748269
Commit
35748269
authored
Sep 20, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Commits#show instead of Commits#index
Takes tree-ish + path as ID
parent
169f16fb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
45 deletions
+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
No files found.
app/controllers/commits_controller.rb
View file @
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
View file @
35748269
File moved
app/views/commits/
index
.html.haml
→
app/views/commits/
show
.html.haml
View file @
35748269
File moved
app/views/commits/
index
.js.haml
→
app/views/commits/
show
.js.haml
View file @
35748269
File moved
app/views/layouts/_project_menu.html.haml
View file @
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
View file @
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment