BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
milestone.scss
app/assets/stylesheets/pages/milestone.scss
+4
-0
milestone.rb
app/models/milestone.rb
+9
-0
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