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
34cea1cb
Commit
34cea1cb
authored
Jul 22, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update views to use CommitDecorator
parent
ff40b7de
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
28 additions
and
19 deletions
+28
-19
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+1
-0
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+1
-0
app/controllers/refs_controller.rb
app/controllers/refs_controller.rb
+2
-1
app/views/commits/_commit.html.haml
app/views/commits/_commit.html.haml
+2
-2
app/views/commits/index.atom.builder
app/views/commits/index.atom.builder
+2
-2
app/views/events/_commit.html.haml
app/views/events/_commit.html.haml
+3
-2
app/views/refs/_tree_commit.html.haml
app/views/refs/_tree_commit.html.haml
+1
-1
app/views/refs/blame.html.haml
app/views/refs/blame.html.haml
+3
-2
app/views/repositories/_branch.html.haml
app/views/repositories/_branch.html.haml
+7
-5
app/views/repositories/_feed.html.haml
app/views/repositories/_feed.html.haml
+3
-2
app/views/repositories/tags.html.haml
app/views/repositories/tags.html.haml
+3
-2
No files found.
app/controllers/commits_controller.rb
View file @
34cea1cb
...
...
@@ -17,6 +17,7 @@ class CommitsController < ApplicationController
@limit
,
@offset
=
(
params
[
:limit
]
||
40
),
(
params
[
:offset
]
||
0
)
@commits
=
@project
.
commits
(
@ref
,
params
[
:path
],
@limit
,
@offset
)
@commits
=
CommitDecorator
.
decorate
(
@commits
)
respond_to
do
|
format
|
format
.
html
# index.html.erb
...
...
app/controllers/merge_requests_controller.rb
View file @
34cea1cb
...
...
@@ -143,5 +143,6 @@ class MergeRequestsController < ApplicationController
# Get commits from repository
# or from cache if already merged
@commits
=
@merge_request
.
commits
@commits
=
CommitDecorator
.
decorate
(
@commits
)
end
end
app/controllers/refs_controller.rb
View file @
34cea1cb
...
...
@@ -51,7 +51,8 @@ class RefsController < ApplicationController
@logs
=
contents
.
map
do
|
content
|
file
=
params
[
:path
]
?
File
.
join
(
params
[
:path
],
content
.
name
)
:
content
.
name
last_commit
=
@project
.
commits
(
@commit
.
id
,
file
,
1
).
last
{
last_commit
=
CommitDecorator
.
decorate
(
last_commit
)
{
:file_name
=>
content
.
name
,
:commit
=>
last_commit
}
...
...
app/views/commits/_commit.html.haml
View file @
34cea1cb
...
...
@@ -4,11 +4,11 @@
%strong
=
link_to
"Browse Code »"
,
tree_project_ref_path
(
@project
,
commit
.
id
),
:class
=>
"right"
=
link_to
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
do
%p
%code
.left
=
commit
.
id
.
to_s
[
0
..
10
]
%code
.left
=
commit
.
short_id
%strong
.cgray
=
commit
.
author_name
–
=
image_tag
gravatar_icon
(
commit
.
author_email
),
:class
=>
"avatar"
,
:width
=>
16
%span
.row_title
=
truncate
(
commit
.
safe_messag
e
,
:length
=>
50
)
%span
.row_title
=
truncate
(
commit
.
titl
e
,
:length
=>
50
)
%span
.committed_ago
=
time_ago_in_words
(
commit
.
committed_date
)
...
...
app/views/commits/index.atom.builder
View file @
34cea1cb
...
...
@@ -10,14 +10,14 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.entry do
xml.id project_commit_url(@project, :id => commit.id)
xml.link :href => project_commit_url(@project, :id => commit.id)
xml.title truncate(commit.
safe_messag
e, :length => 80)
xml.title truncate(commit.
titl
e, :length => 80)
xml.updated commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")
xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(commit.author_email)
xml.author do |author|
xml.name commit.author_name
xml.email commit.author_email
end
xml.summary commit.
safe_message
xml.summary commit.
description
end
end
end
app/views/events/_commit.html.haml
View file @
34cea1cb
-
commit
=
CommitDecorator
.
decorate
(
commit
)
%li
.wll.commit
=
link_to
project_commit_path
(
project
,
:id
=>
commit
.
id
)
do
%p
%code
.left
=
commit
.
id
.
to_s
[
0
..
10
]
%code
.left
=
commit
.
short_id
%strong
.cgray
=
commit
.
author_name
–
=
image_tag
gravatar_icon
(
commit
.
author_email
),
:class
=>
"avatar"
,
:width
=>
16
%span
.row_title
=
truncate
(
commit
.
safe_messag
e
,
:length
=>
50
)
rescue
"--broken encoding"
%span
.row_title
=
truncate
(
commit
.
titl
e
,
:length
=>
50
)
rescue
"--broken encoding"
app/views/refs/_tree_commit.html.haml
View file @
34cea1cb
-
if
tm
%strong
=
link_to
"[
#{
tm
.
user_name
}
]"
,
project_team_member_path
(
@project
,
tm
)
=
link_to
truncate
(
content_commit
.
safe_messag
e
,
:length
=>
tm
?
30
:
50
),
project_commit_path
(
@project
,
content_commit
.
id
),
:class
=>
"tree-commit-link"
=
link_to
truncate
(
content_commit
.
titl
e
,
:length
=>
tm
?
30
:
50
),
project_commit_path
(
@project
,
content_commit
.
id
),
:class
=>
"tree-commit-link"
app/views/refs/blame.html.haml
View file @
34cea1cb
...
...
@@ -25,6 +25,7 @@
%table
-
@blame
.
each
do
|
commit
,
lines
|
-
commit
=
Commit
.
new
(
commit
)
-
commit
=
CommitDecorator
.
decorate
(
commit
)
%tr
%td
.author
=
image_tag
gravatar_icon
(
commit
.
author_email
,
16
)
...
...
@@ -32,8 +33,8 @@
%td
.blame_commit
=
link_to
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
do
%code
=
commit
.
id
.
to_s
[
0
..
10
]
%span
.row_title
=
truncate
(
commit
.
safe_messag
e
,
:length
=>
30
)
rescue
"--broken encoding"
%code
=
commit
.
short_id
%span
.row_title
=
truncate
(
commit
.
titl
e
,
:length
=>
30
)
rescue
"--broken encoding"
%td
.lines
=
preserve
do
%pre
...
...
app/views/repositories/_branch.html.haml
View file @
34cea1cb
-
commit
=
Commit
.
new
(
branch
.
commit
)
-
commit
=
CommitDecorator
.
decorate
(
commit
)
%tr
%td
=
link_to
project_commits_path
(
@project
,
:ref
=>
branch
.
name
)
do
...
...
@@ -5,14 +7,14 @@
-
if
branch
.
name
==
@project
.
root_ref
%span
.label
default
%td
=
link_to
project_commit_path
(
@project
,
:id
=>
branch
.
commit
.
id
)
do
%code
=
branch
.
commit
.
id
.
to_s
[
0
..
10
]
=
link_to
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
do
%code
=
commit
.
short_id
=
image_tag
gravatar_icon
(
Commit
.
new
(
branch
.
commit
)
.
author_email
),
:class
=>
""
,
:width
=>
16
=
truncate
(
Commit
.
new
(
branch
.
commit
).
safe_messag
e
,
:length
=>
40
)
=
image_tag
gravatar_icon
(
commit
.
author_email
),
:class
=>
""
,
:width
=>
16
=
truncate
(
commit
.
titl
e
,
:length
=>
40
)
%td
%span
.update-author.right
=
time_ago_in_words
(
branch
.
commit
.
committed_date
)
=
time_ago_in_words
(
commit
.
committed_date
)
ago
%td
-
if
can?
current_user
,
:download_code
,
@project
...
...
app/views/repositories/_feed.html.haml
View file @
34cea1cb
-
commit
=
update
-
commit
=
CommitDecorator
.
new
(
commit
)
%tr
%td
=
link_to
project_commits_path
(
@project
,
:ref
=>
commit
.
head
.
name
)
do
...
...
@@ -10,9 +11,9 @@
%td
%div
=
link_to
project_commits_path
(
@project
,
commit
.
id
)
do
%code
=
commit
.
id
.
to_s
[
0
..
10
]
%code
=
commit
.
short_id
=
image_tag
gravatar_icon
(
commit
.
author_email
),
:class
=>
""
,
:width
=>
16
=
truncate
(
commit
.
safe_messag
e
,
:length
=>
40
)
=
truncate
(
commit
.
titl
e
,
:length
=>
40
)
%td
%span
.right.cgray
=
time_ago_in_words
(
commit
.
committed_date
)
...
...
app/views/repositories/tags.html.haml
View file @
34cea1cb
...
...
@@ -9,14 +9,15 @@
%th
-
@tags
.
each
do
|
tag
|
-
commit
=
Commit
.
new
(
tag
.
commit
)
-
commit
=
CommitDecorator
.
decorate
(
commit
)
%tr
%td
%strong
=
link_to
tag
.
name
,
project_commits_path
(
@project
,
:ref
=>
tag
.
name
),
:class
=>
""
%td
=
link_to
project_commit_path
(
@project
,
commit
.
id
)
do
%code
=
commit
.
id
.
to_s
[
0
..
10
]
%code
=
commit
.
short_id
=
image_tag
gravatar_icon
(
commit
.
author_email
),
:class
=>
""
,
:width
=>
16
=
truncate
(
commit
.
safe_messag
e
,
:length
=>
40
)
=
truncate
(
commit
.
titl
e
,
:length
=>
40
)
%td
%span
.update-author.right
=
time_ago_in_words
(
commit
.
committed_date
)
...
...
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