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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
bcf55312
Commit
bcf55312
authored
Oct 17, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #132
parent
9265de3d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+7
-0
app/views/commits/_commits.html.haml
app/views/commits/_commits.html.haml
+1
-1
app/views/commits/show.html.haml
app/views/commits/show.html.haml
+1
-1
app/views/projects/_tree_item.html.haml
app/views/projects/_tree_item.html.haml
+1
-1
No files found.
app/helpers/commits_helper.rb
View file @
bcf55312
...
...
@@ -21,4 +21,11 @@ module CommitsHelper
link_to
"More"
,
project_commits_path
(
@project
,
:offset
=>
offset
.
to_i
+
limit
.
to_i
,
:limit
=>
limit
),
:remote
=>
true
,
:class
=>
"lite_button vm"
,
:style
=>
"text-align:center; width:930px; "
,
:id
=>
"more-commits-link"
end
def
truncate_commit_message
(
commit
,
size
=
60
)
truncate
(
commit
.
message
,
:length
=>
size
)
# if special characters occurs
rescue
commit
.
message
.
length
>
size
?
(
commit
.
message
[
0
..
(
size
-
1
)]
+
"..."
)
:
commit
.
message
end
end
app/views/commits/_commits.html.haml
View file @
bcf55312
...
...
@@ -11,7 +11,7 @@
=
image_tag
"no_avatar.png"
,
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
%p
%strong
=
commit
.
message
.
length
>
60
?
(
commit
.
message
[
0
..
59
]
+
"..."
)
:
commit
.
message
=
truncate_commit_message
(
commit
)
=
link_to
"Browse Code"
,
tree_project_path
(
@project
,
:commit_id
=>
commit
.
id
),
:class
=>
"lite_button"
,
:style
=>
"float:right"
=
link_to
truncate
(
commit
.
id
.
to_s
,
:length
=>
16
),
project_commit_path
(
@project
,
:id
=>
commit
.
id
),
:class
=>
"lite_button"
,
:style
=>
"width:120px;float:right"
%span
...
...
app/views/commits/show.html.haml
View file @
bcf55312
%h3
=
"[
#{
@commit
.
committer
}
]
#{
truncate
@commit
.
message
,
:length
=>
80
}
"
=
"[
#{
@commit
.
committer
}
]
#{
truncate
_commit_message
(
@commit
,
80
)
}
"
-#= link_to 'Back', project_commits_path(@project), :class => "button"
%table
.round-borders
%tr
...
...
app/views/projects/_tree_item.html.haml
View file @
bcf55312
...
...
@@ -12,4 +12,4 @@
=
time_ago_in_words
(
content_commit
.
committed_date
)
ago
%td
=
link_to
truncate
(
content_commit
.
message
,
:length
=>
40
),
project_commit_path
(
@project
,
content_commit
)
=
link_to
truncate
_commit_message
(
content_commit
,
40
),
project_commit_path
(
@project
,
content_commit
)
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