2015-12-06 15:03:36 +08:00
|
|
|
|
<%= content_for(:header_tags) do %>
|
|
|
|
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
2015-10-13 11:03:22 +08:00
|
|
|
|
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
function expand_reply(container,btnid){
|
|
|
|
|
var target = $(container).children();
|
|
|
|
|
var btn = $(btnid);
|
|
|
|
|
if(btn.data('init')=='0'){
|
|
|
|
|
btn.data('init',1);
|
2015-10-14 14:19:59 +08:00
|
|
|
|
btn.html('收起回复');
|
2015-10-09 14:39:40 +08:00
|
|
|
|
target.show();
|
|
|
|
|
}else{
|
|
|
|
|
btn.data('init',0);
|
2015-10-14 14:19:59 +08:00
|
|
|
|
btn.html('展开更多');
|
2015-10-09 14:39:40 +08:00
|
|
|
|
target.hide();
|
|
|
|
|
target.eq(0).show();
|
|
|
|
|
target.eq(1).show();
|
2015-10-14 14:19:59 +08:00
|
|
|
|
target.eq(2).show();
|
2015-10-09 14:39:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$(function() {
|
2016-01-29 16:55:07 +08:00
|
|
|
|
sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>");
|
2015-10-16 10:18:51 +08:00
|
|
|
|
showNormalImage('message_description_<%= @topic.id %>');
|
2015-10-09 14:39:40 +08:00
|
|
|
|
});
|
|
|
|
|
</script>
|
2015-10-15 16:17:48 +08:00
|
|
|
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="postThemeContainer">
|
|
|
|
|
<div class="postDetailPortrait">
|
2016-03-17 15:12:28 +08:00
|
|
|
|
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="postThemeWrap">
|
2015-12-31 14:00:33 +08:00
|
|
|
|
<% if User.current.logged? %>
|
2015-10-15 16:17:48 +08:00
|
|
|
|
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<ul>
|
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
|
<ul class="homepagePostSettiongText">
|
2015-12-31 14:00:33 +08:00
|
|
|
|
<li>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
|
) if @message.course_editable_by?(User.current) %>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => @topic},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
|
) if @message.course_destroyable_by?(User.current) %>
|
|
|
|
|
</li>
|
2016-01-25 14:19:39 +08:00
|
|
|
|
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<%end%>
|
2016-12-20 11:04:16 +08:00
|
|
|
|
<div class="postDetailTitle fl break_full_word">
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="postDetailCreater">
|
2016-06-21 16:53:31 +08:00
|
|
|
|
<%= link_to @topic.author.show_name, user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
2015-10-12 17:19:55 +08:00
|
|
|
|
</div>
|
2015-10-15 17:06:48 +08:00
|
|
|
|
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="cl"></div>
|
2016-12-20 11:04:16 +08:00
|
|
|
|
<div class="homepagePostIntro memo-content upload_img break_full_word ke-block" id="message_description_<%= @topic.id %>" >
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<%= @topic.content.html_safe%>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2016-01-22 17:05:58 +08:00
|
|
|
|
<div class="mt10" style="font-weight:normal;">
|
|
|
|
|
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-03-26 15:55:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="homepagePostReply">
|
|
|
|
|
<div class="homepagePostReplyBanner">
|
2016-04-29 16:23:36 +08:00
|
|
|
|
<div class="homepagePostReplyBannerCount">回复
|
|
|
|
|
<sapn class="mr15"><%= @reply_count>0 ? "(#{@reply_count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
|
|
|
<span id="praise_count_<%=@topic.id %>">
|
|
|
|
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@topic, :user_activity_id=>@topic.id,:type=>"activity"}%>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</div>
|
2016-09-23 16:44:49 +08:00
|
|
|
|
<%# all_comments = []%>
|
|
|
|
|
<%# comments = get_all_children(all_comments, @topic) %>
|
2016-09-30 14:26:16 +08:00
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
<%= render :partial => "messages/course_show_replies" %>
|
2014-06-19 15:50:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-10-16 16:31:31 +08:00
|
|
|
|
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
|
|
|
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
|
|
|
|
<em class="talkWrapArrow"></em>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
|
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
|
|
|
|
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
|
2016-07-06 15:43:48 +08:00
|
|
|
|
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
|
2015-10-16 16:31:31 +08:00
|
|
|
|
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</div>
|
2016-01-22 18:33:43 +08:00
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
2016-02-02 11:23:17 +08:00
|
|
|
|
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function(){
|
|
|
|
|
var postContent = $(this).html();
|
|
|
|
|
postContent = postContent.replace(/ /g," ");
|
|
|
|
|
postContent= postContent.replace(/ {2}/g," ");
|
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
|
$(this).html(postContent);
|
|
|
|
|
});
|
2016-05-20 15:30:25 +08:00
|
|
|
|
autoUrl('message_description_<%= @topic.id %>');
|
2016-01-22 18:33:43 +08:00
|
|
|
|
});
|
2016-01-29 16:55:07 +08:00
|
|
|
|
</script>
|