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
5cae36d1
Commit
5cae36d1
authored
Jun 03, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show milestone remaining tooltip in right sidebar.
parent
91937d5b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
9 deletions
+27
-9
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+13
-2
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+10
-5
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+4
-2
No files found.
app/assets/javascripts/milestone_select.js.coffee
View file @
5cae36d1
...
@@ -24,11 +24,21 @@ class @MilestoneSelect
...
@@ -24,11 +24,21 @@ class @MilestoneSelect
if
issueUpdateURL
if
issueUpdateURL
milestoneLinkTemplate
=
_
.
template
(
milestoneLinkTemplate
=
_
.
template
(
'<a href="/<%= namespace %>/<%= path %>/milestones/<%= iid %>"><%= _.escape(title) %></a>'
'<a href="/<%= namespace %>/<%= path %>/milestones/<%= iid %>">
<span class="has-tooltip" data-container="body" data-original-title="<%= remaining %>">
<%= _.escape(title) %>
</span>
</a>'
)
)
milestoneLinkNoneTemplate
=
'<div class="light">None</div>'
milestoneLinkNoneTemplate
=
'<div class="light">None</div>'
collapsedSidebarLabelTemplate
=
_
.
template
(
'<span class="has-tooltip" data-container="body" data-original-title="<%= remaining %>" data-placement="left">
<%= _.escape(title) %>
</span>'
)
$dropdown
.
glDropdown
(
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
data
:
(
term
,
callback
)
->
$
.
ajax
(
$
.
ajax
(
...
@@ -122,8 +132,9 @@ class @MilestoneSelect
...
@@ -122,8 +132,9 @@ class @MilestoneSelect
if
data
.
milestone
?
if
data
.
milestone
?
data
.
milestone
.
namespace
=
_this
.
currentProject
.
namespace
data
.
milestone
.
namespace
=
_this
.
currentProject
.
namespace
data
.
milestone
.
path
=
_this
.
currentProject
.
path
data
.
milestone
.
path
=
_this
.
currentProject
.
path
data
.
milestone
.
remaining
=
$
.
timefor
data
.
milestone
.
due_date
$value
.
html
(
milestoneLinkTemplate
(
data
.
milestone
))
$value
.
html
(
milestoneLinkTemplate
(
data
.
milestone
))
$sidebarCollapsedValue
.
find
(
'span'
).
text
(
data
.
milestone
.
title
)
$sidebarCollapsedValue
.
find
(
'span'
).
html
(
collapsedSidebarLabelTemplate
(
data
.
milestone
)
)
else
else
$value
.
html
(
milestoneLinkNoneTemplate
)
$value
.
html
(
milestoneLinkNoneTemplate
)
$sidebarCollapsedValue
.
find
(
'span'
).
text
(
'No'
)
$sidebarCollapsedValue
.
find
(
'span'
).
text
(
'No'
)
...
...
app/helpers/milestones_helper.rb
View file @
5cae36d1
...
@@ -54,13 +54,18 @@ module MilestonesHelper
...
@@ -54,13 +54,18 @@ module MilestonesHelper
end
end
end
end
def
milestone_remaining_days
(
milestone
)
def
milestone_remaining_days
(
milestone
,
withContentTag
=
true
)
if
milestone
.
expired?
if
milestone
.
expired?
content_tag
(
:strong
,
'expired'
)
if
withContentTag
then
content_tag
(
:strong
,
'expired'
)
else
'expired'
end
elsif
milestone
.
due_date
elsif
milestone
.
due_date
days
=
milestone
.
remaining_days
days
=
milestone
.
remaining_days
if
withContentTag
content
=
content_tag
(
:strong
,
days
)
content
=
content_tag
(
:strong
,
days
)
content
<<
"
#{
'day'
.
pluralize
(
days
)
}
remaining"
content
<<
"
#{
'day'
.
pluralize
(
days
)
}
remaining"
else
"
#{
days
}
#{
'day'
.
pluralize
(
days
)
}
remaining"
end
end
end
end
end
end
end
app/views/shared/issuable/_sidebar.html.haml
View file @
5cae36d1
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
=
icon
(
'clock-o'
)
=
icon
(
'clock-o'
)
%span
%span
-
if
issuable
.
milestone
-
if
issuable
.
milestone
%span
.has-tooltip
{
"data-container"
=>
"body"
,
"data-placement"
=>
"left"
,
"data-original-title"
=>
milestone_remaining_days
(
issuable
.
milestone
,
false
)}
=
issuable
.
milestone
.
title
=
issuable
.
milestone
.
title
-
else
-
else
None
None
...
@@ -67,6 +68,7 @@
...
@@ -67,6 +68,7 @@
.value.bold.hide-collapsed
.value.bold.hide-collapsed
-
if
issuable
.
milestone
-
if
issuable
.
milestone
=
link_to
namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
issuable
.
milestone
)
do
=
link_to
namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
issuable
.
milestone
)
do
%span
.has-tooltip
{
"data-container"
=>
"body"
,
"data-original-title"
=>
milestone_remaining_days
(
issuable
.
milestone
,
false
)}
=
issuable
.
milestone
.
title
=
issuable
.
milestone
.
title
-
else
-
else
.light
None
.light
None
...
...
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