<%= Region.label %>
<%= iconbutton_new new_region_path %>
<%= view_table_head_open %>
<%= view_table_row_open %>
<%= view_table_head_cell_span 2 %>
<%= view_table_head_cell (Region.human_attribute_name(:attiva)) %>
<%= view_table_head_cell ( link_to(Region.human_attribute_name(:region_type_id), region_types_path ) ) %>
<%= view_table_head_cell (Region.human_attribute_name(:descrizione)) %>
<%= view_table_head_cell (Region.human_attribute_name(:colore)) %>
<%= view_table_head_cell (Region.human_attribute_name(:captain_id)) %>
<%= view_table_head_cell ('Quanti nuclei attivi?') %>
<%= view_table_head_cell ('Quante persone?') %>
<%= view_table_head_cell ('Quanti Cittadini A?') %>
<%= view_table_row_close %>
<%= view_table_head_close %>
<%= view_table_body_open %>
<% @regions.each do |region| %>
<%= view_table_row_open %>
<%= view_table_cell ( iconbutton_view region) %>
<%= view_table_cell ( iconbutton_edit edit_region_path(region)) %>
<%#= view_table_cell ( iconbutton_delete region) %>
<%= view_table_cell ( check_box_tag :attiva, :attiva, region.attiva, disabled: true) %>
<%= view_table_cell ( region.region_type_id.present? ? link_to( muted(!region.attiva, region.region_type.descrizione), region_type_path(region.region_type_id) ) : nil ) %>
<%= view_table_cell ( link_to( muted(!region.attiva, region.descrizione), region_path(region.id) ) ) %>
<%= view_table_cell ( muted(!region.attiva, region.colore)) %>
<%= view_table_cell ( region.captain_id.present? ? link_to( muted(!region.attiva, region.captain.dh_person_name), person_path(region.captain_id) ) : nil ) %>
<%= view_table_cell ( House.where(region_id: region.id).filtered_by_attivo.count ) %>
<%= view_table_cell ( Person.where(house_id: House.where(region_id: region.id).pluck(:id)).count ) %>
<%= view_table_cell ( Person.where(house_id: House.where(region_id: region.id).pluck(:id)).where(citizenship_id: CitizenshipsHelper::CittadinanzeA_ids).count ) %>
<%= view_table_row_close %>
<% end %>
<%= view_table_body_close %>
<%= view_table_close %>