faq show fix

This commit is contained in:
Spen 2013-04-08 17:45:22 +08:00 committed by Matt K. Fu
parent a4ebe31ada
commit 0734f73291
1 changed files with 26 additions and 25 deletions

View File

@ -1,31 +1,32 @@
<h1 class="h1"><%= @qa.title %></h1>
<h1 class="h1"><%= @qa.question %></h1>
<div class="info">
<div class="info1">
<span><%= t(:category) %> : <%= @qa.qa_category.title rescue nil %></span>
</div>
<div class="info1">
<span><%= t(:category) %><%= @qa.qa_category.title rescue nil %></span>
</div>
</div>
<div class="news_paragraph">
<%= @qa.answer.html_safe rescue '' %>
<%= @qa.answer.html_safe rescue '' %>
</div>
<div class="linkAndFile">
<% if @qa.qa_links.size > 0 %>
<div>
<i class="icons-link"></i>
<div class="showLink">
<% @qa.qa_links.each do | blink | %>
<%= link_to blink.title, blink.url, :target => '_blank' %>
<% end %>
</div>
</div>
<% end %>
<% if @qa.qa_files.size > 0 %>
<div>
<i class="icons-paperclip"></i>
<div class="showFile">
<% @qa.qa_files.each do | bfile | %>
<%= link_to bfile.title, bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
<% end %>
</div>
</div>
<% end %>
<% if @qa.qa_links.size > 0 %>
<div>
<i class="icons-link"></i>
<div class="showLink">
<% @qa.qa_links.each do | blink | %>
<%= link_to blink.title, blink.url, :target => '_blank' %>
<% end %>
</div>
</div>
<% end %>
<% if @qa.qa_files.size > 0 %>
<div>
<i class="icons-paperclip"></i>
<div class="showFile">
<% @qa.qa_files.each do | bfile | %>
<%= link_to bfile.title, bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
<% end %>
</div>
</div>
<% end %>
</div>