olympiamanagement/app/views/olympiamanagements/_student_data_list.html.erb

36 lines
1.8 KiB
Plaintext
Raw Normal View History

2020-02-03 16:17:54 +00:00
<link rel="stylesheet" media="screen" type="text/css" href="/assets/admin/olympiamanagement.scss">
<link rel="stylesheet" media="print" type="text/css" href="/assets/admin/olympiamanagement.scss">
<script src="/assets/admin/olympiamanagement.js"></script>
<% th_name_list = ['StudentIdentity','StudentName','StudentClass','StudentArea','StudentPhone','action']%>
<table cellspacing="0" class="ts_rowsonly" width="100%" id="RSS_Table_page_contest_admin_1">
<thead>
<tr>
<% th_name_list.each do |th_name|%>
<th><%= t('olympiamanagement.'+th_name) %></th>
<% end %>
</tr>
</thead>
<tbody>
<% @student_fields.each do |field| %>
<tr>
<% th_name_list.each do |th_name|%>
<%if th_name != 'action'%>
<% @value = field[th_name] %>
<% @index = @field_infos.map{|hash| hash.keys[0]}.index(th_name) rescue nil%>
<% if !@index.nil? %>
<% (['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>
<a href="<%=add_sign_up_student_data_olympiamanagements_path+"?id=#{field.id}"%>"><img src="/assets/edit.gif" alt="<%= t('olympiamanagement.edit') %>" align="top" width="24"><%= t('olympiamanagement.edit') %></a>
<a href="<%=updata_student_data_olympiamanagements_path+"?id=#{field.id}&type=delete_student_data"%>"><img src="/assets/trash.gif" alt="<%= t('olympiamanagement.delete') %>" align="top" width="24"><%= t('olympiamanagement.delete') %></a>
</td>
<% end %>
<% end %>
</tr>
<%end%>
</tbody>
</table>
<% @extra_params = request.query_parameters.map{|key,value| key+'='+value}.join('&') %>
<%=create_pagination(params[:page].to_i,@student_fields,@extra_params).html_safe%>