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
1162f8d7
Commit
1162f8d7
authored
Jan 26, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add elpased time.
parent
4e8266e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
app/assets/stylesheets/pages/milestone.scss
app/assets/stylesheets/pages/milestone.scss
+4
-0
app/models/milestone.rb
app/models/milestone.rb
+9
-0
app/views/projects/milestones/show.html.haml
app/views/projects/milestones/show.html.haml
+3
-0
No files found.
app/assets/stylesheets/pages/milestone.scss
View file @
1162f8d7
...
...
@@ -11,3 +11,7 @@ li.milestone {
height
:
6px
;
}
}
.time-elapsed
{
color
:
#F14539
;
}
app/models/milestone.rb
View file @
1162f8d7
...
...
@@ -110,6 +110,15 @@ class Milestone < ActiveRecord::Base
0
end
def
percent_time_used
return
100
if
expired?
duration
=
((
created_at
-
due_date
.
to_datetime
)
/
1
.
day
)
days_elapsed
=
((
created_at
-
Time
.
now
)
/
1
.
day
)
((
days_elapsed
.
to_f
/
duration
)
*
100
).
floor
end
def
expires_at
if
due_date
if
due_date
.
past?
...
...
app/views/projects/milestones/show.html.haml
View file @
1162f8d7
...
...
@@ -57,6 +57,9 @@
closed
%strong
==
#{
@milestone
.
percent_complete
}
%
complete
%span
.time-elapsed
%strong
==
#{
@milestone
.
percent_time_used
}
%
time elapsed
%span
.pull-right
=
@milestone
.
expires_at
=
milestone_progress_bar
(
@milestone
)
...
...
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