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
d1980ef9
Commit
d1980ef9
authored
Nov 28, 2016
by
Gabriel Gizotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only render MR description toggle javascript if description is available
parent
1a72dc24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
_commit_message_container.html.haml
app/views/shared/_commit_message_container.html.haml
+19
-20
No files found.
app/views/shared/_commit_message_container.html.haml
View file @
d1980ef9
...
...
@@ -14,7 +14,7 @@
%p
.hint
Try to keep the first line under 52 characters
and the others under 72.
-
if
local_assigns
[
:description
]
-
if
local_assigns
[
:description
]
%p
.hint.use-description-hint
=
link_to
"#"
,
class:
"use-description-link"
do
Use Merge Request description as merge commit message
...
...
@@ -22,29 +22,28 @@
=
link_to
"#"
,
class:
"use-default-message-link"
do
Use default Gitlab merge commit message
:javascript
$
(
'.use-description-link'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
:javascript
$
(
'.use-description-link'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
var
message
=
"Merge branch '
#{
j
@merge_request
.
source_branch
}
' into '
#{
j
@merge_request
.
target_branch
}
'
\
n
\
n"
message
=
message
+
"
#{
j
@merge_request
.
title
}
\
n
\
n"
message
=
message
+
"
#{
j
local_assigns
[
:description
]
}
\
n
\
n"
;
message
=
message
+
"See merge request
#{
j
@merge_request
.
to_reference
}
"
var
message
=
"Merge branch '
#{
j
@merge_request
.
source_branch
}
' into '
#{
j
@merge_request
.
target_branch
}
'
\
n
\
n"
message
=
message
+
"
#{
j
@merge_request
.
title
}
\
n
\
n"
message
=
message
+
"
#{
j
local_assigns
[
:description
]
}
\
n
\
n"
;
message
=
message
+
"See merge request
#{
j
@merge_request
.
to_reference
}
"
$
(
'.use-description-hint'
).
hide
();
$
(
'.use-default-message-hint'
).
show
();
$
(
'.js-commit-message'
).
val
(
message
)
});
$
(
'.use-description-hint'
).
hide
();
$
(
'.use-default-message-hint'
).
show
();
$
(
'.js-commit-message'
).
val
(
message
)
});
$
(
'.use-default-message-link'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'.use-default-message-link'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
var
defaultMessage
=
"
#{
j
(
params
[
:commit_message
]
||
local_assigns
[
:text
]
||
local_assigns
[
:placeholder
])
}
"
;
var
defaultMessage
=
"
#{
j
(
params
[
:commit_message
]
||
local_assigns
[
:text
]
||
local_assigns
[
:placeholder
])
}
"
;
$
(
'.use-description-hint'
).
show
();
$
(
'.use-default-message-hint'
).
hide
();
$
(
'.js-commit-message'
).
val
(
defaultMessage
);
});
$
(
'.use-description-hint'
).
show
();
$
(
'.use-default-message-hint'
).
hide
();
$
(
'.js-commit-message'
).
val
(
defaultMessage
);
});
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