|
|
@ -4,22 +4,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function(){
|
|
|
|
$(function () {
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
$("#Container").css("width", "1000px");
|
|
|
|
$(".postRightContainer").css("margin-left", "0px");
|
|
|
|
$(".postRightContainer").css("margin-left", "0px");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
function expand_reply(container,btnid){
|
|
|
|
function expand_reply(container, btnid) {
|
|
|
|
var target = $(container).children();
|
|
|
|
var target = $(container).children();
|
|
|
|
var btn = $(btnid);
|
|
|
|
var btn = $(btnid);
|
|
|
|
if(btn.data('init')=='0'){
|
|
|
|
if (btn.data('init') == '0') {
|
|
|
|
btn.data('init',1);
|
|
|
|
btn.data('init', 1);
|
|
|
|
btn.html('收起回复');
|
|
|
|
btn.html('收起回复');
|
|
|
|
target.show();
|
|
|
|
target.show();
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
btn.data('init',0);
|
|
|
|
btn.data('init', 0);
|
|
|
|
btn.html('展开更多');
|
|
|
|
btn.html('展开更多');
|
|
|
|
target.hide();
|
|
|
|
target.hide();
|
|
|
|
target.eq(0).show();
|
|
|
|
target.eq(0).show();
|
|
|
@ -28,15 +28,12 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function course_board_canel_message_replay()
|
|
|
|
function course_board_canel_message_replay() {
|
|
|
|
{
|
|
|
|
|
|
|
|
message_content_editor.html("");
|
|
|
|
message_content_editor.html("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function course_board_submit_message_replay()
|
|
|
|
function course_board_submit_message_replay() {
|
|
|
|
{
|
|
|
|
if (MessageReplayVevify()) {
|
|
|
|
if(MessageReplayVevify())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
|
|
|
message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
|
|
|
$("#message_form").submit();
|
|
|
|
$("#message_form").submit();
|
|
|
|
|
|
|
|
|
|
|
@ -57,20 +54,20 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
$(function () {
|
|
|
|
//init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>");
|
|
|
|
//init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>");
|
|
|
|
sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>");
|
|
|
|
sd_create_editor_from_data(<%= @topic.id%>, null, "100%", "<%=@topic.class.to_s%>");
|
|
|
|
showNormalImage('message_description_<%= @topic.id %>');
|
|
|
|
showNormalImage('message_description_<%= @topic.id %>');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
|
|
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
|
|
|
<div class="postThemeContainer">
|
|
|
|
<div class="postThemeContainer">
|
|
|
|
<div class="postDetailPortrait">
|
|
|
|
<div class="postDetailPortrait">
|
|
|
|
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
|
|
|
|
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50, :alt => '图像'), user_path(@topic.author) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="postThemeWrap">
|
|
|
|
<div class="postThemeWrap">
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
|
|
|
|
<div class="homepagePostSetting" id="message_setting_<%= @topic.id %>" style="display: none">
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
@ -90,29 +87,29 @@
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
) if @message.org_subfield_editable_by?(User.current) %>
|
|
|
|
) if @message.org_subfield_editable_by?(User.current) %>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');",:class => 'postOptionLink'%></li>
|
|
|
|
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => 'postOptionLink' %></li>
|
|
|
|
<!--<li> <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>-->
|
|
|
|
<!--<li> <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>-->
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<%end%>
|
|
|
|
<% end %>
|
|
|
|
<div class="postDetailTitle fl">
|
|
|
|
<div class="postDetailTitle fl">
|
|
|
|
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
|
|
|
|
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject %></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="postDetailCreater">
|
|
|
|
<div class="postDetailCreater">
|
|
|
|
<%= link_to @topic.author.show_name, user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
|
|
<%= link_to @topic.author.show_name, user_path(@topic.author, :host => Setting.host_user), :class => "linkBlue2", :target => "_blank" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
|
|
|
<div class="postDetailDate mb5"><%= format_time(@topic.created_on) %></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<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;" >
|
|
|
|
<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%>
|
|
|
|
<%= @topic.content.html_safe %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="mt10" style="font-weight:normal;">
|
|
|
|
<div class="mt10" style="font-weight:normal;">
|
|
|
|
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %>
|
|
|
|
<%= render :partial => "attachments/activity_attach", :locals => {:activity => @topic} %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
@ -121,49 +118,69 @@
|
|
|
|
<div class="homepagePostReply">
|
|
|
|
<div class="homepagePostReply">
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
<div class="homepagePostReplyBanner">
|
|
|
|
<div class="homepagePostReplyBanner">
|
|
|
|
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
|
|
|
<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>
|
|
|
|
<div class="homepagePostReplyBannerTime"></div>
|
|
|
|
<div class="homepagePostReplyBannerTime"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
<% all_comments = [] %>
|
|
|
|
<% @replies.each_with_index do |reply,i| %>
|
|
|
|
<% comments = get_all_children(all_comments, @topic) %>
|
|
|
|
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
|
|
|
<% comments.each_with_index do |reply, i| %>
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function(){
|
|
|
|
$(function () {
|
|
|
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
|
|
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
|
|
|
autoUrl('reply_message_description_<%= reply.id %>');
|
|
|
|
autoUrl('reply_message_description_<%= reply.id %>');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
|
|
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
|
|
|
<div class="homepagePostReplyPortrait">
|
|
|
|
<div class="homepagePostReplyPortrait">
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="homepagePostReplyDes">
|
|
|
|
<div class="homepagePostReplyDes">
|
|
|
|
<div class="homepagePostReplyPublisher">
|
|
|
|
<div class="homepagePostReplyPublisher">
|
|
|
|
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
|
|
<%= link_to reply.creator_user.show_name, user_url_in_org(reply.creator_user.id), :class => "newsBlue mr10 f14" %>
|
|
|
|
|
|
|
|
<%= time_from_now(reply.created_on) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% if !reply.parent.nil? && !reply.parent.parent.nil? %>
|
|
|
|
|
|
|
|
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
|
|
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
|
|
|
<%= reply.content.html_safe%>
|
|
|
|
<%= reply.content.html_safe %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
|
|
|
<div class="orig_reply mb10 mt-10">
|
|
|
|
<%= format_time(reply.created_on) %>
|
|
|
|
<div class="reply">
|
|
|
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
|
|
|
<span class="reply-right">
|
|
|
|
<%= link_to(
|
|
|
|
<span id="reply_praise_count_<%= reply.id %>">
|
|
|
|
l(:button_reply),
|
|
|
|
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
|
|
|
{:action => 'quote', :id => reply},
|
|
|
|
</span>
|
|
|
|
:remote => true,
|
|
|
|
<span style="position: relative" class="fr mr20">
|
|
|
|
:method => 'get',
|
|
|
|
<%= link_to(
|
|
|
|
:class => 'fr newsBlue',
|
|
|
|
l(:button_reply),
|
|
|
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
{:action => 'quote', :id => reply},
|
|
|
|
<%= link_to(
|
|
|
|
:remote => true,
|
|
|
|
l(:button_delete),
|
|
|
|
:method => 'get',
|
|
|
|
{:action => 'destroy', :id => reply},
|
|
|
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
:method => :post,
|
|
|
|
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
|
|
:class => 'fr newsGrey mr10',
|
|
|
|
</span>
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
<%= link_to(
|
|
|
|
:title => l(:button_delete)
|
|
|
|
l(:button_delete),
|
|
|
|
) if reply.org_subfield_editable_by?(User.current) %>
|
|
|
|
{: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>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p id="reply_message_<%= reply.id%>"></p>
|
|
|
|
<p id="reply_message_<%= reply.id %>"></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -175,6 +192,7 @@
|
|
|
|
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
|
|
|
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
|
|
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
|
|
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
|
|
|
<em class="talkWrapArrow"></em>
|
|
|
|
<em class="talkWrapArrow"></em>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
|
|
|
|
<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| %>
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
|
|
@ -189,13 +207,13 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function(){
|
|
|
|
$(function () {
|
|
|
|
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function(){
|
|
|
|
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function () {
|
|
|
|
var postContent = $(this).html();
|
|
|
|
var postContent = $(this).html();
|
|
|
|
postContent = postContent.replace(/ /g," ");
|
|
|
|
postContent = postContent.replace(/ /g, " ");
|
|
|
|
postContent= postContent.replace(/ {2}/g," ");
|
|
|
|
postContent = postContent.replace(/ {2}/g, " ");
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
postContent = postContent.replace(/ /g, " ");
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
postContent = postContent.replace(/ /g, " ");
|
|
|
|
$(this).html(postContent);
|
|
|
|
$(this).html(postContent);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
autoUrl('message_description_<%= @topic.id %>');
|
|
|
|
autoUrl('message_description_<%= @topic.id %>');
|
|
|
|