mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-30 04:35:28 -04:00
Rename zombie to super_late
This commit is contained in:
@@ -115,12 +115,12 @@ p.stats
|
||||
.progress
|
||||
border-radius: 0
|
||||
|
||||
.badge-zombie
|
||||
.badge-super-late
|
||||
background-color: $red
|
||||
.badge-harvest
|
||||
background-color: $blue
|
||||
|
||||
.planting-zombie
|
||||
.planting-super-late
|
||||
.planting-predicted-finished
|
||||
background-color: $beige
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ module PlantingsHelper
|
||||
classes << 'planting-finished' if planting.finished?
|
||||
classes << 'planting-harvest-time' if planting.harvest_time?
|
||||
classes << 'planting-predicted-finished' if planting.should_be_finished?
|
||||
classes << 'planting-zombie' if planting.zombie?
|
||||
classes << 'planting-super-late' if planting.super_late?
|
||||
classes.join(' ')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,7 +58,8 @@ module PredictPlanting
|
||||
crop.annual? && planted_at.present? && finish_predicted_at.present?
|
||||
end
|
||||
|
||||
def zombie?
|
||||
# Planting has live more then 90 days past predicted finish
|
||||
def super_late?
|
||||
should_be_finished? &&
|
||||
(finish_predicted_at + 90.days) < Time.zone.today
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Finish times
|
||||
- if planting.finish_is_predicatable?
|
||||
- if planting.zombie?
|
||||
%span.badge.badge-zombie= t('.zombie')
|
||||
- if planting.super_late?
|
||||
%span.badge.badge-super late= t('.super late')
|
||||
- if can? :edit, planting
|
||||
= render 'shared/buttons/finish_planting', planting: planting
|
||||
- elsif !planting.should_be_finished?
|
||||
@@ -10,7 +10,7 @@
|
||||
= t('.days_until_finished')
|
||||
|
||||
// Harvest times
|
||||
- unless planting.zombie?
|
||||
- unless planting.super_late?
|
||||
- if planting.harvest_time?
|
||||
%span.badge.badge-harvest= t('.harvesting_now')
|
||||
- elsif planting.before_harvest_time?
|
||||
|
||||
@@ -195,7 +195,7 @@ en:
|
||||
owner_plantings: "%{owner} plantings"
|
||||
string: "%{crop} planting in %{garden} by %{owner}"
|
||||
badges:
|
||||
zombie: zombie
|
||||
super late: super late
|
||||
sharedbuttonsfinish_planting: shared/buttons/finish_planting
|
||||
days_until_finished: days until finished
|
||||
harvesting_now: harvesting now
|
||||
|
||||
@@ -120,13 +120,13 @@ feature "Gardens#index", :js do
|
||||
it { expect(page).not_to have_text 'days until harvest' }
|
||||
end
|
||||
|
||||
describe 'zombie' do
|
||||
describe 'super late' do
|
||||
let!(:planting) do
|
||||
FactoryBot.create :planting,
|
||||
crop: crop, owner: member,
|
||||
garden: garden, planted_at: 260.days.ago
|
||||
end
|
||||
it { expect(page).to have_text 'zombie' }
|
||||
it { expect(page).to have_text 'super late' }
|
||||
it { expect(page).not_to have_text 'harvesting now' }
|
||||
it { expect(page).not_to have_text 'days until harvest' }
|
||||
it { expect(page).not_to have_text 'days until finished' }
|
||||
|
||||
Reference in New Issue
Block a user