<div class="page-header">
 <ul class="breadcrumb">
  <li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
  <li class="breadcrumb-item"><a href="<%= settings_zones_path %>"><%= t("en.zones") %></a></li>
  <li class="breadcrumb-item active"><%= t :details %></li>
  <span class="float-right">
    <%= link_to t("views.btn.back"), settings_zones_path %>
  </span>
</ul>
</div>

<br/>

<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
    <div class="card">
      <div class="card-block">
        <h4 class="card-title"><%= t("views.right_panel.header.zone") %></h4>
        <table class="table">
          <thead>
            <tr>
              <th><%= t("views.right_panel.detail.name") %></th>
              <th><%= t("views.right_panel.detail.is_active") %></th>
              <th><%= t("views.right_panel.detail.created_by") %></th>
              <th><%= t("views.right_panel.detail.actions") %></th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td><%= @settings_zone.name %></td>
              <td><%= @settings_zone.is_active %></td>
              <% if Employee.exists?(@settings_zone.created_by) %>
              <td><%= Employee.find(@settings_zone.created_by).name %></td>
              <% else %>
              <td><%= @settings_zone.created_by %></td>
              <% end %>
              <td>
                  <%= link_to t("views.btn.edit"),edit_settings_zone_path(@settings_zone),:class => 'btn btn-primary btn-sm waves-effect' %>
                  <button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%= settings_zone_path(@settings_zone)%>" data-method="delete">
                      <%= t("views.btn.delete") %>
                  </button>

                  <span class="hidden" id="delete_text">
                      <h6>Are you sure you want to delete this row ?</h6>
                      <h6>This action can't be undo. </h6>
                  </span>
                  </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <br>
    <div class="card">
      <div class="card-block">
        <h4 class="card-title"><%= t("views.right_panel.header.dining_facilities") %>
          <span style="float: right">
            <%= link_to "New Table",new_settings_zone_table_path(@settings_zone),:class => 'btn btn-success btn-sm waves-effect' %>
            <%= link_to "New Room",new_settings_zone_room_path(@settings_zone),:class => 'btn btn-success btn-sm waves-effect' %>
          </span>
        </h4>
        <table class="table">
          <thead>
            <tr>
              <th><%= t("views.right_panel.detail.name") %></th>
              <th><%= t("views.right_panel.detail.type") %></th>
              <th><%= t("views.right_panel.detail.seater") %></th>
              <th><%= t("views.right_panel.detail.is_active") %></th>
              <th><%= t("views.right_panel.detail.created_by") %></th>
              <th><%= t("views.right_panel.detail.created_at") %></th>
              <th><%= t("views.right_panel.detail.actions") %></th>
            </tr>
          </thead>

          <tbody>
            <% @settings_tables.each do |settings_table|%>
            <tr>
             <td><%= link_to settings_table.name, settings_zone_table_path(@settings_zone,settings_table) %></td>
             <td>Table</td>
             <td><%= settings_table.seater %></td>
             <td><%= settings_table.is_active %></td>
             <% if Employee.exists?(settings_table.created_by) %>
             <td><%= Employee.find(settings_table.created_by).name %></td>
             <% else %>
             <td><%= settings_table.created_by %></td>
             <% end %>
             <td><%= settings_table.created_at.strftime("%Y-%m-%d/%I:%M %p") %></td>
             <td><%= link_to t("views.btn.edit"), edit_settings_zone_table_path(@settings_zone, settings_table),:class => 'btn btn-info btn-lg waves-effect' %></td>
           </tr>
           <% end %>
           <% @settings_rooms.each do |room|%>
           <tr>
            <td><%= link_to room.name, settings_zone_room_path(@settings_zone,room) %></td>
            <td>Room</td>
            <td><%= room.seater %></td>
            <td><%= room.is_active %></td>
            <% if Employee.exists?(room.created_by) %>
            <td><%= Employee.find(room.created_by).name %></td>
            <% else %>
            <td><%= room.created_by %></td>
            <% end %>
            <td><%= room.created_at.strftime("%Y-%m-%d/%I:%M %p") %></td>
            <td><%= link_to t("views.btn.edit") ,edit_settings_zone_room_path(@settings_zone, room),:class => 'btn btn-info btn-lg waves-effect' %></td>
          </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  </div>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  <div class="card">
    <div class="body">
      <h5><%= t("views.right_panel.header.zone") %></h5>
      <h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
        <p>
        1) <%= t("views.right_panel.detail.name") %> - <%= t("views.right_panel.detail.zone_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
        2) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.zone_txt") %> <%= t("views.right_panel.detail.is_active_txt") %> <br>
        3) <%= t("views.right_panel.detail.created_by") %> - <%= t("views.right_panel.detail.created_by_txt") %> <%= t("views.right_panel.detail.zone_txt") %> <br>
        4) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt2") %> <%= t("views.right_panel.detail.zone_txt") %> <br>
        </p>
      <h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
      <p>
      1) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.zone_txt") %> <br>
      2) <%= t("views.right_panel.button.delete") %> - <%= t("views.right_panel.detail.delete_btn_txt") %> <%= t("views.right_panel.detail.zone_txt") %> <br>
      </p>

      <h5><%= t("views.right_panel.header.dining_facilities") %></h5>
      <h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
        <p>
      1) <%= t("views.right_panel.detail.name") %> - <%= t("views.right_panel.detail.table_txt") %> <%= t("views.right_panel.detail.name_txt") %> <%= t("views.right_panel.detail.table_txt") %> <%= t("views.right_panel.detail.data_txt") %><br>
      2) <%= t("views.right_panel.detail.type") %> - <%= t("views.right_panel.detail.type_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.table_txt") %> <br>
      3) <%= t("views.right_panel.detail.seater") %> - <%= t("views.right_panel.detail.seat_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.table_txt") %> <br>
      4) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.is_active_txt") %> <br>
      5) <%= t("views.right_panel.detail.created_by") %> - <%= t("views.right_panel.detail.created_by_txt") %> <%= t("views.right_panel.detail.table_txt") %> <br>
      6) <%= t("views.right_panel.detail.created_at") %> - <%= t("views.right_panel.detail.created_at_txt") %> <%= t("views.right_panel.detail.table_txt") %> <br>
      7) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt3") %> <%= t("views.right_panel.detail.table_txt") %> <br>
      </p>
      <h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
      <p>
      1) <%= t("views.right_panel.button.new_table") %> - <%= t("views.right_panel.detail.new_btn_txt") %> <%= t("views.right_panel.detail.table_txt") %> <br>
      2) <%= t("views.right_panel.button.new_room") %> - <%= t("views.right_panel.detail.new_btn_txt") %> <%= t("views.right_panel.detail.room_txt") %> <br>
      3) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.table_txt") %> <br>
      </p>
      -----------------------------------------------------------------
      <h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
      <p>
        1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
        2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.zone_txt") %> <br>
      </p>
    </div>
  </div>
</div>
</div>
