<%=form_for @inventory, as: :router_inventories, url: inventory_path(@inventory), method: :put, html: { role: "form", class: "router-inventories-form"} do |f|%>
<% if (can? :manage, @inventory) || (can? :update, @inventory) %>
<%= f.label :name, "Name"%> <%= f.text_field :name, :class=>"form-control", :placeholder=>"Name", "data-validation" => 'required' %>
<% end %> <%#if !["3", "4"].include? @inventory.hardware_part.try(:part_number) -%> <%#= f.label :channel, "Channel" %> <%#= f.select :channel,(1..11).to_a, {}, {:class=>"form-control channel"} %>
<% if (can? :manage, @inventory)%> <% if !@inventory.switch? %>
<%= f.label :enable_gre_on_lan, "L2oGRE on LAN" %>
<%= f.check_box :enable_gre_on_lan %> Enable <%= f.text_field :gre ,:class=>"form-control gre", :placeholder=>"IP Address", "data-validation" => 'required ip' %>
<%=f.label :enable_dhcp_on_lan, "DHCP Relay on LAN"%>
<%= f.check_box :enable_dhcp_on_lan %> Enable <%= f.text_field :dhcp_relay, :class=>"form-control dhcp_relay", :placeholder=>"IP Address", "data-validation" => 'required ip' %>
<%# if !["3", "4"].include? @inventory.hardware_part.try(:part_number) -%> <%#= f.label :power, "Power(dbm)" %> <%#= f.select :power, Array(1..20).reverse!,{},{:class=>"form-control power"}%> <%# end -%>
<% i=0 %> <%= f.fields_for :uplinks, @inventory.uplinks do |link| %> <% i += 1%> <% end %>
<% if @inventory.hardware_part.blank? || ["3","5","6","9","7","10","11","19","20","23","24","25","28","29","30","32","34","35","39"].include?(@inventory.hardware_part.try(&:part_number)) %>
<% end %> <%# if ["6", "9"].include? @inventory.hardware_part.try(:part_number) %> <% if false %>
<%=f.label :retry_count, "Retry Count"%> <%= f.text_field :retry_count,:class=>"form-control", :type=>'number' ,:placeholder=>"Retry Count", :max=>'100', :min=>'0',:data => { :validation => "phone-only-integer" } %>
<%=f.label :retry_interval, "Retry Interval(seconds)"%> <%= f.text_field :retry_interval ,:type=>'number' ,:max=>'100', :min=>'0',:class=>"form-control",:placeholder=>"Retry Interval(seconds)",:data => { :validation => "phone-only-integer " } %>
<%=f.label :retry_ip1, "Retry Primary IP"%> <%= f.text_field :retry_ip1, :class=>"form-control ip-mask ip", :placeholder=>"Retry primary IP", :data => { :validation => "required ip " } %>
<%=f.label :retry_ip2, "Retry Secondary IP"%> <%= f.text_field :retry_ip2 ,:class=>"form-control ip-mask ip",:placeholder=>"Retry Secondary IP" , :data => {:validation =>'required ip'}%>
<% end %> <% end %>
<%=f.label :notes, "Notes"%> <%= f.text_area :notes,:class=>"form-control", :placeholder=>"Notes"%>
<%=f.label :tag_list, "Tags"%> <%= f.text_field :tag_list ,:class=>"form-control tag_list"%>
<%= f.label :enable_pci, "PCI Compliance" %>
<%= f.check_box :enable_pci %> Enable
Note:Below details can be set automatically by dragging marker on map.
<%=f.label :address, "Address Line"%> <%= f.text_field :address,:class=>"form-control", :placeholder=>"Address"%> <%= hidden_field_tag "old_address", :value => f.object.address %>
<%= f.label :latitude, "Latitude"%> <%= f.text_field :latitude, :class=>"form-control", :placeholder=>"Latitude" ,"data-validation" => 'location-validation','data-validation-help' =>"eg..74.2589,-26.5987"%> <%= hidden_field_tag "old_latitude", :value => f.object.latitude %>
<%= f.label :longitude, "Longitude"%> <%= f.text_field :longitude, :class=>"form-control", :placeholder=>"Longitude" ,"data-validation" => 'location-validation','data-validation-help' =>"eg..74.2589,-26.5987"%> <%= hidden_field_tag "old_longitude", :value => f.object.longitude %>
<%end %>
<%= f.button "Save",:class => "btn btn-success" %> <%= link_to "Cancel",inventory_path(@inventory),:class => "btn btn-primary cancel" %> <% end %>