%= stylesheet_link_tag "lib/fileupload"%>
<%= javascript_include_tag 'lib/bootstrap-fileupload' %>
<%= image_fields.fields_for i.to_s do |image_field| %>
<%= render :partial => 'image_form', :object => temp_image, :locals => {:f => image_field, :i => i} %>
<% if i.to_i == @title_images.length - 1%>
<% end %>
<% end %>
<% end %>
<% end %>
<% else %>
<%= form.fields_for "title_images" do |image_fields| %>
<%= image_fields.fields_for "0" do |image_field| %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'title_images_count', @title_images.count %>
<%= t('cancerpredict.add_image') %>
<%= t('cancerpredict.tool_head_pictures') %>
<% if @head_images.length != 0%>
<% @head_images.each_with_index do |temp_image,i| %>
<%= form.fields_for "head_images" do |image_fields| %>
<%= image_fields.fields_for i.to_s do |image_field| %>
<%= render :partial => 'image_form', :object => temp_image, :locals => {:f => image_field, :i => i} %>
<% if i.to_i == @head_images.length - 1%>
<% end %>
<% end %>
<% end %>
<% end %>
<% else %>
<%= form.fields_for "head_images" do |image_fields| %>
<%= image_fields.fields_for "0" do |image_field| %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'head_images_count', @head_images.count %>
<%= t('cancerpredict.add_image') %>
<%= t('cancerpredict.text_descibe') %>
<%= form.text_field 'text_descibe',{:value=> @form_to_show.text_descibe[I18n.locale.to_s],:style=>'width:100%;'} %>
<%= t('cancerpredict.font_size') %>
<% @size=['small','medium','large'] %>
<% @size.each do |size|%>
<%= form.fields_for size do |make_size| %>
><%=t('cancerpredict.'+size)+':'%> <%= make_size.text_field 'font_size',{:value=> @form_to_show[size]['font_size'],:id=>'font_'+size} %>
<% if @form_to_show[size]['active'].to_i == 1%>
<%= make_size.check_box 'active',{:checked=>true,:class=>"checkbox text_choice",:style=>"float:left;"}%>
<% else%>
<%= make_size.check_box 'active',{:checked=>false,:class=>"checkbox text_choice",:style=>"float:left;"}%>
<%end%>
<%end%>
<%end%>
<%= t('cancerpredict.Input_fields') %>
<% @form_to_show.form_show.values[1].each do |key,vlaue|%>
<%=key%>
<%end%>
<%= form.fields_for :form_show do |formfield|%>
<% @form_to_show.form_show.each do |num,property| %>
<%=formfield.fields_for num.to_s do |make_fields|%>
<% property.each do |key,value|%>
<% @value= value %>
<% if @value.class == BSON::Document || @value.class == Hash %>
<% @disp_value = @value[I18n.locale.to_s] rescue "" %>
<%else%>
<% @disp_value = @value %>
<%end%>
<% if @value.class == Fixnum %>
<% if @value == 1%>
<%= make_fields.check_box key,{:checked=>true,:class=>"checkbox",:style=>"float:left;"}%>
<% else%>
<%= make_fields.check_box key,{:checked=>false,:class=>"checkbox",:style=>"float:left;"}%>
<%end%>
<% elsif @value.class == BSON::Document || @value.class == Hash %>
<%=make_fields.fields_for I18n.locale.to_s do |locale_fields|%>
<%= locale_fields.text_field key,{:value=>@disp_value}%>
<%end%>
<% else %>
<%= make_fields.text_field key,{:value=>@disp_value}%>
<%end%>
<%end%>
<%end%>
<%end%>
<%end%>
<%=t('cancerpredict.table.Results')%>
<%= t('cancerpredict.result_is_right') %>
<% if @form_to_show.form_result_is_right.to_i == 1%>
<%= form.check_box "form_result_is_right",{:checked=>true,:class=>"checkbox",:style=>"float: left;position: relative;left: 0;transform: none!important;margin-left: 1em;",:id=>"form_result_is_right"}%>
<% else%>
<%= form.check_box "form_result_is_right",{:checked=>false,:class=>"checkbox",:style=>"float: left;position: relative;left: 0;transform: none!important;margin-left: 1em;",:id=>"form_result_is_right"}%>
<%end%>
<% @form_to_show.form_show_in_result.values[1].each do |key,vlaue|%>
<%=key%>
<%end%>
<%= form.fields_for :form_show_in_result do |formfield|%>
<% @form_to_show.form_show_in_result.each do |num,property| %>
<%=formfield.fields_for num.to_s do |make_fields|%>
<% property.each do |key,value|%>
<% @value= value %>
<% if @value.class == BSON::Document || @value.class == Hash %>
<% @disp_value = @value[I18n.locale.to_s] rescue "" %>
<%else%>
<% @disp_value = @value %>
<%end%>
<% if @value.class == Fixnum %>
<% if @value == 1%>
<%= make_fields.check_box key,{:checked=>true,:class=>"checkbox",:style=>"float:left;"}%>
<% else%>
<%= make_fields.check_box key,{:checked=>false,:class=>"checkbox",:style=>"float:left;"}%>
<%end%>
<% elsif @value.class == BSON::Document || @value.class == Hash %>
<%=make_fields.fields_for I18n.locale.to_s do |locale_fields|%>
<%= locale_fields.text_field key,{:value=>@disp_value}%>
<%end%>
<% else %>
<%= make_fields.text_field key,{:value=>@disp_value}%>
<%end%>
<%end%>
<%end%>
<%end%>
<%end%>
<%=form.submit "#{t(:updatefont)}",{:id=>"updatebtn"}%>
<%end%>