%= content_for :javascript do%>
<%if !selected_post%>
$("#collapsed_post_<%=post.id%>").show();
$("#expanded_post_<%=post.id%>").hide();
<%end%>
$("#expanded_post_<%=post.id%>").append("<%=(link_to t('collapse'), "javascript:collapse_post_#{post.id}()").gsub('"','\"')%>");
expand_post_<%=post.id%> = function(){
$("#collapsed_post_<%=post.id%>").hide();
$("#expanded_post_<%=post.id%>").show("normal");
}
collapse_post_<%=post.id%> = function(){
$("#expanded_post_<%=post.id%>").hide("normal", function(){
$("#collapsed_post_<%=post.id%>").show();
});
}
<%end%>
<%= div_for post do%>
<%if current_user.fellows.include?(post.author) or (space.present? && space.authorize?([:read, :performance],:to=> current_user))%>
<%= raw(link_logo(post.author,:size=>32, :url => user_path(post.author), :title=>post.author.name)) %>
<%else%>
<%=logo(post.author, :size=>32)%>
<%end%>
<%if current_user.fellows.include?(post.author) or (space.present? && space.authorize?([:read, :performance],:to=> current_user))%>
- Author: <%=link_to highlight(post.author.name, params[:query]), user_path(post.author)%> Thread: <%=link_to highlight(thread_title(post),@query), space_post_path(post.space, thread(post))%>
<%else%>
- Author: <%=highlight(post.author.name, params[:query])%> Thread: <%=link_to highlight(thread_title(post),@query), space_post_path(post.space, thread(post))%>
<%end%>
-
<%=sanitize(highlight(first_words(post.text,200),params[:query]))%>
<%=link_to t('more_arrows'), "javascript:expand_post_#{post.id}()"%>
-
<%=sanitize(highlight(post.text,params[:query]))%>
<%=link_to image_tag("icons/comment-edit.png", :alt => t('comment.edit')), get_edit_route(post), :title => t('comment.edit') if post.authorize?(:update, :to => current_user)%>
<%end%>