2015-04-08 15:49:53 +08:00
|
|
|
|
<script>
|
2015-03-26 11:02:18 +08:00
|
|
|
|
function clearMessage()
|
|
|
|
|
{
|
2015-04-08 15:49:53 +08:00
|
|
|
|
$("#news_comment").html("<%= escape_javascript(hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none') %><%= escape_javascript(kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字")%>");
|
2015-03-25 20:36:49 +08:00
|
|
|
|
}
|
2014-08-21 15:40:21 +08:00
|
|
|
|
</script>
|
2015-04-03 11:19:15 +08:00
|
|
|
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
<div class="project_r_h">
|
2015-03-26 15:55:07 +08:00
|
|
|
|
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="problem_main">
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>
|
|
|
|
|
<div class="problem_txt fl mt5">
|
2015-04-08 15:49:53 +08:00
|
|
|
|
<h4 class="r_txt_tit mb5">
|
|
|
|
|
<%=h @news.title %>
|
|
|
|
|
</h4>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
<%= link_to(l(:button_edit),
|
|
|
|
|
edit_news_path(@news),
|
2015-04-28 10:31:55 +08:00
|
|
|
|
:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
<%= delete_link(news_path(@news),:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>
|
|
|
|
|
<div class="cl"></div>
|
2015-04-10 15:43:37 +08:00
|
|
|
|
<div class="mb5 upload_img">
|
2015-04-08 15:49:53 +08:00
|
|
|
|
<%= @news.description.html_safe %>
|
|
|
|
|
<br />
|
|
|
|
|
<%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
|
|
|
|
|
</div>
|
2015-03-27 16:41:28 +08:00
|
|
|
|
<%= link_to_attachments_course @news %>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
<!--<a href="#" class=" link_file">附件:爱覅俄方if.zip(27.5kB)</a> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-03-26 11:02:18 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
2015-03-25 20:36:49 +08:00
|
|
|
|
<% if @news.commentable? %>
|
|
|
|
|
<div class="msg_box">
|
2015-03-26 11:02:18 +08:00
|
|
|
|
<h4><%= l(:label_comment_add) %></h4>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
|
2015-04-08 15:49:53 +08:00
|
|
|
|
<div class="box" id="news_comment">
|
2015-04-03 11:19:15 +08:00
|
|
|
|
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
|
|
|
|
<%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
</div>
|
2015-04-03 15:01:26 +08:00
|
|
|
|
<p class="mt10">
|
2015-04-08 15:49:53 +08:00
|
|
|
|
<a href="javascript:void(0)" class="grey_btn fr ml10" onclick="clearMessage();">
|
|
|
|
|
<%= l(:label_cancel_with_space) %>
|
|
|
|
|
</a>
|
|
|
|
|
<a href="javascript:void(0)" class="blue_btn fr" onclick="submitComment();">
|
|
|
|
|
<%= l(:label_comment_with_space) %>
|
|
|
|
|
</a>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-04-03 11:19:15 +08:00
|
|
|
|
|
2015-03-26 11:02:18 +08:00
|
|
|
|
<% comments = @comments.reverse %>
|
|
|
|
|
<% comments.each do |comment| %>
|
|
|
|
|
<% next if comment.new_record? %>
|
|
|
|
|
<div class="ping_C mb10">
|
|
|
|
|
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author)%></div>
|
|
|
|
|
<div class="ping_discon">
|
2015-04-24 09:10:15 +08:00
|
|
|
|
<div class="ping_distop upload_img break_word">
|
2015-04-08 15:49:53 +08:00
|
|
|
|
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %>
|
|
|
|
|
<span class="c_grey fr">
|
|
|
|
|
<%= format_time(comment.created_on) %>
|
|
|
|
|
</span>
|
2015-03-26 11:02:18 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-04-10 17:18:52 +08:00
|
|
|
|
<p><%= comment.comments.html_safe %></p>
|
2015-03-26 11:02:18 +08:00
|
|
|
|
</div>
|
2015-04-08 15:49:53 +08:00
|
|
|
|
<div class="ping_disfoot">
|
|
|
|
|
<%= 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) %>
|
2015-03-26 11:02:18 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
2015-03-25 20:36:49 +08:00
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
2015-03-26 11:02:18 +08:00
|
|
|
|
<% end if @comments.any? %>
|
2014-06-18 16:29:29 +08:00
|
|
|
|
|
2015-03-25 20:36:49 +08:00
|
|
|
|
|
2014-06-18 16:29:29 +08:00
|
|
|
|
|
2015-03-26 11:02:18 +08:00
|
|
|
|
<!--problem_main end-->
|
|
|
|
|
<% content_for :header_tags do %>
|
|
|
|
|
<%= stylesheet_link_tag 'scm' %>
|
|
|
|
|
<% end %>
|
2014-06-18 16:29:29 +08:00
|
|
|
|
|
|
|
|
|
|
2015-03-26 11:02:18 +08:00
|
|
|
|
<% html_title @news.title -%>
|