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
c6b24211
Commit
c6b24211
authored
Mar 09, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render milestone progress with one helper method
parent
e89ffd54
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
12 deletions
+17
-12
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+11
-0
app/views/dashboard/milestones/index.html.haml
app/views/dashboard/milestones/index.html.haml
+1
-2
app/views/dashboard/milestones/show.html.haml
app/views/dashboard/milestones/show.html.haml
+1
-2
app/views/groups/milestones/index.html.haml
app/views/groups/milestones/index.html.haml
+1
-2
app/views/groups/milestones/show.html.haml
app/views/groups/milestones/show.html.haml
+1
-2
app/views/projects/milestones/_milestone.html.haml
app/views/projects/milestones/_milestone.html.haml
+1
-2
app/views/projects/milestones/show.html.haml
app/views/projects/milestones/show.html.haml
+1
-2
No files found.
app/helpers/milestones_helper.rb
View file @
c6b24211
...
@@ -8,4 +8,15 @@ module MilestonesHelper
...
@@ -8,4 +8,15 @@ module MilestonesHelper
dashboard_milestones_path
(
opts
)
dashboard_milestones_path
(
opts
)
end
end
end
end
def
milestone_progress_bar
(
milestone
)
options
=
{
class:
'progress-bar progress-bar-success'
,
style:
"width:
#{
milestone
.
percent_complete
}
%;"
}
content_tag
:div
,
class:
'progress'
do
content_tag
:div
,
nil
,
options
end
end
end
end
app/views/dashboard/milestones/index.html.haml
View file @
c6b24211
...
@@ -28,8 +28,7 @@
...
@@ -28,8 +28,7 @@
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
%span
.light
#{
milestone
.
percent_complete
}
% complete
%span
.light
#{
milestone
.
percent_complete
}
% complete
.progress.progress-info
=
milestone_progress_bar
(
milestone
)
.progress-bar
{
style:
"width: #{milestone.percent_complete}%;"
}
%div
%div
%br
%br
-
milestone
.
milestones
.
each
do
|
milestone
|
-
milestone
.
milestones
.
each
do
|
milestone
|
...
...
app/views/dashboard/milestones/show.html.haml
View file @
c6b24211
...
@@ -39,8 +39,7 @@
...
@@ -39,8 +39,7 @@
#{
@dashboard_milestone
.
closed_items_count
}
closed
#{
@dashboard_milestone
.
closed_items_count
}
closed
–
–
#{
@dashboard_milestone
.
open_items_count
}
open
#{
@dashboard_milestone
.
open_items_count
}
open
.progress.progress-info
=
milestone_progress_bar
(
@dashboard_milestone
)
.progress-bar
{
style:
"width: #{@dashboard_milestone.percent_complete}%;"
}
%ul
.nav.nav-tabs
%ul
.nav.nav-tabs
%li
.active
%li
.active
...
...
app/views/groups/milestones/index.html.haml
View file @
c6b24211
...
@@ -36,8 +36,7 @@
...
@@ -36,8 +36,7 @@
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
%span
.light
#{
milestone
.
percent_complete
}
% complete
%span
.light
#{
milestone
.
percent_complete
}
% complete
.progress.progress-info
=
milestone_progress_bar
(
milestone
)
.progress-bar
{
style:
"width: #{milestone.percent_complete}%;"
}
%div
%div
%br
%br
-
milestone
.
milestones
.
each
do
|
milestone
|
-
milestone
.
milestones
.
each
do
|
milestone
|
...
...
app/views/groups/milestones/show.html.haml
View file @
c6b24211
...
@@ -45,8 +45,7 @@
...
@@ -45,8 +45,7 @@
#{
@group_milestone
.
closed_items_count
}
closed
#{
@group_milestone
.
closed_items_count
}
closed
–
–
#{
@group_milestone
.
open_items_count
}
open
#{
@group_milestone
.
open_items_count
}
open
.progress.progress-info
=
milestone_progress_bar
(
@group_milestone
)
.progress-bar
{
style:
"width: #{@group_milestone.percent_complete}%;"
}
%ul
.nav.nav-tabs
%ul
.nav.nav-tabs
%li
.active
%li
.active
...
...
app/views/projects/milestones/_milestone.html.haml
View file @
c6b24211
...
@@ -23,5 +23,4 @@
...
@@ -23,5 +23,4 @@
=
pluralize
milestone
.
merge_requests
.
count
,
'Merge Request'
=
pluralize
milestone
.
merge_requests
.
count
,
'Merge Request'
%span
.light
#{
milestone
.
percent_complete
}
% complete
%span
.light
#{
milestone
.
percent_complete
}
% complete
.progress.progress-info
=
milestone_progress_bar
(
milestone
)
.progress-bar
{
style:
"width: #{milestone.percent_complete}%;"
}
app/views/projects/milestones/show.html.haml
View file @
c6b24211
...
@@ -43,8 +43,7 @@
...
@@ -43,8 +43,7 @@
%span
.light
#{
@milestone
.
percent_complete
}
% complete
%span
.light
#{
@milestone
.
percent_complete
}
% complete
%span
.pull-right
=
@milestone
.
expires_at
%span
.pull-right
=
@milestone
.
expires_at
.progress.progress-info
=
milestone_progress_bar
(
@milestone
)
.progress-bar
{
style:
"width: #{@milestone.percent_complete}%;"
}
%ul
.nav.nav-tabs
%ul
.nav.nav-tabs
...
...
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