parent
fdf925a0b8
commit
7853b8aa54
@ -0,0 +1,20 @@
|
|||||||
|
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
|
||||||
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||||
|
<div class="ReplyToMessageInputContainer mb10">
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<div nhname='new_message_<%= reply.id%>'>
|
||||||
|
<%= form_for @comment, :as => :reply, :url => {:controller => 'comments',:action => 'reply', :id => @comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||||
|
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||||
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="content"></textarea>
|
||||||
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<%= render :partial => "users/show_unlogged" %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
@ -0,0 +1,10 @@
|
|||||||
|
<% if @user_activity_id %>
|
||||||
|
<% if @news.project_id && @news.project_id != -1 %>
|
||||||
|
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% elsif @news.course_id %>
|
||||||
|
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% elsif @news.org_subfield_id %>
|
||||||
|
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "<%=@news.class.to_s%>");
|
@ -0,0 +1,8 @@
|
|||||||
|
if($("#reply_message_<%= @comment.id%>").length > 0) {
|
||||||
|
$("#reply_message_<%= @comment.id%>").replaceWith("<%= escape_javascript(render :partial => 'comments/simple_ke_reply_form', :locals => {:reply => @comment}) %>");
|
||||||
|
$(function(){
|
||||||
|
sd_create_editor_from_data(<%= @comment.id%>,null,"100%", "<%=@comment.class.to_s%>");
|
||||||
|
});
|
||||||
|
}else if($("#reply_to_message_<%= @comment.id %>").length >0) {
|
||||||
|
$("#reply_to_message_<%= @comment.id%>").replaceWith("<p id='reply_message_<%= @comment.id %>'></p>");
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
<% if @user_activity_id %>
|
||||||
|
<% if @news.project_id && @news.project_id != -1 %>
|
||||||
|
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% elsif @news.course_id %>
|
||||||
|
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% elsif @news.org_subfield_id %>
|
||||||
|
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "<%=@news.class.to_s%>");
|
@ -1,60 +0,0 @@
|
|||||||
<ul>
|
|
||||||
<% comments.each do |comment| %>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function(){
|
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
|
||||||
autoUrl('reply_content_<%= comment.id %>');
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
|
||||||
<div class="homepagePostReplyPortrait">
|
|
||||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyDes">
|
|
||||||
<div class="homepagePostReplyPublisher">
|
|
||||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
|
||||||
<%= time_from_now(comment.created_on) %>
|
|
||||||
</div>
|
|
||||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
|
||||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
|
||||||
<% end %>
|
|
||||||
<% if !comment.content_detail.blank? %>
|
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
|
||||||
<%= comment.content_detail.html_safe %>
|
|
||||||
</div>
|
|
||||||
<div class="orig_reply mb10 mt-10">
|
|
||||||
<div class="reply">
|
|
||||||
<span class="reply-right">
|
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
</span>
|
|
||||||
<span style="position: relative" class="fr mr20">
|
|
||||||
<%= link_to(
|
|
||||||
l(:button_reply),
|
|
||||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage},
|
|
||||||
:remote => true,
|
|
||||||
:method => 'get',
|
|
||||||
:title => l(:button_reply)) if !comment.root.locked? %>
|
|
||||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
||||||
</span>
|
|
||||||
<% if comment.author == User.current %>
|
|
||||||
<%= link_to(
|
|
||||||
l(:button_delete),
|
|
||||||
{:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage},
|
|
||||||
:method => :delete,
|
|
||||||
:remote => true,
|
|
||||||
:class => 'fr mr20',
|
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
|
||||||
:title => l(:button_delete)) %>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p id="reply_message_<%= comment.id%>"></p>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
@ -1,75 +0,0 @@
|
|||||||
<ul>
|
|
||||||
<% comments.reorder("created_on desc").each do |comment| %>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function(){
|
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
|
||||||
autoUrl('reply_content_<%= comment.id %>');
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();">
|
|
||||||
<div class="homepagePostReplyPortrait">
|
|
||||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyDes">
|
|
||||||
<div class="homepagePostReplyPublisher">
|
|
||||||
<%= link_to comment.user.show_name, user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
|
||||||
<%= time_from_now(comment.created_on) %>
|
|
||||||
</div>
|
|
||||||
<% unless comment.m_parent_id.nil? %>
|
|
||||||
<% parents_rely = [] %>
|
|
||||||
<% parents_rely = get_reply_parents parents_rely, comment %>
|
|
||||||
<% length = parents_rely.length %>
|
|
||||||
<div id="comment_reply_<%=comment.id %>">
|
|
||||||
<% if length <= 3 %>
|
|
||||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
|
|
||||||
<% else %>
|
|
||||||
<div class="orig_cont clearfix">
|
|
||||||
<div class="orig_cont clearfix">
|
|
||||||
<div>
|
|
||||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
|
|
||||||
</div>
|
|
||||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
|
|
||||||
</div>
|
|
||||||
<div class="orig_cont_hide clearfix">
|
|
||||||
<span class="orig_icon" >↓ </span>
|
|
||||||
<span class="orig_icon" style="display:none;" > ↑</span>
|
|
||||||
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
|
|
||||||
</div>
|
|
||||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth t_txt" id="reply_content_<%= comment.id %>">
|
|
||||||
<%= comment.notes.html_safe %>
|
|
||||||
</div>
|
|
||||||
<div class="orig_reply mb10 mt-10">
|
|
||||||
<div class="reply">
|
|
||||||
<span class="reply-right">
|
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
</span>
|
|
||||||
<span style="position: relative" class="fr mr20">
|
|
||||||
<%= link_to(
|
|
||||||
l(:button_reply),
|
|
||||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
|
|
||||||
:remote => true,
|
|
||||||
:method => 'get',
|
|
||||||
:title => l(:button_reply)) %>
|
|
||||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
||||||
</span>
|
|
||||||
<!--<a action-type="reply" href="javascript:;" poped="false" class="fr mr20 linkGrey3" title="回复">回复</a>-->
|
|
||||||
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
|
||||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
|
|
||||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p id="reply_message_<%= comment.id%>"></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
@ -1,60 +0,0 @@
|
|||||||
<ul>
|
|
||||||
<% comments.each do |comment| %>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function(){
|
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
|
||||||
autoUrl('reply_content_<%= comment.id %>');
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
|
||||||
<div class="homepagePostReplyPortrait">
|
|
||||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyDes">
|
|
||||||
<div class="homepagePostReplyPublisher">
|
|
||||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
|
||||||
<%= time_from_now(comment.created_at) %>
|
|
||||||
</div>
|
|
||||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
|
||||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
|
||||||
<% end %>
|
|
||||||
<% if !comment.content_detail.blank? %>
|
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
|
||||||
<%= comment.content_detail.html_safe %>
|
|
||||||
</div>
|
|
||||||
<div class="orig_reply mb10 mt-10">
|
|
||||||
<div class="reply">
|
|
||||||
<span class="reply-right">
|
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
</span>
|
|
||||||
<span style="position: relative" class="fr mr20">
|
|
||||||
<%= link_to(
|
|
||||||
l(:button_reply),
|
|
||||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
|
||||||
:remote => true,
|
|
||||||
:method => 'get',
|
|
||||||
:title => l(:button_reply)) %>
|
|
||||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
||||||
</span>
|
|
||||||
<% if comment.creator_user == User.current %>
|
|
||||||
<%= link_to(
|
|
||||||
l(:button_delete),
|
|
||||||
{:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
|
|
||||||
:method => :delete,
|
|
||||||
:remote => true,
|
|
||||||
:class => 'fr mr20',
|
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
|
||||||
:title => l(:button_delete)) %>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p id="reply_message_<%= comment.id%>"></p>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
@ -1,13 +1,15 @@
|
|||||||
<% if params[:type] == 'HomeworkCommon' %>
|
<% if params[:type] == 'HomeworkCommon' %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
||||||
<% elsif params[:type] == 'JournalsForMessage' %>
|
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||||
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/journal_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>');
|
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>');
|
||||||
<% elsif params[:type] == 'Message' %>
|
<% elsif params[:type] == 'Message' %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>');
|
||||||
<% elsif params[:type] == 'BlogComment' %>
|
<% elsif params[:type] == 'BlogComment' %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/blog_comments_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage}) %>');
|
||||||
<% elsif params[:type] == 'OrgDocumentComment' %>
|
<% elsif params[:type] == 'OrgDocumentComment' %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/org_document_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
||||||
|
<% elsif params[:type] == 'News' %>
|
||||||
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
||||||
<% else %>
|
<% else %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
class AddColumnToComments < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :comments, :parent_id, :integer
|
||||||
|
add_column :comments, :comments_count, :integer, :default => 0
|
||||||
|
add_column :comments, :reply_id, :integer
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue