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
705fe01d
Commit
705fe01d
authored
Sep 20, 2014
by
Ciro Santilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor issue and edit MR form label field and submit.
parent
248990b5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
34 deletions
+22
-34
app/models/issue.rb
app/models/issue.rb
+5
-0
app/views/projects/_issuable_form.html.haml
app/views/projects/_issuable_form.html.haml
+17
-0
app/views/projects/issues/_form.html.haml
app/views/projects/issues/_form.html.haml
+0
-15
app/views/projects/merge_requests/_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+0
-19
No files found.
app/models/issue.rb
View file @
705fe01d
...
...
@@ -65,4 +65,9 @@ class Issue < ActiveRecord::Base
def
reset_events_cache
Event
.
reset_event_cache_for
(
self
)
end
# To allow polymorphism with MergeRequest.
def
source_project
project
end
end
app/views/projects/_issuable_form.html.haml
View file @
705fe01d
...
...
@@ -44,3 +44,20 @@
Milestone
.col-sm-10
=
f
.
select
(
:milestone_id
,
milestone_options
(
issuable
),
{
include_blank:
'Select milestone'
},
{
class:
'select2'
})
.form-group
=
f
.
label
:label_ids
,
class:
'control-label'
do
%i
.icon-tag
Labels
.col-sm-10
=
f
.
collection_select
:label_ids
,
issuable
.
project
.
labels
.
all
,
:id
,
:name
,
{
selected:
issuable
.
label_ids
},
multiple:
true
,
class:
'select2'
.form-actions
-
if
issuable
.
new_record?
=
f
.
submit
"Submit new
#{
issuable
.
class
.
model_name
.
human
.
downcase
}
"
,
class:
'btn btn-create'
-
else
=
f
.
submit
'Save changes'
,
class:
'btn btn-save'
-
if
issuable
.
new_record?
-
cancel_project
=
issuable
.
source_project
-
else
-
cancel_project
=
issuable
.
project
=
link_to
'Cancel'
,
[
cancel_project
,
issuable
],
class:
'btn btn-cancel'
app/views/projects/issues/_form.html.haml
View file @
705fe01d
...
...
@@ -10,21 +10,6 @@
=
form_for
[
@project
,
@issue
],
html:
{
class:
'form-horizontal issue-form'
}
do
|
f
|
=
render
'projects/issuable_form'
,
f:
f
,
issuable:
@issue
.form-group
=
f
.
label
:label_ids
,
class:
'control-label'
do
%i
.icon-tag
Labels
.col-sm-10
=
f
.
collection_select
:label_ids
,
@project
.
labels
.
all
,
:id
,
:name
,
{
selected:
@issue
.
label_ids
},
multiple:
true
,
class:
'select2'
.form-actions
-
if
@issue
.
new_record?
=
f
.
submit
'Submit new issue'
,
class:
"btn btn-create"
-
else
=
f
.
submit
'Save changes'
,
class:
"btn-save btn"
-
cancel_path
=
@issue
.
new_record?
?
project_issues_path
(
@project
)
:
project_issue_path
(
@project
,
@issue
)
=
link_to
"Cancel"
,
cancel_path
,
class:
'btn btn-cancel'
:javascript
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
function
(
e
){
...
...
app/views/projects/merge_requests/_form.html.haml
View file @
705fe01d
...
...
@@ -8,27 +8,8 @@
Please review the
%strong
#{
link_to
"guidelines for contribution"
,
contribution_guide_url
}
to this repository.
.merge-request-form-info
=
render
'projects/issuable_form'
,
f:
f
,
issuable:
@merge_request
.form-group
=
f
.
label
:label_ids
,
class:
'control-label'
do
%i
.icon-tag
Labels
.col-sm-10
=
f
.
collection_select
:label_ids
,
@merge_request
.
target_project
.
labels
.
all
,
:id
,
:name
,
{
selected:
@merge_request
.
label_ids
},
multiple:
true
,
class:
'select2'
.form-actions
-
if
@merge_request
.
new_record?
=
f
.
submit
'Submit merge request'
,
class:
"btn btn-create"
-
else
=
f
.
submit
'Save changes'
,
class:
"btn btn-save"
-
if
@merge_request
.
new_record?
=
link_to
project_merge_requests_path
(
@source_project
),
class:
"btn btn-cancel"
do
Cancel
-
else
=
link_to
project_merge_request_path
(
@target_project
,
@merge_request
),
class:
"btn btn-cancel"
do
Cancel
:javascript
disableButtonIfEmptyField
(
"
#merge_request_title
"
,
"
.btn-save
"
);
...
...
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