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
16ba5eb4
Commit
16ba5eb4
authored
Mar 11, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates sidebar milestone to use new dropdowns
parent
63c8a05b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
16 deletions
+44
-16
app/assets/javascripts/api.js.coffee
app/assets/javascripts/api.js.coffee
+21
-0
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+2
-1
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+12
-9
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-0
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+1
-1
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+3
-1
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+3
-3
config/environments/development.rb
config/environments/development.rb
+1
-1
No files found.
app/assets/javascripts/api.js.coffee
View file @
16ba5eb4
...
@@ -5,6 +5,27 @@
...
@@ -5,6 +5,27 @@
group_projects_path
:
"/api/:version/groups/:id/projects.json"
group_projects_path
:
"/api/:version/groups/:id/projects.json"
projects_path
:
"/api/:version/projects.json"
projects_path
:
"/api/:version/projects.json"
labels_path
:
"/api/:version/projects/:id/labels"
labels_path
:
"/api/:version/projects/:id/labels"
issues_paths
:
update
:
"/api/:version/projects/:id/issues/:issue_id"
merge_request_path
:
"/api/:version/issues/:id.json"
issues
:
update
:
(
project_id
,
issue_id
,
data
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
issues_paths
.
update
)
url
=
url
.
replace
(
":id"
,
project_id
)
.
replace
(
":issue_id"
,
issue_id
)
if
not
data
?
data
=
{}
data
.
private_token
=
gon
.
api_token
$
.
ajax
(
url
:
url
type
:
"PUT"
data
:
data
dataType
:
"json"
).
done
(
issue
)
->
if
callback
?
callback
(
issue
)
group
:
(
group_id
,
callback
)
->
group
:
(
group_id
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
group_path
)
url
=
Api
.
buildUrl
(
Api
.
group_path
)
...
...
app/assets/javascripts/gl_dropdown.js.coffee
View file @
16ba5eb4
...
@@ -143,10 +143,11 @@ class GitLabDropdown
...
@@ -143,10 +143,11 @@ class GitLabDropdown
selector
=
".dropdown-page-one .dropdown-content a"
selector
=
".dropdown-page-one .dropdown-content a"
@
dropdown
.
on
"click"
,
selector
,
(
e
)
->
@
dropdown
.
on
"click"
,
selector
,
(
e
)
->
e
.
preventDefault
()
self
.
rowClicked
$
(
@
)
self
.
rowClicked
$
(
@
)
if
self
.
options
.
clicked
if
self
.
options
.
clicked
self
.
options
.
clicked
(
)
self
.
options
.
clicked
.
call
(
@
,
e
)
toggleLoading
:
->
toggleLoading
:
->
$
(
'.dropdown-menu'
,
@
dropdown
).
toggleClass
LOADING_CLASS
$
(
'.dropdown-menu'
,
@
dropdown
).
toggleClass
LOADING_CLASS
...
...
app/assets/javascripts/milestone_select.js.coffee
View file @
16ba5eb4
class
@
MilestoneSelect
class
@
MilestoneSelect
constructor
:
->
constructor
:
(
@
opts
)
->
opts
=
@
opts
$
(
'.js-milestone-select'
).
each
(
i
,
dropdown
)
->
$
(
'.js-milestone-select'
).
each
(
i
,
dropdown
)
->
$dropdown
=
$
(
dropdown
)
$dropdown
=
$
(
dropdown
)
projectId
=
$dropdown
.
data
(
'project-id'
)
projectId
=
$dropdown
.
data
(
'project-id'
)
...
@@ -9,6 +10,7 @@ class @MilestoneSelect
...
@@ -9,6 +10,7 @@ class @MilestoneSelect
showAny
=
$dropdown
.
data
(
'show-any'
)
showAny
=
$dropdown
.
data
(
'show-any'
)
useId
=
$dropdown
.
data
(
'use-id'
)
useId
=
$dropdown
.
data
(
'use-id'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
issuableId
=
$dropdown
.
data
(
'issuable-id'
)
$dropdown
.
glDropdown
(
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
data
:
(
term
,
callback
)
->
...
@@ -53,13 +55,14 @@ class @MilestoneSelect
...
@@ -53,13 +55,14 @@ class @MilestoneSelect
milestone
.
id
milestone
.
id
isSelected
:
(
milestone
)
->
isSelected
:
(
milestone
)
->
milestone
.
title
is
selectedMilestone
milestone
.
title
is
selectedMilestone
clicked
:
->
page
=
$
(
'body'
).
data
'page'
isIssueIndex
=
page
is
'projects:issues:index'
isMRIndex
=
page
is
page
is
'projects:merge_requests:index'
if
$dropdown
.
hasClass
(
'js-filter-submit'
)
and
(
isIssueIndex
or
isMRIndex
)
clicked
:
(
e
)
->
Issues
.
filterResults
$dropdown
.
closest
(
'form'
)
if
$
(
dropdown
).
hasClass
"js-filter-submit"
&&
opts
.
submitForm
else
if
$dropdown
.
hasClass
'js-filter-submit'
$
(
dropdown
).
parents
(
'form'
).
submit
()
$dropdown
.
closest
(
'form'
).
submit
()
else
milestoneVal
=
$
(
@
)
.
closest
(
'.selectbox'
)
.
find
(
'input[type="hidden"]'
)
.
val
()
Api
.
issues
.
update
(
projectId
,
issuableId
,
milestone_id
:
milestoneVal
,
(
data
)
=>
console
.
log
'data'
,
data
)
)
)
app/controllers/projects/issues_controller.rb
View file @
16ba5eb4
...
@@ -58,6 +58,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -58,6 +58,7 @@ class Projects::IssuesController < Projects::ApplicationController
end
end
def
edit
def
edit
puts
params
respond_with
(
@issue
)
respond_with
(
@issue
)
end
end
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
16ba5eb4
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)}
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)}
=
render
"projects/merge_requests/show/mr_title"
=
render
"projects/merge_requests/show/mr_title"
.merge-request-details.issuable-details
.merge-request-details.issuable-details
{
data:
{
id:
@merge_request
.
project
.
id
}}
=
render
"projects/merge_requests/show/mr_box"
=
render
"projects/merge_requests/show/mr_box"
.append-bottom-default.mr-source-target.prepend-top-default
.append-bottom-default.mr-source-target.prepend-top-default
-
if
@merge_request
.
open?
-
if
@merge_request
.
open?
...
...
app/views/shared/issuable/_filter.html.haml
View file @
16ba5eb4
...
@@ -55,7 +55,9 @@
...
@@ -55,7 +55,9 @@
:javascript
:javascript
new
UsersSelect
();
new
UsersSelect
();
new
LabelsSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
MilestoneSelect
({
submitForm
:
true
});
new
IssueStatusSelect
();
new
IssueStatusSelect
();
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
16ba5eb4
...
@@ -62,10 +62,9 @@
...
@@ -62,10 +62,9 @@
=
issuable
.
milestone
.
title
=
issuable
.
milestone
.
title
-
else
-
else
.light
None
.light
None
.selectbox.hide-collapsed
.selectbox.hide-collapsed
=
f
.
select
(
:milestone_id
,
milestone_options
(
issuable
),
{
include_blank:
true
},
{
class:
'select2 select2-compact js-select2 js-milestone'
,
data:
{
placeholder:
'Select milestone'
}})
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"milestone_id"
,
project_id:
@project
.
id
,
issuable_id:
issuable
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
),
use_id:
true
}})
=
hidden_field_tag
:issuable_context
=
f
.
submit
class:
'btn hide'
-
if
issuable
.
project
.
labels
.
any?
-
if
issuable
.
project
.
labels
.
any?
.block.labels
.block.labels
...
@@ -117,4 +116,5 @@
...
@@ -117,4 +116,5 @@
:javascript
:javascript
new
Subscription
(
'
.subscription
'
);
new
Subscription
(
'
.subscription
'
);
new
MilestoneSelect
();
new
IssuableContext
();
new
IssuableContext
();
config/environments/development.rb
View file @
16ba5eb4
...
@@ -36,7 +36,7 @@ Rails.application.configure do
...
@@ -36,7 +36,7 @@ Rails.application.configure do
# For having correct urls in mails
# For having correct urls in mails
config
.
action_mailer
.
default_url_options
=
{
host:
'localhost'
,
port:
3000
}
config
.
action_mailer
.
default_url_options
=
{
host:
'localhost'
,
port:
3000
}
# Open sent mails in browser
# Open sent mails in browser
config
.
action_mailer
.
delivery_method
=
:
letter_opener
config
.
action_mailer
.
delivery_method
=
:
test
# Don't make a mess when bootstrapping a development environment
# Don't make a mess when bootstrapping a development environment
config
.
action_mailer
.
perform_deliveries
=
(
ENV
[
'BOOTSTRAP'
]
!=
'1'
)
config
.
action_mailer
.
perform_deliveries
=
(
ENV
[
'BOOTSTRAP'
]
!=
'1'
)
...
...
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