<!-- <div class="page-header">
 <ul class="breadcrumb">
  <li><a href="<%=  %>">Home</a></li>
  <li><a href="<%= settings_menu_categories_path %>">Menus Categories</a></li>

  <li>Menu Items</li>
  <span style="float: right">
    <%= link_to t("views.btn.new"),settings_menu_category_path(@category),:class => 'btn btn-primary btn-sm' %>
  </span>
 </ul>
</div> -->
<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 active"><%= t("views.right_panel.header.menu_items") %></li>
    <span class="float-right">
      <%= link_to 'Back', root_path %>
    </span>
  </ol>
</div>
<br>

<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
   <div class="card">
    <ul class="list-group">
      <li class="list-group-item"><%= link_to (t :accounts), settings_accounts_path %></li>
      <li class="list-group-item"><%= link_to 'Menu ', settings_menus_path %></li> 
      <li class="list-group-item"><%= link_to 'Menu Categories', settings_menu_categories_path %></li>
      <!-- <li class="list-group-item"><%= link_to 'Menu Item', dashboard_path %></li> -->
      <li class="list-group-item"><%= link_to 'Item Set', settings_item_sets_path %></li>
      <li class="list-group-item"><%= link_to 'Items Attributes', settings_menu_item_attributes_path %></li>
      <li class="list-group-item"><%= link_to 'Items Options', settings_menu_item_options_path %></li>
    </ul>
  </div>
</div>
<div class="col-xs-12 col-sm-12 col-md-7 col-lg-7">
  <div class="card">
    <div class="card-block">
      <h4 class="card-title"><%= t("views.right_panel.header.menu_category") %>
        <!-- <div class="m-b-10 clearfix"> -->
        <%= link_to t("views.btn.new"),new_settings_menu_category_simple_menu_item_path(@category),:class => 'btn btn-primary btn-sm float-right waves-effect"' %>
        <!-- </div> --></h4>
        <table class="table">
          <thead>
            <tr>
              <th><%= t("views.right_panel.detail.menu") %></th>
              <th><%= t("views.right_panel.detail.name") %></th>
              <th><%= t("views.right_panel.detail.alt_name") %></th>
              <th><%= t("views.right_panel.detail.order_by") %></th>
              <th><%= t("views.right_panel.detail.parent") %></th>
              <th><%= t("views.right_panel.detail.actions") %></th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td><%= @category.menu.name %></td>
              <td><%= @category.name %></td>
              <td><%= @category.alt_name %></td>
              <td><%= @category.order_by %></td>
              <td><%= @category.parent.name rescue "-" %></td>
              <td>
                <%= link_to t("views.btn.edit"), edit_settings_menu_category_path(@category),:class => 'btn btn-info btn-sm waves-effect' %>
                <button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%= settings_menu_category_path(@category)%>" 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.menu_items") %>
          <span style="float: right">
            <%= link_to "New Simple Menu Item",new_settings_menu_category_simple_menu_item_path(@category),:class => 'btn btn-primary btn-sm' %>
            <%= link_to "New Set Menu Item",new_settings_menu_category_set_menu_item_path(@category),:class => 'btn btn-primary btn-sm' %>
          </span></h4>
          <table class="table">
            <thead>
              <tr>
                <th><%= t("views.right_panel.detail.item_code") %></th>
                <th><%= t("views.right_panel.detail.name") %></th>
                <th><%= t("views.right_panel.detail.alt_name") %></th>
                <th><%= t("views.right_panel.detail.type") %></th>
                <th><%= t("views.right_panel.detail.parent_item") %></th>
                <!-- <th>Created by</th> -->
                <th><%= t("views.right_panel.detail.created_at") %></th>
                <th><%= t("views.right_panel.detail.actions") %></th>
              </tr>
            </thead>

            <tbody>
              <% @settings_menu_items.each do |settings_menu_item| %>
              <tr>
                <td><%= settings_menu_item.item_code %></td>
                <td><%= settings_menu_item.name %></td>
                <td><%= settings_menu_item.alt_name %></td>
                <td><%= settings_menu_item.type %></td>
                <td><%= settings_menu_item.parent.name rescue "-" %></td>
                <!-- <td><%= settings_menu_item.created_by %></td> -->
                <td><%= settings_menu_item.created_at.strftime("%Y-%m-%d")  %></td>

                <% if settings_menu_item.type == "SimpleMenuItem" %>
                <td><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %>
                  <%= link_to t("views.btn.edit"), edit_settings_menu_category_simple_menu_item_path(@category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %>                 
                </td>
                <% else %>
                <td><%= link_to 'Show', settings_menu_category_set_menu_item_path(@category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %>
                  <%= link_to t("views.btn.edit"), edit_settings_menu_category_set_menu_item_path(@category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %>
                </td>
                <% end %>
              </tr>
              <% end %>
            </tbody>
          </table>

        </div>

      </div>
      <%= paginate @settings_menu_items, param_name: :page, :outer_window => 3 %> 
    </div>
    <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
      <div class="card">
        <div class="body">
          <h5><%= t("views.right_panel.header.menu_category") %></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.menu") %> - <%= t("views.right_panel.detail.menu_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
            2) <%= t("views.right_panel.detail.name") %> - <%= t("views.right_panel.detail.menu_categories_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
            3) <%= t("views.right_panel.detail.alt_name") %> - <%= t("views.right_panel.detail.alt_name_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.menu_categories_txt") %><br>
            4) <%= t("views.right_panel.detail.is_available") %> - <%= t("views.right_panel.detail.menu_categories_txt") %> <%= t("views.right_panel.detail.status_txt") %> <br>
            4) <%= 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.menu_categories_txt") %><br>
            5) <%= t("views.right_panel.detail.created_at") %> - <%= t("views.right_panel.detail.created_at_txt") %> <%= t("views.right_panel.detail.menu_categories_txt") %> <br>
            6) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt2") %> <%= t("views.right_panel.detail.menu_categories_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.menu_categories_txt") %> <br>
            2) <%= t("views.right_panel.button.delete") %> - <%= t("views.right_panel.detail.delete_btn_txt") %> <%= t("views.right_panel.detail.menu_categories_txt") %> <br>
          </p>
          <h5><%= t("views.right_panel.header.menu_items") %></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.item_code") %> - <%= t("views.right_panel.detail.code_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.menu_item_txt") %> <br>
            2) <%= t("views.right_panel.detail.name") %> - <%= t("views.right_panel.detail.menu_item_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
            3) <%= t("views.right_panel.detail.alt_name") %> - <%= t("views.right_panel.detail.alt_name_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.menu_item_txt") %> <br>
            4) <%= t("views.right_panel.detail.type") %> - <%= t("views.right_panel.detail.type_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.menu_item_txt") %> <br>
            5) <%= t("views.right_panel.detail.parent_item") %> - <%= t("views.right_panel.detail.parent_item_txt") %> <br>
            6) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt") %> <%= t("views.right_panel.detail.menu_item_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_simple_menu_item") %> - <%= t("views.right_panel.detail.create_btn_txt") %> <%= t("views.right_panel.detail.simple_menu_item_txt") %> <br>
            2) <%= t("views.right_panel.button.new_set_menu_item") %> - <%= t("views.right_panel.detail.create_btn_txt") %> <%= t("views.right_panel.detail.set_menu_item_txt") %> <br>
            3) <%= t("views.right_panel.button.show") %> - <%= t("views.right_panel.detail.show_btn_txt") %> <%= t("views.right_panel.detail.menu_item_txt") %> <br>
            4) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.menu_item_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.home_txt") %> <br>
            3) <%= t("en.accounts") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.accounts_txt") %><br>
            4) <%= t("views.right_panel.button.menu") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.menu_txt") %><br>
            5) <%= t("views.right_panel.button.menu_categories") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.menu_categories_txt") %><br>
            6) <%= t("views.right_panel.button.item_set") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.item_set_txt") %> <br>
            7) <%= t("views.right_panel.button.item_attributes") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.item_attributes_txt") %> <br>
            8) <%= t("views.right_panel.button.item_options") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.item_options_txt") %> <br>
          </p>
        </div>
      </div>  
    </div>
  </div>