<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>

<%= l(:label_course_news) %>

<%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>

<%=h @news.title %>

<% if @news.sticky == 1%> 置顶 <% end%> <%= link_to(l(:button_edit), edit_news_path(@news), :class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %> <%= delete_link(news_path(@news),:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>
<%= @news.description.html_safe %>
<%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
<%= link_to_attachments_course @news %>
<% if @news.commentable? %>

<%= l(:label_comment_add) %>

<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>

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

<% end %>
<% end %>
<% comments = @comments.reverse %> <% comments.each do |comment| %> <% next if comment.new_record? %>
<%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author), :class => "problem_pic fl"%>
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %> <%= format_time(comment.created_on) %>

<%= comment.comments.html_safe %>

<%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
<% end if @comments.any? %> <% content_for :header_tags do %> <%= stylesheet_link_tag 'scm' %> <% end %> <% html_title @news.title -%>