2015-12-30 15:46:01 +08:00
|
|
|
|
<%= content_for(:header_tags) do %>
|
|
|
|
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
$(function () {
|
2015-12-30 15:46:01 +08:00
|
|
|
|
$("#RSide").removeAttr("id");
|
2016-07-14 17:23:48 +08:00
|
|
|
|
$("#Container").css("width", "1000px");
|
2015-12-30 18:25:56 +08:00
|
|
|
|
$(".postRightContainer").css("margin-left", "0px");
|
2015-12-30 15:46:01 +08:00
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
function expand_reply(container, btnid) {
|
2015-12-30 15:46:01 +08:00
|
|
|
|
var target = $(container).children();
|
|
|
|
|
var btn = $(btnid);
|
2016-07-14 17:23:48 +08:00
|
|
|
|
if (btn.data('init') == '0') {
|
|
|
|
|
btn.data('init', 1);
|
2015-12-30 15:46:01 +08:00
|
|
|
|
btn.html('收起回复');
|
|
|
|
|
target.show();
|
2016-07-14 17:23:48 +08:00
|
|
|
|
} else {
|
|
|
|
|
btn.data('init', 0);
|
2015-12-30 15:46:01 +08:00
|
|
|
|
btn.html('展开更多');
|
|
|
|
|
target.hide();
|
|
|
|
|
target.eq(0).show();
|
|
|
|
|
target.eq(1).show();
|
|
|
|
|
target.eq(2).show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-14 17:23:48 +08:00
|
|
|
|
function course_board_canel_message_replay() {
|
2015-12-30 15:46:01 +08:00
|
|
|
|
message_content_editor.html("");
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-14 17:23:48 +08:00
|
|
|
|
function course_board_submit_message_replay() {
|
|
|
|
|
if (MessageReplayVevify()) {
|
2015-12-30 15:46:01 +08:00
|
|
|
|
message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
|
|
|
|
$("#message_form").submit();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MessageReplayVevify() {
|
|
|
|
|
var content = message_content_editor.html();//$.trim($("#message_content").val());
|
|
|
|
|
if (message_content_editor.isEmpty()) {
|
|
|
|
|
$("#message_content_span").text("回复不能为空");
|
|
|
|
|
$("#message_content_span").css('color', '#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$("#message_content_span").text("填写正确");
|
|
|
|
|
$("#message_content_span").css('color', '#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-14 17:23:48 +08:00
|
|
|
|
$(function () {
|
2016-02-02 15:51:18 +08:00
|
|
|
|
//init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>");
|
2016-07-14 17:23:48 +08:00
|
|
|
|
sd_create_editor_from_data(<%= @topic.id%>, null, "100%", "<%=@topic.class.to_s%>");
|
2015-12-30 15:46:01 +08:00
|
|
|
|
showNormalImage('message_description_<%= @topic.id %>');
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
|
|
|
|
<div class="postThemeContainer">
|
|
|
|
|
<div class="postDetailPortrait">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50, :alt => '图像'), user_path(@topic.author) %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="postThemeWrap">
|
2016-01-27 16:12:34 +08:00
|
|
|
|
<% if User.current.logged? %>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<div class="homepagePostSetting" id="message_setting_<%= @topic.id %>" style="display: none">
|
2015-12-30 15:46:01 +08:00
|
|
|
|
<ul>
|
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
|
<li>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
|
) if @message.org_subfield_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.org_subfield_editable_by?(User.current) %>
|
|
|
|
|
</li>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => 'postOptionLink' %></li>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
<!--<li> <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>-->
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<% end %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
<div class="postDetailTitle fl">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject %></a>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
<div class="postDetailCreater">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<%= link_to @topic.author.show_name, user_path(@topic.author, :host => Setting.host_user), :class => "linkBlue2", :target => "_blank" %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<div class="postDetailDate mb5"><%= format_time(@topic.created_on) %></div>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
<div class="cl"></div>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;">
|
|
|
|
|
<%= @topic.content.html_safe %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2016-01-22 17:05:58 +08:00
|
|
|
|
<div class="mt10" style="font-weight:normal;">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<%= render :partial => "attachments/activity_attach", :locals => {:activity => @topic} %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="homepagePostReply">
|
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
|
<div class="homepagePostReplyBanner">
|
2016-07-14 17:23:48 +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-12-30 15:46:01 +08:00
|
|
|
|
<div class="homepagePostReplyBannerTime"></div>
|
|
|
|
|
</div>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<% all_comments = [] %>
|
|
|
|
|
<% comments = get_all_children(all_comments, @topic) %>
|
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
<% comments.each_with_index do |reply, i| %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
<script type="text/javascript">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
$(function () {
|
2015-12-30 15:46:01 +08:00
|
|
|
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
2016-05-20 15:30:25 +08:00
|
|
|
|
autoUrl('reply_message_description_<%= reply.id %>');
|
2015-12-30 15:46:01 +08:00
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
|
|
|
|
<div class="homepagePostReplyPortrait">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="homepagePostReplyDes">
|
2016-07-21 10:30:48 +08:00
|
|
|
|
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
|
|
|
|
|
|
2015-12-30 15:46:01 +08:00
|
|
|
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<%= reply.content.html_safe %>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<div class="orig_reply mb10 mt-10">
|
|
|
|
|
<div class="reply">
|
|
|
|
|
<span class="reply-right">
|
|
|
|
|
<span id="reply_praise_count_<%= reply.id %>">
|
|
|
|
|
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
|
|
|
|
</span>
|
|
|
|
|
<span style="position: relative" class="fr mr20">
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_reply),
|
|
|
|
|
{:action => 'quote', :id => reply},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
|
|
|
</span>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => reply},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:class => 'fr mr20',
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:title => l(:button_delete)
|
|
|
|
|
) if reply.course_destroyable_by?(User.current) %>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
<p id="reply_message_<%= reply.id %>"></p>
|
2015-12-30 15:46:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
|
|
|
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
|
|
|
|
<em class="talkWrapArrow"></em>
|
2016-07-14 17:23:48 +08:00
|
|
|
|
|
2015-12-30 15:46:01 +08:00
|
|
|
|
<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-12-30 15:46:01 +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 %>
|
|
|
|
|
</div>
|
2016-01-22 18:33:43 +08:00
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
2016-07-14 17:23:48 +08:00
|
|
|
|
$(function () {
|
|
|
|
|
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function () {
|
2016-02-02 15:51:18 +08:00
|
|
|
|
var postContent = $(this).html();
|
2016-07-14 17:23:48 +08:00
|
|
|
|
postContent = postContent.replace(/ /g, " ");
|
|
|
|
|
postContent = postContent.replace(/ {2}/g, " ");
|
|
|
|
|
postContent = postContent.replace(/ /g, " ");
|
|
|
|
|
postContent = postContent.replace(/ /g, " ");
|
2016-02-02 15:51:18 +08:00
|
|
|
|
$(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-26 11:05:25 +08:00
|
|
|
|
</script>
|