mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-01 05:01:04 -05:00
Updated progress bar to use new predictions
This commit is contained in:
@@ -2,18 +2,13 @@
|
||||
- if show_explanation == true
|
||||
Progress: 0% - not planted yet
|
||||
= render "plantings/progress_bar", status: "not planted", progress: 0
|
||||
|
||||
- elsif planting.finished?
|
||||
- if show_explanation == true
|
||||
Progress: 100%
|
||||
= render "plantings/progress_bar", status: 'finished', progress: 100
|
||||
|
||||
- elsif planting.days_before_maturity.nil?
|
||||
- elsif planting.finish_predicted_at.nil?
|
||||
- if show_explanation == true
|
||||
Progress: Not calculated, days before maturity unknown
|
||||
Progress: Not enough data
|
||||
= render "plantings/progress_bar", status: "unknown", progress: nil
|
||||
|
||||
- else
|
||||
- if show_explanation == true
|
||||
Progress: #{planting.percentage_grown}%
|
||||
= render "plantings/progress_bar", status: 'growing', progress: planting.percentage_grown
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
-# haml-lint:disable InlineStyles
|
||||
%div{ class: "progress-bar progress-bar-#{status}", role: "progressbar", style: "width: #{progress}%" }
|
||||
- if progress >= 30
|
||||
#{progress}%
|
||||
#{sprintf '%.2f', progress}%
|
||||
- if progress < 30
|
||||
#{progress}%
|
||||
#{sprintf '%.2f', progress}%
|
||||
-# haml-lint:enable InlineStyles
|
||||
|
||||
Reference in New Issue
Block a user