Spen's changes in archive

This commit is contained in:
chris 2013-03-21 14:38:04 +08:00
parent ee8a78621a
commit 41311c74d0
2 changed files with 29 additions and 18 deletions

View File

@ -64,7 +64,7 @@ class ArchiveFile
def get_file_icon( file_data ) def get_file_icon( file_data )
file_icon = "<span class=\"o-archives-file-type\">#{file_data.split('.')[1]}</span>".html_safe file_icon = "<span class=\"o-archives-file-type\">#{file_data.split('.')[-1]}</span>".html_safe
end end
def save_archive_file_multiples def save_archive_file_multiples

View File

@ -1,19 +1,30 @@
<% # encoding: utf-8 %>
<% if @title %> <div class="o-archives">
<h1 class="h1"><%= @title %></h1> <div class="o-archives-content">
<% end %> <div class="o-archives-group">
<h2 class="o-archives-category h2"><%= @archive_file.archive_file_category.title rescue nil %></h2>
<h3><%= @archive_file.archive_file_category.title rescue nil %></h3> <div class="o-archives-content">
<div class="o-archives-list">
<%= @archive_file.title %> <ul>
<li>
<ol> <h3 class="o-archives-title h3"><%= @archive_file.title %></h3>
<div class="o-archives-list-item">
<ol>
<% @archive_file.archive_file_multiples.each do | afile | %> <% @archive_file.archive_file_multiples.each do | afile | %>
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
<li><%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title} %></li> <li>
<%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %>
<%= @archive_file.get_file_icon(afile.file.url) %>
</li>
<% end %> <% end %>
<% end %> <% end %>
</ol> </ol>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<%#= link_back %> <%= stylesheet_link_tag "archive/archives" %>