olympiamanagement/app/views/olympiamanagements/print_registration_form.htm...

73 lines
3.1 KiB
Plaintext
Raw Normal View History

2020-02-04 11:51:05 +00:00
<!DOCTYPE html>
<html>
<head>
<%=@head%>
2020-02-06 06:28:16 +00:00
<link href="/assets/contest.css" rel="stylesheet" type="text/css">
<%= stylesheet_link_tag "template/template" , :media=>'print' %>
2020-02-04 11:51:05 +00:00
</head>
2020-02-06 06:28:16 +00:00
<body style="background-color: white;margin: 0.8em;">
2020-02-04 11:24:13 +00:00
<div id="main1"><div id="main2"><div id="main">
<%=@breadcumb%>
<table class="print_contest1"><tbody>
<tr><th colspan="4"><font face="標楷體, cursive"><font size="6" style="font-size: 1.67em;"><%=@record_form_title%></font></font></th></tr>
<% @record_fields.each_with_index do |record_block,i| %>
<tr>
2020-02-06 06:28:16 +00:00
<% record_block.each_with_index do |record_item,td_index| %>
2020-02-04 11:24:13 +00:00
<td <%=((i==@record_fields.count-1) ? "style=line-height:80px;" : "")%>><%=t('olympiamanagement.'+record_item.to_s)%></td>
2020-02-06 06:28:16 +00:00
<% if record_item == "enrollment_limited"%>
<% @olympia_school_data_field = OlympiaSchoolDataFields.find(@olympia_school_data_fields_id)%>
<% if(@olympia_school_data_field.enrollment_limited.to_i == 0) %>
2020-03-02 07:03:41 +00:00
<td><%= 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 rescue ClassSettingFields.all.desc(:enrollment_available).first.enrollment_available.to_s %></td>
2020-02-06 06:28:16 +00:00
<% else %>
<td><%= @olympia_school_data_field.enrollment_limited %></td>
<% end %>
<% else %>
<td <%= ((td_index == record_block.count-1) ? "colspan=#{3-td_index*2}" : "") %> <%=((i==@record_fields.count-1) ? "style=line-height:80px;" : "")%>><%=(@school_data[record_item.to_s].nil? ? '&nbsp;'.html_safe : @school_data[record_item.to_s]) %></td>
<% end %>
2020-02-04 11:24:13 +00:00
<% end %>
</tr>
<% end %>
</tbody></table>
<table class="print_contest2">
<tbody>
<tr><td><%=@remark_texts%><br></td></tr>
</tbody>
</table>
<table class="print_contest3"><tbody>
<tr>
<% @student_fields.each do |field_name| %>
<td><%=t('olympiamanagement.'+field_name.to_s)%></td>
<% end %>
</tr>
2020-02-04 11:51:05 +00:00
<% @student_data_list.each_with_index do |field,i| %>
2020-02-04 11:24:13 +00:00
<tr>
2020-02-04 11:51:05 +00:00
<% @student_fields.each do |th_name|%>
<% if th_name == 'serial_number' %>
<td><%= "#{i+1}" %></td>
<%elsif th_name != 'birth_date'%>
<% @value = field[th_name] %>
<% @index = @field_infos.map{|hash| hash.keys[0]}.index(th_name) rescue nil%>
<% if !@index.nil? %>
2020-02-28 02:26:14 +00:00
<% @value = @field_infos.map{|hash| hash.values[0]}[@index]['choices'].index(@value) if @field_infos.map{|hash| hash.values[0]}[@index]['type'] == 'radio' %>
2020-02-04 11:51:05 +00:00
<% (['String','Year','select_num','File'].include?(@field_infos.map{|hash| hash.values[0]}[@index]['type'])) ? (nil) : (@value=(@field_infos.map{|hash| hash.values[0]}[@index]['values'][I18n.locale.to_s][@value.to_i].to_s rescue @value))%>
<% end %>
<td><%= @value %></td>
<% else %>
<td><%= "#{field.StudentBirthYear}-#{field.StudentBirthMonth}-#{field.StudentBirthDay}" %></td>
2020-02-04 11:24:13 +00:00
<% end %>
<% end %>
</tr>
<%end%>
</tbody></table>
<script type="text/javascript">
2020-02-06 06:28:16 +00:00
window.onload = function (){
text = document;
print(text);
};
2020-02-04 11:24:13 +00:00
</script>
2020-02-04 11:51:05 +00:00
</div></div></div></div></div></div></div>
</body>
2020-02-06 06:28:16 +00:00
</html>