<%=t('olympiamanagement.school_connection_data')%>
<%=form_for @olympia_school_data_field ,:url=>{:controller=>"olympiamanagements" ,:action=>"update_school_data",:olympia_user_name=>(session[:olympia_login_id] rescue "")} do |form|%> <% @school_data_fields.each do |field| %>
<% @extra_class = ((field.values[0]["required"] == "true")? " required" : "")%> <% @extra_text = ((field.values[0]["required"] == "true")? "*" : "")%>
<%= @extra_text+t('olympiamanagement.'+field.keys[0]) %>
<% if field.values[0]["type"] != 'select' %>
" value="<%= (field.keys[0]=="enrollment_limited"&&(@olympia_school_data_field[field.keys[0]].nil? || @olympia_school_data_field[field.keys[0]] == 0) ) ? ClassSettingFields.all.select{|class_setting_field| class_setting_field.class_number_range[0] <= @olympia_school_data_field.class_number && class_setting_field.class_number_range[1] >= @olympia_school_data_field.class_number}.first.enrollment_available.to_s : @olympia_school_data_field[field.keys[0]] %>" size="<%=field.values[0]["size"]%>" type="text" id="<%= field.keys[0] %>" class="col_input<%= @extra_class%>" <%=field.values[0]["readonly"]%>/> <% else%> <% @please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please select." %>
" id="<%=field.keys[0]%>" class="required" value="<%= @olympia_school_data_field[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] + '
').html_safe %> <% end %>
<% end %>
<% if(!field.values[0]["hint"][I18n.locale.to_s].blank? rescue false) %>
<%=field.values[0][:hint][I18n.locale.to_s]%>
<% end %>
<% end %>
<% end %>