diff --git a/app/views/plantings/_progress.html.haml b/app/views/plantings/_progress.html.haml index 521561152..260082736 100644 --- a/app/views/plantings/_progress.html.haml +++ b/app/views/plantings/_progress.html.haml @@ -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 diff --git a/app/views/plantings/_progress_bar.html.haml b/app/views/plantings/_progress_bar.html.haml index 834112976..59d4f2f37 100644 --- a/app/views/plantings/_progress_bar.html.haml +++ b/app/views/plantings/_progress_bar.html.haml @@ -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