<% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <% end delete_domain_button = button_tag("#{t('delete_')} domain", class: 'btn btn-danger', :onclick=> "delete_domain(this)", :type => 'button') %> <%= form_for @site_server ,:url=>{:action=>"edit_server_info",:type=>'update'},:method=>:post, :html => {:class=>"form-horizontal main-forms"} do |f|%>
<%= select_category(f, @module_app) %>
<%= select_tags(f, @module_app) %>
<% unless @site_server.new_record? %>
<%= f.check_box :active,:id=>"active_server",:title=>t("client_management.active") %>
<% end %>
<% if @site_server.new_record? %> <%= f.text_field :server_name,{:id=>'server_name'} %> <% else %> <%= @site_server.server_name %> <% f.hidden_field :server_name,{:id=>'server_name'} %> <% end%>
<% tp = @site_server.domain_names tp << '' if tp.length == 0 tp.each_with_index do |domain_name,i| %> <%= '
'.html_safe if i !=0 %> <%= text_field_tag "site_server[domain_names][]",domain_name,{:id=>nil,:class=>"domain_name"} %> <%= delete_domain_button if i !=0 %> <% end %>
<%= f.button "#{t('add')} domain", class: 'btn btn-info', :onclick=> "add_domain(this)", :type => 'button' %>
<%= f.check_box :enable_redirect_default_domain,:id=>"enable_redirect_default_domain" %>
<% @site_server.default_domain_names.each_with_index do |domain_name,i| %> <%= '
'.html_safe if i !=0 %> <%= text_field_tag "site_server[default_domain_names][]",domain_name,{:id=>nil,:class=>"domain_name"} %> <%= delete_domain_button %> <% end %>
<%= f.button "#{t('add')} domain", class: 'btn btn-info', :onclick=> "add_default_domain(this)", :type => 'button' %>
<%= f.text_field :ip,{:id=>'ip'} %>
<%= f.text_field :port,{:id=>'port'} %>
<%= f.text_field :account,{:id=>'account'} %>
<%= f.text_field :password,{:id=>'password'} %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<% end %>