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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0590aa9d
Commit
0590aa9d
authored
Jul 27, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit.short_id as model method. Styled inline comment form
parent
67ef96ea
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
23 deletions
+46
-23
app/assets/javascripts/note.js
app/assets/javascripts/note.js
+1
-1
app/assets/stylesheets/notes.scss
app/assets/stylesheets/notes.scss
+20
-3
app/decorators/commit_decorator.rb
app/decorators/commit_decorator.rb
+0
-4
app/models/commit.rb
app/models/commit.rb
+8
-0
app/views/commits/_commit_box.html.haml
app/views/commits/_commit_box.html.haml
+1
-1
app/views/notes/_form.html.haml
app/views/notes/_form.html.haml
+1
-1
app/views/notes/_per_line_form.html.haml
app/views/notes/_per_line_form.html.haml
+15
-13
No files found.
app/assets/javascripts/note.js
View file @
0590aa9d
...
...
@@ -33,7 +33,7 @@ init:
})
$
(
"
#note_note
"
).
live
(
"
focus
"
,
function
(){
$
(
this
).
css
(
"
height
"
,
"
10
0px
"
);
$
(
this
).
css
(
"
height
"
,
"
8
0px
"
);
$
(
'
.note_advanced_opts
'
).
show
();
});
...
...
app/assets/stylesheets/notes.scss
View file @
0590aa9d
...
...
@@ -24,8 +24,8 @@
/* Note textare */
#note_note
{
height
:
10
0px
;
width
:
9
7
%
;
height
:
8
0px
;
width
:
9
9
%
;
font-size
:
14px
;
}
...
...
@@ -100,8 +100,25 @@ tr.line_notes_row {
td
{
border-bottom
:
1px
solid
#ddd
;
}
.actions
{
.
note_
actions
{
margin
:
0
;
padding-top
:
10px
;
.buttons
{
float
:left
;
width
:
300px
;
}
.options
{
.labels
{
float
:left
;
padding-left
:
10px
;
label
{
padding
:
6px
0
;
margin
:
0
;
width
:
120px
;
}
}
}
}
}
...
...
app/decorators/commit_decorator.rb
View file @
0590aa9d
class
CommitDecorator
<
ApplicationDecorator
decorates
:commit
def
short_id
(
length
=
10
)
id
.
to_s
[
0
..
length
]
end
# Returns the commits title.
#
# Usually, the commit title is the first line of the commit message.
...
...
app/models/commit.rb
View file @
0590aa9d
...
...
@@ -114,6 +114,10 @@ class Commit
@head
=
head
end
def
short_id
(
length
=
10
)
id
.
to_s
[
0
..
length
]
end
def
safe_message
utf8
message
end
...
...
@@ -150,4 +154,8 @@ class Commit
def
prev_commit_id
prev_commit
.
try
:id
end
def
parents_count
parents
&&
parents
.
count
||
0
end
end
app/views/commits/_commit_box.html.haml
View file @
0590aa9d
.commit-box
{
class:
@commit
.
parents
.
count
>
1
?
"merge-commit"
:
""
}
.commit-box
{
class:
@commit
.
parents
_
count
>
1
?
"merge-commit"
:
""
}
.commit-head
.right
-
if
@notes_count
>
0
...
...
app/views/notes/_form.html.haml
View file @
0590aa9d
=
form_for
[
@project
,
@note
],
:remote
=>
"true"
,
:multipart
=>
true
do
|
f
|
%h3
Leave a comment
%h3
.page_title
Leave a comment
-
if
@note
.
errors
.
any?
.alert-message.block-message.error
-
@note
.
errors
.
full_messages
.
each
do
|
msg
|
...
...
app/views/notes/_per_line_form.html.haml
View file @
0590aa9d
...
...
@@ -2,7 +2,7 @@
%tr
.per_line_form
%td
{
:colspan
=>
3
}
=
form_for
[
@project
,
@note
],
:remote
=>
"true"
,
:multipart
=>
true
do
|
f
|
%h3
Leave a note
%h3
.page_title
Leave a note
%div
.span10
-
if
@note
.
errors
.
any?
.alert-message.block-message.error
...
...
@@ -13,19 +13,21 @@
=
f
.
hidden_field
:noteable_type
=
f
.
hidden_field
:line_code
=
f
.
text_area
:note
,
:size
=>
255
%h5
Notify via email:
.clearfix
=
label_tag
:notify
do
=
check_box_tag
:notify
,
1
,
@note
.
noteable_type
!=
"Commit"
%span
Project team
.note_actions
.buttons
=
f
.
submit
'Add note'
,
:class
=>
"btn primary submit_note"
,
:id
=>
"submit_note"
=
link_to
"Cancel"
,
"#"
,
:class
=>
"btn hide-button"
.options
%h6
.left
Notify via email:
.labels
=
label_tag
:notify
do
=
check_box_tag
:notify
,
1
,
@note
.
noteable_type
!=
"Commit"
%span
Project team
-
if
@note
.
notify_only_author?
(
current_user
)
=
label_tag
:notify_author
do
=
check_box_tag
:notify_author
,
1
,
@note
.
noteable_type
==
"Commit"
%span
Commit author
.actions
=
f
.
submit
'Add note'
,
:class
=>
"btn primary submit_note"
,
:id
=>
"submit_note"
=
link_to
"Close"
,
"#"
,
:class
=>
"btn hide-button"
-
if
@note
.
notify_only_author?
(
current_user
)
=
label_tag
:notify_author
do
=
check_box_tag
:notify_author
,
1
,
@note
.
noteable_type
==
"Commit"
%span
Commit author
:javascript
$
(
function
(){
...
...
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