BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f1e1e5bf
Commit
f1e1e5bf
authored
Feb 26, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6412 from skv-headless/commit_description
commit description in commit list
parents
5bdcdcd8
2c28dbd2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
7 deletions
+48
-7
commits.scss
app/assets/stylesheets/sections/commits.scss
+32
-0
commit.rb
app/models/commit.rb
+8
-6
_commit.html.haml
app/views/projects/commits/_commit.html.haml
+8
-1
No files found.
app/assets/stylesheets/sections/commits.scss
View file @
f1e1e5bf
...
@@ -168,6 +168,32 @@ li.commit {
...
@@ -168,6 +168,32 @@ li.commit {
text-decoration
:
underline
;
text-decoration
:
underline
;
}
}
}
}
.text-expander
{
background
:
#ddd
;
color
:
#555
;
padding
:
0
5px
;
line-height
:
6px
;
height
:
12px
;
font-size
:
12px
;
font-weight
:
bold
;
vertical-align
:
middle
;
display
:
inline-block
;
border-radius
:
1px
;
text-decoration
:
none
;
cursor
:
pointer
;
&
:hover
{
background-color
:
#ccc
;
}
}
}
.commit-row-description
{
font-size
:
14px
;
border-left
:
1px
solid
#e5e5e5
;
padding
:
0
15px
0
7px
;
margin
:
5px
0
10px
5px
;
display
:
none
;
}
}
.commit-row-info
{
.commit-row-info
{
...
@@ -192,4 +218,10 @@ li.commit {
...
@@ -192,4 +218,10 @@ li.commit {
@extend
.cgray
;
@extend
.cgray
;
}
}
}
}
&
.open
{
.commit-row-description
{
display
:
block
;
}
}
}
}
app/models/commit.rb
View file @
f1e1e5bf
...
@@ -99,14 +99,16 @@ class Commit
...
@@ -99,14 +99,16 @@ class Commit
#
#
# cut off, ellipses (`&hellp;`) are prepended to the commit message.
# cut off, ellipses (`&hellp;`) are prepended to the commit message.
def
description
def
description
description
=
safe_message
title_end
=
safe_message
.
index
(
/\n/
)
@description
||=
if
(
!
title_end
&&
safe_message
.
length
>
100
)
||
(
title_end
&&
title_end
>
100
)
title_end
=
description
.
index
(
/\n/
)
"…"
.
html_safe
<<
safe_message
[
80
..-
1
]
if
(
!
title_end
&&
description
.
length
>
100
)
||
(
title_end
&&
title_end
>
100
)
"…"
.
html_safe
<<
description
[
80
..-
1
]
else
else
description
.
split
(
/\n/
,
2
)[
1
].
try
(
:chomp
)
safe_message
.
split
(
/\n/
,
2
)[
1
].
try
(
:chomp
)
end
end
end
def
description?
description
.
present?
end
end
# Regular expression that identifies commit message clauses that trigger issue closing.
# Regular expression that identifies commit message clauses that trigger issue closing.
...
...
app/views/projects/commits/_commit.html.haml
View file @
f1e1e5bf
%li
.commit
%li
.commit
.commit-row-title
.commit-row-title
{
"data-toggle"
=>
"dropdown"
}
=
link_to
commit
.
short_id
(
8
),
project_commit_path
(
project
,
commit
),
class:
"commit_short_id"
=
link_to
commit
.
short_id
(
8
),
project_commit_path
(
project
,
commit
),
class:
"commit_short_id"
%span
.str-truncated
%span
.str-truncated
=
link_to_gfm
commit
.
title
,
project_commit_path
(
project
,
commit
.
id
),
class:
"commit-row-message"
=
link_to_gfm
commit
.
title
,
project_commit_path
(
project
,
commit
.
id
),
class:
"commit-row-message"
-
if
commit
.
description?
%span
.label-default.text-expander.js-details-target
...
=
link_to
"Browse Code »"
,
project_tree_path
(
project
,
commit
),
class:
"pull-right"
=
link_to
"Browse Code »"
,
project_tree_path
(
project
,
commit
),
class:
"pull-right"
.notes_count
.notes_count
-
notes
=
project
.
notes
.
for_commit_id
(
commit
.
id
)
-
notes
=
project
.
notes
.
for_commit_id
(
commit
.
id
)
...
@@ -12,6 +15,10 @@
...
@@ -12,6 +15,10 @@
%i
.icon-comment
%i
.icon-comment
=
notes
.
count
=
notes
.
count
-
if
commit
.
description?
.commit-row-description
=
simple_format
(
commit
.
description
)
.commit-row-info
.commit-row-info
=
commit_author_link
(
commit
,
avatar:
true
,
size:
16
)
=
commit_author_link
(
commit
,
avatar:
true
,
size:
16
)
.committed_ago
.committed_ago
...
...
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