<div class="page-header">
  <ol 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_employees_path %>"><%= t("views.right_panel.detail.employee") %></a></li>
    <li class="breadcrumb-item active"><%= t :details %></li>
    <span class="float-right">
      <%= link_to t('.back', :default => t("views.btn.back")), settings_employees_path %>
    </span>
  </ol>
</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.detail.employee") %></h4>
      <table class="table">
        <tbody>
          <tr>
            <th><%= t("views.right_panel.detail.name") %></th>
            <td><%= @employee.name %></td>
          </tr>

          <tr>
            <th><%= t("views.right_panel.detail.role") %></th>
            <td><%= @employee.role %></td>
          </tr>
          <% if @employee.role == "kitchen"%>
          <tr>
            <th><%= t("views.right_panel.detail.station_name") %></th>
            <td><%= @employee.order_queue_station.station_name %></td>
          </tr>
           <% end%>
          <tr>
           <th><%= t("views.right_panel.detail.created_at") %></th>
           <td><%= @employee.created_at.strftime("%Y-%m-%d/%I:%M %p") %></td>
         </tr>
         <tr>
          <th><%= t("views.right_panel.detail.updated_at") %></th>
          <td><%= @employee.updated_at.strftime("%Y-%m-%d/%I:%M %p") %></td>
        </tr>
        <tr>
          <th><%= t("views.right_panel.detail.employee_photo") %></th>
          <td><%= image_tag @employee.image_path, :size => '200x200'%></td>
        </tr>
        <% if @employee.role == 'application' %>
          <tr>
            <th><%= t("views.right_panel.detail.employee_app_id") %></th>
            <td><%= @employee.app_id %></td>
          </tr>
          <tr>
            <th><%= t("views.right_panel.detail.employee_app_token") %></th>
            <td><%= @employee.app_token %></td>
          </tr>
        <% end %>
        <tr>
          <th></th>
          <td>
            <%= link_to t("views.btn.edit"), edit_settings_employee_path(@employee),:class => 'btn btn-primary btn-lg waves-effect' %>
            <% if @employee.role == 'application' %>
              <%= link_to t("views.btn.change_app_token"), settings_change_app_token_url(id: @employee.id), class: 'btn btn-primary btn-lg waves-effect' %>
            <% end %>
            <%if @employee.role != "administrator"%>
            <button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%=settings_employee_path(@employee)%>" 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>
            <%end%>
          </td>
        </tr>
      </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><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.employee_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
      2) <%= t("views.right_panel.detail.role") %> - <%= t("views.right_panel.detail.role_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.employee_txt") %> <br>
      3) <%= t("views.right_panel.detail.created_at") %> - <%= t("views.right_panel.detail.created_at_txt") %> <%= t("views.right_panel.detail.employee_txt") %> <br>
      4) <%= t("views.right_panel.detail.updated_at") %> - <%= t("views.right_panel.detail.updated_at_txt") %> <%= t("views.right_panel.detail.employee_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.employee_txt") %> <br>
      <%if @employee.role != "administrator"%>
      2) <%= t("views.right_panel.button.delete") %> - <%= t("views.right_panel.detail.delete_btn_txt") %> <%= t("views.right_panel.detail.employee_txt") %> <br>
      <% end %>
      </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.employee_txt") %> <br>
      </p>
    </div>
  </div>
</div>
</div>
