<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
    <div class="card">
      <div class="body">
        <%= simple_form_for([:settings, @settings_cashier_terminal]) do |f| %>
        <%= f.error_notification %>

        <div class="form-inputs p-l-10">
          <%= f.input :name %>
          <%= f.input :is_active %>
          <%= f.input :is_currently_login %>
          <%= f.input :auto_print_receipt %>
          <%= f.label "Select Zones", :class => 'control-label' %>
          <%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox form-group'%>
          <% if(@server_mode != 'cloud') %>
            <%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
          <% else %>
            <%= f.input :printer_name, :as => :select, :collection => [], include_blank: false %>
          <% end %>
          <%= f.input :font %>
          <%= f.input :font_size %>
          <%= f.input :show_tax %>
          <%= f.input :show_cashier %>
          <%= f.input :show_guest_info %>
        </div>

        <div class="form-actions">
           <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
        </div>
      <% end %>
      </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.write_txt") %> <%= t("views.right_panel.detail.cashier_terminal_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
        2) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.is_active_txt") %> <br>
        3) <%= t("views.right_panel.detail.is_currently_login") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.is_currently_login_txt") %> <br>
        4) <%= t("views.right_panel.detail.auto_print_receipt") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.auto_print_receipt_txt") %> <br>
        5) <%= t("views.right_panel.detail.zone_txt") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.zone_txt") %> <br>
        6) <%= t("views.right_panel.detail.printer_name") %> - <%= t("views.right_panel.detail.name_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.printer_txt") %> <br>
        7) <%= t("views.right_panel.detail.font") %> - <%= t("views.right_panel.detail.font_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.cashier_terminal_txt") %> <br>
        8) <%= t("views.right_panel.detail.font_size") %> - <%= t("views.right_panel.detail.font_size_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.cashier_terminal_txt") %> <br>
        9) <%= t("views.right_panel.detail.show_tax") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.tax_txt") %> <br>
        10) <%= t("views.right_panel.detail.show_cashier") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.cashier_txt") %> <br>
        11) <%= t("views.right_panel.detail.show_guest_info") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.guest_info_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.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.cashier_terminal_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.cashier_terminal_txt") %> <br>
        </p>
      </div>
    </div>  
  </div>
</div>

<script type="text/javascript">
  $(document).ready(function(){
    var serverMode = "<%= @server_mode %>";    
    if(serverMode == 'cloud'){
      var printers = code2lab.getPrinters();      
      var printerInfo = JSON.parse([printers]); 
      var select = $("#cashier_terminal_printer_name"); 

      $.each(printerInfo, function(key, value) {      
       $('#cashier_terminal_printer_name')
           .append($("<option></option>")
                      .attr("value",value.target)
                      .text(value.deviceName)); 
      }); 
    } 
  });
</script>