54 lines
2.1 KiB
Plaintext
54 lines
2.1 KiB
Plaintext
<% # encoding: utf-8 %>
|
|
<%
|
|
data = action_data
|
|
@categories = data["categories"]
|
|
@archive_exam_test_types = data["archive_exam_test_types"]
|
|
@archive_exam_grades = data["archive_exam_grades"]
|
|
@archive_exam_colleges = data["archive_exam_colleges"]
|
|
@archive_exam_departments = data["archive_exam_departments"]
|
|
@archive_exam_subjects = data["archive_exam_subjects"]
|
|
%>
|
|
|
|
|
|
|
|
<ul class="nav nav-tabs" role="tablist" id="myTab">
|
|
|
|
<% @categories.each_with_index do |category,i| %>
|
|
<li role="presentation" class="<% i == 0 ? 'active' : '' %>"><a href="#a<%= i %>" aria-controls="<%= category.title %>" role="tab" data-toggle="tab"><%= category.title %></a></li>
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
<% @categories.each_with_index do |category,i| %>
|
|
<div role="tabpanel" class="tab-pane <% i == 0 ? 'active' : '' %>" id="a<%= i %>">
|
|
<p>
|
|
<form method='get' action="" target="_blank">
|
|
<%= t('archive_exam.test_type') %> <%= select_tag 'test_type', options_for_select(ArchiveExamFile.get_test_types(category)) %>
|
|
|
|
<% if category.title == '大學部' or category.title == 'University' %>
|
|
<%= t('archive_exam.grade') %> <%= select_tag 'grade', options_for_select(@archive_exam_grades.collect{ |u| [u.title, u.id] }) %>
|
|
<% end %>
|
|
|
|
<%= t('archive_exam.year') %> <%= select_year(DateTime.now.year, {:start_year => (DateTime.now.year - 1911), :end_year => (1998 - 1911), prompt: 'Select'}, {:name => 'year', :class => "span1"} ) %>
|
|
<%= t('archive_exam.college') %> <%= select_tag 'college', options_for_select(@archive_exam_colleges.collect{ |u| [u.title, u.id] }) %>
|
|
<%= t('archive_exam.department') %> <%= select_tag 'department', options_for_select(@archive_exam_departments.collect{ |u| [u.title, u.id] }) %>
|
|
<%= t('archive_exam.subject') %> <%= select_tag 'subject', options_for_select(@archive_exam_subjects.collect{ |u| [u.title, u.id] }) %>
|
|
<br />
|
|
<input type="hidden" name="category" value="<%= category.id%>">
|
|
<input type="hidden" name="method" value="result">
|
|
<input type="submit" value="<%= t('submit') %>">
|
|
</form>
|
|
</p>
|
|
</div>
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
$(function () {
|
|
$('#myTab a:first').tab('show')
|
|
})
|
|
</script> |