archive_exam/app/views/archive_exams/result.html.erb

62 lines
1.5 KiB
Plaintext

<% # encoding: utf-8 %>
<%
data = action_data
@cagetoey = data["cagetoey"]
@archive_exam_files = data["archive_exam_files"]
@test_type = data["test_type"]
@grade = data["grade"]
@year = data["year"]
@college = data["college"]
@department = data["department"]
@subject = data["subject"]
%>
<%= @test_type %>
<%= @grade %>
<%= @year %>
<%= @college %>
<%= @department %>
<%= @subject %>
<% if !@archive_exam_files.blank? %>
<h4 class="i-archive_exam__category-title"><%= @category %></h4>
<ul>
<% @archive_exam_files.collect do |archive_exam| %>
<li>
<dl>
<div class="i-archive_exam__item-wrap">
<dt class="i-archive_exam__category-item">
<sapn class="i-archive_exam__archive_exam-title"><%= archive_exam.title %></span>
</dt>
<dl class="i-archive_exam__file-list">
<%
files = archive_exam.archive_exam_file_multiples.order_by(:sort_number=>'asc').collect do |file|
title = (file.file_title.blank? ? File.basename(file.file.path) : file.file_title) rescue ""
extension = file.file.file.extension.downcase rescue ""
url = file.file.url rescue ""
%>
<dd class="i-archive_exam__file-wrap">
<a class="i-archive_exam__file-name" href="<%= url %>" target="_blank"><%= title %></a>
<span class="i-archive_exam__file-type label label-primary"><%= extension %></span>
</dd>
<% end %>
</dl>
</div>
</dl>
</li>
<% end %>
</ul>
<% else %>
<p>
no data
</p>
<% end %>