diff --git a/.gitignore b/.gitignore index 04664af..584351f 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,9 @@ !/tmp/pids/ !/tmp/pids/.keep +*.xlsx +*.csv + .rubocop.yml # Ignore storage (uploaded files in development and any SQLite databases). diff --git a/Gemfile.lock b/Gemfile.lock index d467b22..5e6a414 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,7 +117,7 @@ GEM ffi (1.17.4-x86_64-darwin) ffi (1.17.4-x86_64-linux-gnu) ffi (1.17.4-x86_64-linux-musl) - globalid (1.3.0) + globalid (1.4.0) activesupport (>= 6.1) htmlentities (4.4.2) i18n (1.15.2) @@ -138,7 +138,7 @@ GEM jbuilder (2.15.1) actionview (>= 7.0.0) activesupport (>= 7.0.0) - json (2.19.9) + json (2.20.0) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -358,7 +358,7 @@ GEM actionview (>= 8.0.0) bindex (>= 0.4.0) railties (>= 8.0.0) - websocket-driver (0.8.1) + websocket-driver (0.8.2) base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -449,7 +449,7 @@ CHECKSUMS ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496 ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e - globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11 + globalid (1.4.0) sha256=037f12fbf1d9d7a014d501c2d5c77356fd4ddd96d7a7991d6700bba96706f427 htmlentities (4.4.2) sha256=bbafbdf69f2eca9262be4efef7e43e6a1de54c95eb600f26984f71d2fe96c5c3 i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5 image_processing (1.14.0) sha256=754cc169c9c262980889bec6bfd325ed1dafad34f85242b5a07b60af004742fb @@ -457,7 +457,7 @@ CHECKSUMS io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3 jbuilder (2.15.1) sha256=2430bec28fb0cebacb5875b1009cf9d8bc3c303ccb810c4c8b062a4b51457637 - json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a + json (2.20.0) sha256=9362bc6e55a952b056abf9167cf053358181c904cb70cd6eee0808ea830fc32b kaminari (1.2.2) sha256=c4076ff9adccc6109408333f87b5c4abbda5e39dc464bd4c66d06d9f73442a3e kaminari-actionview (1.2.2) sha256=1330f6fc8b59a4a4ef6a549ff8a224797289ebf7a3a503e8c1652535287cc909 kaminari-activerecord (1.2.2) sha256=0dd3a67bab356a356f36b3b7236bcb81cef313095365befe8e98057dd2472430 @@ -551,7 +551,7 @@ CHECKSUMS uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844 web-console (4.3.0) sha256=e13b71301cdfc2093f155b5aa3a622db80b4672d1f2f713119cc7ec7ac6a6da4 - websocket-driver (0.8.1) sha256=5ab238238ce230e5d4b262d2be39624c867914eab99171dc4952b58b577c2d96 + websocket-driver (0.8.2) sha256=97c556b019bf3410b4961002ac501621e9322d3f8a7bc02161a09301cc4c4146 websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241 zeitwerk (2.8.2) sha256=7212a61311083c604184b1ea2574b9aa05cd14f855a0841c06985cabe9181d12 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 56a389f..8249a2e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -131,7 +131,6 @@ body { .debug-score { position: fixed; - display: none; font-size: var(--fs-s); right: 0; top: 0; @@ -727,9 +726,7 @@ dialog::backdrop { gap: 2rem; & svg { - align-self: stretch; - width: 100%; - height: auto; + align-self: center; } & > div { diff --git a/app/helpers/game_helper.rb b/app/helpers/game_helper.rb index 2cc2c87..e6b205d 100644 --- a/app/helpers/game_helper.rb +++ b/app/helpers/game_helper.rb @@ -84,8 +84,9 @@ module GameHelper def impact_message(player, category) - if category == :income && player.last_save_answer_id.present? - return t("game.results.income.early_exit") + if (answer_id = player.last_save_answer_id) + tone = last_save_result_state(answer_id) == :compost ? :positive : :negative + return t("game.results.#{category}.early_exit.#{tone}") end t("game.results.#{category}.#{impact_tone(player, category)}") diff --git a/app/models/player.rb b/app/models/player.rb index 8f9d12e..4c6ca75 100644 --- a/app/models/player.rb +++ b/app/models/player.rb @@ -59,10 +59,7 @@ class Player < ApplicationRecord private - def stage_data(stage) progress[stage.to_s] ||= {} end - - end diff --git a/config/locales/en.yml b/config/locales/en.yml index 3dafbf4..264b054 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -55,30 +55,38 @@ en: what_many_dont_know: Grab some bonus info food_waste: - label: Food Waste - positive: Your choices helped prevent food waste and kept the tomato useful for longer. - neutral: Some choices helped reduce food waste, while others still created risks. - negative: Some choices increased the risk of the tomato going to waste. + label: Food waste + positive: You made all the right moves to prevent the tomato from becoming food waste. + neutral: You made some great moves to prevent the tomato from becoming food waste. + negative: You made some moves that increased the risk of the tomato becoming food waste. + early_exit: + positive: Like one-third of all food, your tomato ended up as food waste. + negative: Like one-third of all food, your tomato ended up as food waste. learn_more: - Fresh produce, like tomatoes, can go to waste while it grows. But the risk of food waste is also big after harvest, for example during storage and transport. - - Here, even simple solutions like stackable crates can help reduce food waste, because you avoid the food getting squashed and damaged on its way to the market. Solar-powered cooling solutions can also help, as they can prevent food from spoiling in the heat. + - Here, even simple solutions like stackable crates can help reduce food waste by preventing food from being squashed and damaged on its way to the market. Solar-powered cooling solutions can also help prevent food from spoiling in the heat. emissions: label: Greenhouse gas emissions - positive: Your choices helped reduce greenhouse gas emissions. - neutral: Some choices lowered greenhouse gas emissions, while others still added climate impact. - negative: Some choices increased greenhouse gas emissions. + positive: You succeeded in lowering greenhouse gas emissions! + neutral: In some places, you lowered greenhouse gas emissions, while you increased them a bit in others. + negative: As you worked to save the tomato, some actions increased greenhouse gas emissions. + early_exit: + positive: You helped reduce greenhouse gas emissions simply by composting your tomato! + negative: By sending the tomato to a landfill, you increased greenhouse gas emissions. Composting it would have been a better option. learn_more: - Food waste itself can cause greenhouse gases when it rots in a landfill. That’s why it’s key to avoid food waste in the first place. When food spoils or isn’t safe to eat, composting it is a more climate-friendly option. Maybe you’re already doing this at home or in your local community! - - Greenhouse gases can also come from using things like chemical fertiliser, as well as pumps, vans, and trucks that run on diesel and gasoline. So, ensuring farmers have access to renewable energy, electric transport and training in eco-friendly farming can also help lower greenhouse gas emissions a lot. + - Greenhouse gases can also come from using things like chemical fertiliser, as well as pumps, vans, and trucks that run on diesel and gasoline. So, ensuring farmers have access to renewable energy, electric transport, and training in eco-friendly farming can also help lower emissions a lot. income: label: Income - positive: Your choices helped farmers earn more from their crops. - neutral: Some choices improved income opportunities, but not all decisions supported farmers. - negative: Some choices made it harder for farmers to earn income from the tomato. - early_exit: You didn’t get to sell your tomato. + positive: You sold your tomato locally, which means you earned some money! + neutral: You sold your tomato locally, which means you earned some money! + negative: It wasn't easy, but you managed to sell your tomato, which means you earned some money. + early_exit: + positive: You didn't earn any money for your tomato – and even if your tomato hadn't gone to waste, selling it could have been difficult. + negative: You didn't earn any money for your tomato – and even if your tomato hadn't gone to waste, selling it could have been difficult. learn_more: - - Finding a place to sell the things you grow isn’t always easy for small farmers. Setting up produce hubs can help, because then farmers can get together, bulk their crops and sell at a better price. Helping farmers connect with local shops and supermarkets is also a good solution. That means shorter travel distances and a lower risk of food waste and pollution. - - Another thing to keep in mind is that small farmers’ incomes are affected by a lot of things. Money for fertiliser and water is not always available, which can make it harder to grow crops and earn money. That’s why access to a small business loan can help. + - Finding a place to sell the things you grow isn't always easy for smallholder farmers. Setting up produce hubs can help, as farmers can get together, bulk their crops, and sell at a better price. Helping farmers connect with local shops and supermarkets is also a good solution. That means shorter travel distances and a lower risk of food waste and pollution. + - Another thing to keep in mind is that smallholder farmers' incomes are affected by a lot of things. Money for fertiliser and water is not always available, which can make it harder to grow crops and earn money. That's why access to a small business loan can help. countries: au: Australia