项目主页动态列表中@功能不正常(课程应该也好了)

This commit is contained in:
daiao 2017-03-13 17:25:36 +08:00
parent 376847689a
commit 8866b91c8f
4 changed files with 34 additions and 14 deletions

View File

@ -88,7 +88,7 @@
} }
} }
$(function() { $(function() {
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>

View File

@ -1,15 +1,29 @@
<%if @project%> <% if @project %>
<% if params[:is_project] %> <% if params[:is_project] %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>"); $("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages',
<% else %> :locals => { :activity => @topic,
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); :user_activity_id => @user_activity_id,
<% end %> :is_course => @is_course,
:is_board => @is_board}) %>");
// ForgeActivity是具体项目的动态UserActivity是社区的动态
// sd_create_editor_from_data(<%#= @user_activity_id %>, "", "100%", "ForgeActivity");
<% else %>
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply',
:locals => { :activity => @topic,
:user_activity_id => @user_activity_id}) %>");
<%elsif @course%> <% end %>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); <% elsif @course %>
<%elsif @contest%> $("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply',
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/contest_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); :locals => { :activity => @topic,
:user_activity_id => @user_activity_id}) %>");
<% elsif @contest %>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/contest_message_post_reply',
:locals => { :activity => @topic,
:user_activity_id => @user_activity_id}) %>");
<% elsif @org_subfield %> <% elsif @org_subfield %>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply',
<%end%> :locals => { :activity => @topic,
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity"); :user_activity_id => @user_activity_id}) %>");
<% end %>
sd_create_editor_from_data(<%= @user_activity_id %>, "", "100%", "UserActivity");

View File

@ -1,3 +1,6 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
<div class="container-big mt10" id="user_activity_<%= user_activity_id%>"> <div class="container-big mt10" id="user_activity_<%= user_activity_id%>">
<div class="pr"> <div class="pr">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">

View File

@ -1,3 +1,6 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
<% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %> <% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %>
<% count = all_replies.count %> <% count = all_replies.count %>
<% no_children_comments = get_no_children_comments all_replies %> <% no_children_comments = get_no_children_comments all_replies %>