From be894b1e82592253d24850661a66250f5d7fa964 Mon Sep 17 00:00:00 2001 From: gabrielbaldao Date: Wed, 16 Oct 2019 09:49:04 -0300 Subject: [PATCH] add info about corals in zone --- rails/app/views/zones/show.html.erb | 30 +++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/rails/app/views/zones/show.html.erb b/rails/app/views/zones/show.html.erb index ffde70e5..1a09431d 100644 --- a/rails/app/views/zones/show.html.erb +++ b/rails/app/views/zones/show.html.erb @@ -1,9 +1,27 @@

<%= notice %>

-

- <%= t('zone.attributes.name') %>: - <%= @zone.name %> -

+<% activity_log = NurseryTable.find_by(zone: @zone.id).restoration_activity_log_entries.all%> +
+
+ <%= t('zone.attributes.name') %>: + <%= @zone.name %> +
+
+ Corals added: + <%= activity_log.sum(:corals_added)%> +
+
+ Bleached corals: + <%= activity_log.sum(:bleached_corals)%> +
+
+ Dead Corals: + <%= activity_log.sum(:dead_corals)%> +
+
+ <%= link_to t('defaults.actions.edit'), edit_zone_path(@zone) %> | + <%= link_to t('defaults.actions.back'), zones_path %> +
+
+ -<%= link_to t('defaults.actions.edit'), edit_zone_path(@zone) %> | -<%= link_to t('defaults.actions.back'), zones_path %>