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
7478ece8
Commit
7478ece8
authored
May 08, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add template for merge request descriptions to projects.
parent
ccff1051
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
2 deletions
+25
-2
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+8
-0
app/models/project.rb
app/models/project.rb
+2
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+7
-0
app/views/projects/merge_requests/_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+2
-1
db/migrate/20140508105809_add_mr_template_to_project.rb
db/migrate/20140508105809_add_mr_template_to_project.rb
+5
-0
db/schema.rb
db/schema.rb
+1
-0
No files found.
app/assets/javascripts/project.js.coffee
View file @
7478ece8
...
@@ -24,6 +24,14 @@ class Project
...
@@ -24,6 +24,14 @@ class Project
else
else
$
(
'#project_issues_tracker_id'
).
removeAttr
(
'disabled'
)
$
(
'#project_issues_tracker_id'
).
removeAttr
(
'disabled'
)
$
(
'#project_merge_requests_enabled'
).
change
->
if
(
$
(
this
).
is
(
':checked'
)
==
true
)
$
(
'#project_merge_requests_template'
).
removeAttr
(
'disabled'
)
else
$
(
'#project_merge_requests_template'
).
attr
(
'disabled'
,
'disabled'
)
$
(
'#project_merge_requests_template'
).
change
()
@
Project
=
Project
@
Project
=
Project
...
...
app/models/project.rb
View file @
7478ece8
...
@@ -40,7 +40,8 @@ class Project < ActiveRecord::Base
...
@@ -40,7 +40,8 @@ class Project < ActiveRecord::Base
attr_accessible
:name
,
:path
,
:description
,
:issues_tracker
,
:label_list
,
attr_accessible
:name
,
:path
,
:description
,
:issues_tracker
,
:label_list
,
:issues_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:issues_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
as:
[
:default
,
:admin
]
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:merge_requests_template
,
as:
[
:default
,
:admin
]
attr_accessible
:namespace_id
,
:creator_id
,
as: :admin
attr_accessible
:namespace_id
,
:creator_id
,
as: :admin
...
...
app/views/projects/edit.html.haml
View file @
7478ece8
...
@@ -66,6 +66,13 @@
...
@@ -66,6 +66,13 @@
=
f
.
check_box
:merge_requests_enabled
=
f
.
check_box
:merge_requests_enabled
%span
.descr
Submit changes to be merged upstream.
%span
.descr
Submit changes to be merged upstream.
.form-group
=
f
.
label
:merge_requests_template
,
class:
'control-label'
do
Merge request template
%span
.light
(optional)
.col-sm-10
=
f
.
text_area
:merge_requests_template
,
placeholder:
"This MR should have: *"
,
disabled:
!
@project
.
merge_requests_enabled
,
class:
"form-control"
,
rows:
3
.form-group
.form-group
=
f
.
label
:wiki_enabled
,
"Wiki"
,
class:
'control-label'
=
f
.
label
:wiki_enabled
,
"Wiki"
,
class:
'control-label'
.col-sm-10
.col-sm-10
...
...
app/views/projects/merge_requests/_form.html.haml
View file @
7478ece8
...
@@ -22,7 +22,8 @@
...
@@ -22,7 +22,8 @@
.form-group
.form-group
=
f
.
label
:description
,
"Description"
,
class:
'control-label'
=
f
.
label
:description
,
"Description"
,
class:
'control-label'
.col-sm-10
.col-sm-10
=
f
.
text_area
:description
,
class:
"form-control js-gfm-input"
,
rows:
14
-
template
=
@project
.
merge_requests_template
=
f
.
text_area
:description
,
value:
template
,
class:
"form-control js-gfm-input"
,
rows:
14
%p
.hint
Description is parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
%p
.hint
Description is parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
%hr
%hr
.form-group
.form-group
...
...
db/migrate/20140508105809_add_mr_template_to_project.rb
0 → 100644
View file @
7478ece8
class
AddMrTemplateToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:merge_requests_template
,
:text
end
end
db/schema.rb
View file @
7478ece8
...
@@ -252,6 +252,7 @@ ActiveRecord::Schema.define(version: 20140513095908) do
...
@@ -252,6 +252,7 @@ ActiveRecord::Schema.define(version: 20140513095908) do
t
.
boolean
"archived"
,
default:
false
,
null:
false
t
.
boolean
"archived"
,
default:
false
,
null:
false
t
.
string
"import_status"
t
.
string
"import_status"
t
.
float
"repository_size"
,
default:
0.0
t
.
float
"repository_size"
,
default:
0.0
t
.
text
"merge_requests_template"
end
end
add_index
"projects"
,
[
"creator_id"
],
name:
"index_projects_on_creator_id"
,
using: :btree
add_index
"projects"
,
[
"creator_id"
],
name:
"index_projects_on_creator_id"
,
using: :btree
...
...
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