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
5f66bfe7
Commit
5f66bfe7
authored
Apr 22, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added due date calendar to new issue form
Closes #15516
parent
78a67fc4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
41 deletions
+58
-41
app/assets/javascripts/issuable_form.js.coffee
app/assets/javascripts/issuable_form.js.coffee
+9
-0
app/assets/stylesheets/framework/forms.scss
app/assets/stylesheets/framework/forms.scss
+4
-4
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+45
-37
No files found.
app/assets/javascripts/issuable_form.js.coffee
View file @
5f66bfe7
...
@@ -20,6 +20,15 @@ class @IssuableForm
...
@@ -20,6 +20,15 @@ class @IssuableForm
@
initWip
()
@
initWip
()
$issuableDueDate
=
$
(
'#issuable-due-date'
)
if
$issuableDueDate
.
length
$
(
'.datepicker'
).
datepicker
(
dateFormat
:
'yy-mm-dd'
,
onSelect
:
(
dateText
,
inst
)
->
$issuableDueDate
.
val
dateText
).
datepicker
'setDate'
,
$
.
datepicker
.
parseDate
(
'yy-mm-dd'
,
$issuableDueDate
.
val
())
initAutosave
:
->
initAutosave
:
->
new
Autosave
@
titleField
,
[
new
Autosave
@
titleField
,
[
document
.
location
.
pathname
,
document
.
location
.
pathname
,
...
...
app/assets/stylesheets/framework/forms.scss
View file @
5f66bfe7
...
@@ -28,10 +28,6 @@ input[type='text'].danger {
...
@@ -28,10 +28,6 @@ input[type='text'].danger {
}
}
label
{
label
{
&
.control-label
{
@extend
.col-sm-2
;
}
&
.inline-label
{
&
.inline-label
{
margin
:
0
;
margin
:
0
;
}
}
...
@@ -41,6 +37,10 @@ label {
...
@@ -41,6 +37,10 @@ label {
}
}
}
}
.control-label
{
@extend
.col-sm-2
;
}
.inline-input-group
{
.inline-input-group
{
width
:
250px
;
width
:
250px
;
}
}
...
...
app/views/shared/issuable/_form.html.haml
View file @
5f66bfe7
...
@@ -44,45 +44,53 @@
...
@@ -44,45 +44,53 @@
This issue is confidential and should only be visible to team members
This issue is confidential and should only be visible to team members
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
issuable
.
project
)
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
issuable
.
project
)
-
has_due_date
=
issuable
.
has_attribute?
(
:due_date
)
%hr
%hr
.form-group
.row
.issue-assignee
%div
{
class:
(
has_due_date
?
"col-lg-6"
:
"col-sm-12"
)
}
=
f
.
label
:assignee_id
,
"Assignee"
,
class:
'control-label'
.form-group.issue-assignee
.col-sm-10
=
f
.
label
:assignee_id
,
"Assignee"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
.issuable-form-select-holder
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
=
users_select_tag
(
"
#{
issuable
.
class
.
model_name
.
param_key
}
[assignee_id]"
,
placeholder:
'Select assignee'
,
class:
'custom-form-control'
,
null_user:
true
,
selected:
issuable
.
assignee_id
,
project:
@target_project
||
@project
,
first_user:
true
,
current_user:
true
,
include_blank:
true
)
=
link_to
'Assign to me'
,
'#'
,
class:
'btn assign-to-me-link'
.form-group
.issue-milestone
=
f
.
label
:milestone_id
,
"Milestone"
,
class:
'control-label'
.col-sm-10
-
if
milestone_options
(
issuable
).
present?
.issuable-form-select-holder
.issuable-form-select-holder
=
f
.
select
(
:milestone_id
,
milestone_options
(
issuable
),
=
users_select_tag
(
"
#{
issuable
.
class
.
model_name
.
param_key
}
[assignee_id]"
,
{
include_blank:
true
},
{
class:
'select2'
,
data:
{
placeholder:
'Select milestone'
}
})
placeholder:
'Select assignee'
,
class:
'custom-form-control'
,
null_user:
true
,
-
else
selected:
issuable
.
assignee_id
,
project:
@target_project
||
@project
,
.prepend-top-10
first_user:
true
,
current_user:
true
,
include_blank:
true
)
%span
.light
No open milestones available.
%br
=
link_to
'Assign to me'
,
'#'
,
class:
'assign-to-me-link prepend-top-5 inline'
-
if
can?
current_user
,
:admin_milestone
,
issuable
.
project
.form-group.issue-milestone
=
link_to
'Create new milestone'
,
new_namespace_project_milestone_path
(
issuable
.
project
.
namespace
,
issuable
.
project
),
target: :blank
=
f
.
label
:milestone_id
,
"Milestone"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
.form-group
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
-
has_labels
=
issuable
.
project
.
labels
.
any?
-
if
milestone_options
(
issuable
).
present?
=
f
.
label
:label_ids
,
"Labels"
,
class:
'control-label'
.issuable-form-select-holder
.col-sm-10
{
class:
(
'issuable-form-padding-top'
if
!
has_labels
)
}
=
f
.
select
(
:milestone_id
,
milestone_options
(
issuable
),
-
if
has_labels
{
include_blank:
true
},
{
class:
'select2'
,
data:
{
placeholder:
'Select milestone'
}
})
.issuable-form-select-holder
-
else
=
f
.
collection_select
:label_ids
,
issuable
.
project
.
labels
.
all
,
:id
,
:name
,
.prepend-top-10
{
selected:
issuable
.
label_ids
},
multiple:
true
,
class:
'select2'
,
data:
{
placeholder:
"Select labels"
}
%span
.light
No open milestones available.
-
else
-
if
can?
current_user
,
:admin_milestone
,
issuable
.
project
%span
.light
No labels yet.
%br
=
link_to
'Create new milestone'
,
new_namespace_project_milestone_path
(
issuable
.
project
.
namespace
,
issuable
.
project
),
target: :blank
,
class:
"prepend-top-5 inline"
-
if
can?
current_user
,
:admin_label
,
issuable
.
project
.form-group
=
link_to
'Create new label'
,
new_namespace_project_label_path
(
issuable
.
project
.
namespace
,
issuable
.
project
),
target: :blank
-
has_labels
=
issuable
.
project
.
labels
.
any?
=
f
.
label
:label_ids
,
"Labels"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
.col-sm-10
{
class:
"#{"
col
-
lg
-
8
" if has_due_date} #{'issuable-form-padding-top' if !has_labels}"
}
-
if
has_labels
.issuable-form-select-holder
=
f
.
collection_select
:label_ids
,
issuable
.
project
.
labels
.
all
,
:id
,
:name
,
{
selected:
issuable
.
label_ids
},
multiple:
true
,
class:
'select2'
,
data:
{
placeholder:
"Select labels"
}
-
else
%span
.light
No labels yet.
-
if
can?
current_user
,
:admin_label
,
issuable
.
project
%br
=
link_to
'Create new label'
,
new_namespace_project_label_path
(
issuable
.
project
.
namespace
,
issuable
.
project
),
target: :blank
,
class:
"prepend-top-5 inline"
-
if
issuable
.
has_attribute?
(
:due_date
)
.col-lg-6
.form-group
=
f
.
label
:due_date
,
"Due date"
,
class:
"control-label"
=
f
.
hidden_field
:due_date
,
id:
"issuable-due-date"
.col-sm-10
.datepicker
-
if
issuable
.
can_move?
(
current_user
)
-
if
issuable
.
can_move?
(
current_user
)
%hr
%hr
...
...
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