Merge pull request #4167 from Growstuff/dev

Release67, take 3
This commit is contained in:
Daniel O'Connor
2025-08-30 01:16:01 +09:30
committed by GitHub
3 changed files with 6 additions and 6 deletions

View File

@@ -94,9 +94,9 @@ module PredictPlanting
private
def calculate_percentage_grown
return 0 if age_in_days < 0
return 0 if age_in_days.to_i < 0
percent = (age_in_days / expected_lifespan.to_f) * 100
percent = (age_in_days.to_f / expected_lifespan.to_f) * 100
(percent > 100 ? 100 : percent)
end
end

View File

@@ -21,7 +21,7 @@
- if planting.finish_is_predicatable?
.card.fact-card
%h3 Progress
- if planting.age_in_days < 0
- if planting.age_in_days.to_i < 0
%strong Planned
- else
%strong #{planting.age_in_days}/#{planting.expected_lifespan}
@@ -45,7 +45,7 @@
%h3 Growing
%strong= seedling_icon
%span
- if planting.age_in_days < 0
- if planting.age_in_days.to_i < 0
Planting planned
- else
Planting is still growing today

View File

@@ -39,10 +39,10 @@
- elsif @planting.percentage_grown.present?
#{@planting.percentage_grown.to_i}%
- if @planting.finish_is_predicatable?
- if @planting.age_in_days < 0
- if @planting.age_in_days.to_i < 0
%strong Planned
- else
%strong #{@planting.age_in_days}/#{@planting.expected_lifespan} days
%strong #{@planting.age_in_days.to_i}/#{@planting.expected_lifespan} days
= render 'timeline', planting: @planting
= render 'likes/likes', object: @planting