From b9091779d24bbbcad0c6514a5fc04af860100894 Mon Sep 17 00:00:00 2001 From: David Gay Date: Thu, 3 Jun 2021 09:23:59 -0400 Subject: Display amount of time until amenity on cooldown is usable again --- app/views/characters/hearth/index.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/views/characters/hearth/index.html.erb') diff --git a/app/views/characters/hearth/index.html.erb b/app/views/characters/hearth/index.html.erb index c063088..b8478f1 100644 --- a/app/views/characters/hearth/index.html.erb +++ b/app/views/characters/hearth/index.html.erb @@ -22,7 +22,13 @@ <% end %> <% end %> <% if built_amenity.usable? %> - <%= button_to "Use", hearth_amenity_use_path(built_amenity.hearth_amenity) %> + <% if built_amenity.on_cooldown? %> +
Will be filled again in + <%= distance_of_time_in_words_to_now(built_amenity.cooled_down_at) %>. +
+ <% else %> + <%= button_to "Use", hearth_amenity_use_path(built_amenity.hearth_amenity) %> + <% end %> <% end %> <% if built_amenity.hearth_amenity.gid == "loamspire" %> <%= link_to "Manage crops", character_hearth_loamspire_path, class: "btn btn-primary" %> -- cgit v1.2.3