olympiamanagement/app/views/admin/olympiamanagements/index.html.erb

44 lines
2.3 KiB
Plaintext

<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 = ['sign_up_start_time','sign_up_end_time','school_number','enrollment','status','action']%>
<% time = ['year','month','day'] %>
<h3><%=t('olympiamanagement.history_contest')%></h3>
<table class="ts_rowsonly" width="100%">
<thead><tr>
<% th_name_list.each do |th_name| %>
<th><%=t('olympiamanagement.'+th_name) %></th>
<% end %>
</tr></thead>
<tbody>
<% @sign_up_settings.each do |sign_up_setting| %>
<tr>
<td><%= time.map{|td| sign_up_setting["start_#{td}"]}.join('-') %></td>
<td><%= time.map{|td| sign_up_setting["end_#{td}"]}.join('-') %></td>
<td><%= @school_number = OlympiaSchoolDataFields.where(:sign_up_setting_id=>sign_up_setting.id).length %></td>
<td><%= @student_number = OlympiaStudentDataField.where(:sign_up_setting_id=>sign_up_setting.id).length %></td>
<td>
<% if sign_up_setting.active%>
<span>
<img alt="<%=t('olympiamanagement.active')%>" src="/assets/ok.gif">
<%=t('olympiamanagement.active')%></img>
</span>
<% else %>
<span>
<img alt="<%=t('olympiamanagement.inactive')%>" src="/assets/close.gif">
<%=t('olympiamanagement.inactive')%></img>
</span>
<% end %>
</td>
<td>
<% if !sign_up_setting.active%>
<a class="btn" href='<%= admin_olympiamanagements_update_sign_up_data_path + "?type=active&id=#{sign_up_setting.id}"%>'><%=t('olympiamanagement.active')%></a>
<% end %>
<a class="btn" href='<%= admin_olympiamanagements_update_sign_up_data_path + "?type=view&id=#{sign_up_setting.id}"%>'><%=t('olympiamanagement.view')%></a>
<a class="btn" href="#" onclick="if( window.confirm('<%=t('olympiamanagement.please_confirm_delete')%>') ) { window.location='<%=admin_olympiamanagements_update_sign_up_data_path + "?type=delete_sign_up_setting&id=#{sign_up_setting.id}"%>'; }" onkeypress="if( window.confirm('<%=t('olympiamanagement.please_confirm_delete')%>') ) { window.location='<%=admin_olympiamanagements_update_sign_up_data_path + "?type=delete_sign_up_setting&id=#{sign_up_setting.id}"%>'; }"><%=t('olympiamanagement.delete')%></a>
</td>
</tr>
<% end %>
</tbody>
</table>
<%=create_pagination(params[:page].to_i,SignUpSetting.all).html_safe%>