<% if !@post.group_post_files.blank? %>
<% @post.group_post_files.each do |gpf| %>
<%
case File.extname(gpf.file.path)
when ".doc",".docx",".DOC",".DOCX"
css_class = "fa-file-word-o"
when ".xls",".xlsx",".XLS",".XLSX"
css_class = "fa-file-excel-o"
when ".pdf", ".PDF"
css_class = "fa-file-pdf-o"
when ".txt", ".TXT"
css_class = "fa-file-text-o"
when ".ppt", ".pptx", ".PPT", ".PPTX"
css_class = "fa-file-powerpoint-o"
when ".mp3", ".MP3"
css_class = "fa-file-audio-o"
when ".gif",".GIF",".jpg",".JPG",".jpeg",".JPEG",".png",".PNG"
css_class = "fa-file-image-o"
when ".zip",".ZIP",".rar",".RAR"
css_class = "fa-file-zip-o"
end
%>
<%= File.basename(gpf.file.path) %>
<% end %>
<% end %>
<% if !@read_by_names.blank? %>
Join the group to comment on this post.
Comments
<%= render :partial => "post_comment", :collection => @post.group_post_comments.desc(:created_at) %> <% if @post.group_post_comments.length == 0 %>- No comments yet. <%= (user_can_write? ? "Be the first one!" : "") %>
<% end %>