Commit c6b24211 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Render milestone progress with one helper method

parent e89ffd54
......@@ -8,4 +8,15 @@ module MilestonesHelper
dashboard_milestones_path(opts)
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
......@@ -28,8 +28,7 @@
= pluralize milestone.merge_requests_count, 'Merge Request'
 
%span.light #{milestone.percent_complete}% complete
.progress.progress-info
.progress-bar{style: "width: #{milestone.percent_complete}%;"}
= milestone_progress_bar(milestone)
%div
%br
- milestone.milestones.each do |milestone|
......
......@@ -39,8 +39,7 @@
#{@dashboard_milestone.closed_items_count} closed
–
#{@dashboard_milestone.open_items_count} open
.progress.progress-info
.progress-bar{style: "width: #{@dashboard_milestone.percent_complete}%;"}
= milestone_progress_bar(@dashboard_milestone)
%ul.nav.nav-tabs
%li.active
......
......@@ -36,8 +36,7 @@
= pluralize milestone.merge_requests_count, 'Merge Request'
 
%span.light #{milestone.percent_complete}% complete
.progress.progress-info
.progress-bar{style: "width: #{milestone.percent_complete}%;"}
= milestone_progress_bar(milestone)
%div
%br
- milestone.milestones.each do |milestone|
......
......@@ -45,8 +45,7 @@
#{@group_milestone.closed_items_count} closed
–
#{@group_milestone.open_items_count} open
.progress.progress-info
.progress-bar{style: "width: #{@group_milestone.percent_complete}%;"}
= milestone_progress_bar(@group_milestone)
%ul.nav.nav-tabs
%li.active
......
......@@ -23,5 +23,4 @@
= pluralize milestone.merge_requests.count, 'Merge Request'
 
%span.light #{milestone.percent_complete}% complete
.progress.progress-info
.progress-bar{style: "width: #{milestone.percent_complete}%;"}
= milestone_progress_bar(milestone)
......@@ -43,8 +43,7 @@
 
%span.light #{@milestone.percent_complete}% complete
%span.pull-right= @milestone.expires_at
.progress.progress-info
.progress-bar{style: "width: #{@milestone.percent_complete}%;"}
= milestone_progress_bar(@milestone)
%ul.nav.nav-tabs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment