<div class="page-header">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
    <li class="breadcrumb-item"><a href="<%= settings_zone_rooms_path %>">Rooms</a></li>
    <li class="breadcrumb-item active">Details</li>
    <span class="float-right">
      <%= link_to 'Back', settings_zones_path %>
    </span>
  </ol>
</div>
<br>
<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
   <div class="card">
    <div class="card-block">
      <h4 class="card-title">Room</h4>
      <table class="table">
        <thead>
          <tr>
            <th>Name</th>
            <th>Status</th>
            <th>Room</th>
            <th>Seater</th>
            <th>Order by</th>
            <th>Is Active</th>
            <th>Created By</th>
            <th>Created At</th>
            <th>Actions</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td><%= @room.name %></td>
            <td><%= @room.status %></td>
            <td>Room</td>
            <td><%= @room.seater rescue "-" %></td>
            <td><%= @room.order_by rescue "-" %></td>
            <td><%= @room.is_active rescue "-" %></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.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
            <td><%= link_to t("views.btn.edit"), edit_settings_zone_room_path(@zone,@room),:class => 'btn btn-primary btn-sm waves-effect' %>
              <button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%= settings_zone_room_path(@zone,@room)%>" 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> 
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
  <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
    <div class="card">
      <div class="body">
        <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.room_txt") %> <%= t("views.right_panel.detail.name_txt") %> <%= t("views.right_panel.detail.room_txt") %><br> 
        2) <%= t("views.right_panel.detail.status") %> - <%= t("views.right_panel.detail.room_txt") %> <%= t("views.right_panel.detail.status_txt") %> <br>
        3) <%= t("views.right_panel.detail.room_txt") %> - <%= t("views.right_panel.detail.room_txt") %>  <br>
        4) <%= t("views.right_panel.detail.seater") %> - <%= t("views.right_panel.detail.seat_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.room_txt") %> <br>
        5) <%= t("views.right_panel.detail.order_by") %> - <%= t("views.right_panel.detail.order_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.room_txt") %> <br>
        6) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.room_txt") %> <%= t("views.right_panel.detail.is_active_txt") %> <br>
        7) <%= t("views.right_panel.detail.created_by") %> - <%= t("views.right_panel.detail.created_by_txt") %> <%= t("views.right_panel.detail.room_txt") %> <br>
        8) <%= t("views.right_panel.detail.created_at") %> - <%= t("views.right_panel.detail.created_at_txt") %> <%= t("views.right_panel.detail.room_txt") %> <br>
        9) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt2") %> <%= t("views.right_panel.detail.room_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.room_txt") %> <br>
        2) <%= t("views.right_panel.button.delete") %> - <%= t("views.right_panel.detail.delete_btn_txt") %> <%= t("views.right_panel.detail.room_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.room_txt") %> <br>
        </p>
      </div>
    </div>  
  </div>
</div>


