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 ...@@ -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
...@@ -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|
......
...@@ -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
......
...@@ -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|
......
...@@ -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
......
...@@ -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}%;"}
...@@ -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
......
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