<%= stylesheet_link_tag "lib/fileupload"%> <%= stylesheet_link_tag "lib/togglebox"%> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/bootstrap-fileupload" %> <%#= javascript_include_tag "lib/bootstrap-datetimepicker" %> <%#= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> <%= javascript_include_tag "lib/file-type" %> <%= javascript_include_tag "lib/module-area" %> <%= javascript_include_tag "form" %> <% end %>
<%=form_for @form_to_show ,:url=>{:controller=>"cancerpredicts" ,:action=>"edit"} do |form|%> <%= t('cancerpredict.title') %>
<%=form.fields_for :title_texts do |locale_fields|%> <%=locale_fields.text_field I18n.locale.to_s ,{:value => @form_to_show.title_texts[I18n.locale.to_s],:id=>"title_text"} %> <% end %> <% if @title_images.length != 0%> <% @title_images.each_with_index do |temp_image,i| %> <%= form.fields_for "title_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 == @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') %>
<%= t('cancerpredict.font_size') %>
<% @size=['small','medium','large'] %> <% @size.each do |size|%> <%= form.fields_for size do |make_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.module_mode') %>
<%= t('cancerpredict.Input_fields') %>
<% keys = Cancerpredictfields::FIELDINFO.keys - Cancerpredictfields::TherapyOnly %> <% keys.each do |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|%> <%= render :partial => 'form', :locals=>{:make_fields=>make_fields,:property=>property,:num=>num,:keys => keys} %> <%end%> <%end%> <%end%>
<%=t("cancerpredict.table.#{key}")%>
<%=t('cancerpredict.table.Results')%>
<% 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%>
<% @create_items = ['years','table_above_texts','text_above_texts','surgery_only_texts','extra_texts','extra_therapy_texts','danger_texts','texts_between_Result_and_result_block'] array_indices = [0] %> <% @create_items.each_with_index do |item, i|%> <% if @form_to_show[item].class == BSON::Document || @form_to_show[item].class == Hash %> <%= form.fields_for item do |locale_fields|%> <% value = @form_to_show[item][I18n.locale.to_s] if array_indices.include?(i) value = bc_yaml_dump(value) end %> <%= locale_fields.text_field I18n.locale.to_s,{:value=> value,:id=> item,:style=>'width:calc(100% - 16em)'} %> <% end %> <% else %> <% value = @form_to_show[item] if array_indices.include?(i) value = bc_yaml_dump(value) end %> <%= form.text_field item,{:value=> value,:id=> item,:style=>'width:calc(100% - 16em)'} %> <% end %>
<% end %> <% keys = Cancerpredictfields::TherapyFields %> <% keys.each do |key,vlaue|%> <%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|%> <%= render :partial => 'form', :locals=>{:make_fields=>make_fields,:property=>property,:num=>num,:keys => Cancerpredictfields::TherapyFields} %> <%end%> <%end%> <%end%>
<%=t("cancerpredict.table.#{key}")%>
<%=t('cancerpredict.table.calculate_settings')%>
<%= form.text_area :hidden_variables, :rows=>"5", :style=> 'width: 100%;font-family: sans-serif;' %>
<%= form.text_area :prediction_formula, :rows=>"5", :style=> 'width: 100%;font-family: sans-serif;' %>
<% years = @form_to_show.years %> <% years.each_with_index do |year,i| %>
<% end %>
<%=form.submit "#{t(:updatefont)}",{:id=>"updatebtn"}%> <%end%>