<%=t('olympiamanagement.'+(!@olympia_student_data.new_record? ? 'edit_sign_up_student_data' : 'add_sign_up_student_data'))%>
<%=form_for @olympia_student_data ,:url=>{:controller=>"olympiamanagements" ,:action=>"updata_student_data",:type=>"add_student_data",:id=>params[:id]}, :html => {:multipart => true} do |form|%> <% @student_data_field.student_data_fields.each do |field| %>
<% @extra_class = ((field.values[0]["required"] == "true")? " required" : "")%> <% @extra_text = ((field.values[0]["required"] == "true")? "*" : "")%> <%if !["StudentBirthYear","StudentBirthMonth","StudentBirthDay"].include?(field.keys[0]) %>
<%= @extra_text+t('olympiamanagement.'+field.keys[0]) %>
<%elsif field.keys[0]=="StudentBirthYear"%>
<%= @extra_text+t('olympiamanagement.birth_date') %>
<%end%>
<% if field.values[0][:type] == 'String' %>
" value="<%= (field.keys[0]=="enrollment_limited"&&(@olympia_student_data[field.keys[0]].nil? || @olympia_school_data_field[field.keys[0]] == 0) ) ? "" : @olympia_school_data_field[field.keys[0]] %>" size="<%=field.values[0][:size]%>" id="<%= field.keys[0] %>" class="col_input<%= @extra_class%>"/> <% elsif field.values[0][:type] == 'select_num' %> <% @please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please select." %>
" id="<%=field.keys[0]%>" class="required" value="<%= @olympia_student_data[field.keys[0]] %>" style="width: auto;">
<%=@please_choice%>
<% for @num in field.values[0]["range"][0] .. field.values[0]["range"][1] %> <%= ('
' + @num.to_s + (field.values[0][:unit][I18n.locale.to_s] rescue "") + '
').html_safe %> <% end %>
<%if ["StudentBirthMonth","StudentBirthDay"].include?(field.keys[0]) %> <%=t('olympiamanagement.'+field.keys[0])%> <%end%> <% elsif field.values[0][:type] == 'Year' %> <%=t('olympiamanagement.a_d_')%> <% @please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please select." %>
" id="<%=field.keys[0]%>" class="required" value="<%= @olympia_student_data[field.keys[0]] %>" style="width: auto;">
<%=@please_choice%>
<% for @num in (Time.now.year.to_i-10) .. (Time.now.year.to_i+10) %> <%= ('
' + @num.to_s + (field.values[0][:unit][I18n.locale.to_s] rescue "") + '
').html_safe %> <% end %>
<%=t('olympiamanagement.year')%> <% elsif field.values[0][:type] == 'select_string' %> <% @please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please select." %>
" id="<%=field.keys[0]%>" class="required" value="<%= @olympia_student_data[field.keys[0]] %>" style="width: auto;">
<%=@please_choice%>
<% field.values[0]["values"][I18n.locale.to_s].each_with_index do |value,i| %> <%= ('
' + value.to_s + '
').html_safe %> <% end %>
<% elsif field.values[0][:type] == 'radio' %> <%field.values[0][:choices].each_with_index do |choice,i|%>
" id="<%="#{field.keys[0]}_#{choice}"%>" class="required" value="<%=choice%>" "<%= (@olympia_student_data[field.keys[0]]== choice) ? 'checked' : '' %>">
"><%=field.values[0][:values][I18n.locale.to_s][i]%>
<% end %> <% elsif field.values[0][:type] == 'File' %>
" value="<%= (field.keys[0]=="enrollment_limited"&&(@olympia_student_data[field.keys[0]].nil? || @olympia_school_data_field[field.keys[0]] == 0) ) ? "" : @olympia_school_data_field[field.keys[0]] %>" size="<%=field.values[0][:size]%>" id="<%= field.keys[0] %>" style="margin-top: 1em;" class="col_input<%= @extra_class%>"/> <% end %>
<% if !field.values[0][:hint][I18n.locale.to_s].blank? %>
<%=field.values[0][:hint][I18n.locale.to_s]%>
<% end %>
<% end %>
<% end %>