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
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
Hide 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
if
issueUpdateURL
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>'
collapsedSidebarLabelTemplate
=
_
.
template
(
'<span class="has-tooltip" data-container="body" data-original-title="<%= remaining %>" data-placement="left">
<%= _.escape(title) %>
</span>'
)
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
$
.
ajax
(
...
...
@@ -122,8 +132,9 @@ class @MilestoneSelect
if
data
.
milestone
?
data
.
milestone
.
namespace
=
_this
.
currentProject
.
namespace
data
.
milestone
.
path
=
_this
.
currentProject
.
path
data
.
milestone
.
remaining
=
$
.
timefor
data
.
milestone
.
due_date
$value
.
html
(
milestoneLinkTemplate
(
data
.
milestone
))
$sidebarCollapsedValue
.
find
(
'span'
).
text
(
data
.
milestone
.
title
)
$sidebarCollapsedValue
.
find
(
'span'
).
html
(
collapsedSidebarLabelTemplate
(
data
.
milestone
)
)
else
$value
.
html
(
milestoneLinkNoneTemplate
)
$sidebarCollapsedValue
.
find
(
'span'
).
text
(
'No'
)
...
...
app/helpers/milestones_helper.rb
View file @
5cae36d1
...
...
@@ -54,13 +54,18 @@ module MilestonesHelper
end
end
def
milestone_remaining_days
(
milestone
)
def
milestone_remaining_days
(
milestone
,
withContentTag
=
true
)
if
milestone
.
expired?
content_tag
(
:strong
,
'expired'
)
if
withContentTag
then
content_tag
(
:strong
,
'expired'
)
else
'expired'
end
elsif
milestone
.
due_date
days
=
milestone
.
remaining_days
content
=
content_tag
(
:strong
,
days
)
content
<<
"
#{
'day'
.
pluralize
(
days
)
}
remaining"
days
=
milestone
.
remaining_days
if
withContentTag
content
=
content_tag
(
:strong
,
days
)
content
<<
"
#{
'day'
.
pluralize
(
days
)
}
remaining"
else
"
#{
days
}
#{
'day'
.
pluralize
(
days
)
}
remaining"
end
end
end
end
app/views/shared/issuable/_sidebar.html.haml
View file @
5cae36d1
...
...
@@ -56,7 +56,8 @@
=
icon
(
'clock-o'
)
%span
-
if
issuable
.
milestone
=
issuable
.
milestone
.
title
%span
.has-tooltip
{
"data-container"
=>
"body"
,
"data-placement"
=>
"left"
,
"data-original-title"
=>
milestone_remaining_days
(
issuable
.
milestone
,
false
)}
=
issuable
.
milestone
.
title
-
else
None
.title.hide-collapsed
...
...
@@ -67,7 +68,8 @@
.value.bold.hide-collapsed
-
if
issuable
.
milestone
=
link_to
namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
issuable
.
milestone
)
do
=
issuable
.
milestone
.
title
%span
.has-tooltip
{
"data-container"
=>
"body"
,
"data-original-title"
=>
milestone_remaining_days
(
issuable
.
milestone
,
false
)}
=
issuable
.
milestone
.
title
-
else
.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