<%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %>
<%= link_to image_tag(url_to_avatar(@news.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@news.author) %>
<% if User.current.allowed_to?(:manage_news, @course)%> <% elsif User.current.logged? %> <%end%>
<% if @news.try(:author).try(:realname) == ' ' %> <%= link_to @news.try(:author), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> <% else %> <%= link_to @news.try(:author).try(:realname), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> <% end %>
<%= format_time( @news.created_on)%>
<%= @news.description.html_safe%>
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @news} %>
回复 <%= @comments.count>0 ? "(#{@comments.count})" : "" %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@news, :user_activity_id=>@news.id,:type=>"activity"}%>
<% unless @comments.empty? %>
<% @comments.each_with_index do |reply,i| %>
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
<% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <% else %> <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <% end %>
<%= reply.comments.html_safe%>
<%= format_time(reply.created_on) %>

<% end %>
<% end %>
<% if @news.commentable? %>
<%= form_for @comment, :url=>{:controller => 'comments', :action => 'create', :id => @news}, :html => {:multipart => true, :id => 'add_comment_form'} do |f| %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= f.kindeditor :comments, :editor_id => 'comment_editor', :owner_id => @comment.nil? ? 0: @comment.id, :owner_type => OwnerTypeHelper::COMMENT, :width => '99%', :height => 100, :minHeight=>100, :input_html => { :id => 'comment_content', :class => 'talk_text fl', :maxlength => 5000 }%>

<%= l(:label_cancel_with_space) %> <%= l(:label_comment_with_space) %>

<% end %>
<% end %>