留言页面的动态内容不生成链接,留言回复的样式更改

This commit is contained in:
cxt 2016-01-22 20:11:49 +08:00
parent c4a264f8a6
commit 3de8687440
5 changed files with 23 additions and 12 deletions

View File

@ -76,6 +76,7 @@ class WordsController < ApplicationController
@reply_type = params[:reply_type]
@user_activity_id = params[:user_activity_id]
@activity = JournalsForMessage.find(parent_id)
@is_activity = params[:is_activity]
}
end

View File

@ -111,7 +111,7 @@
<% case user_activity.act_type.to_s %>
<% when 'JournalsForMessage' %>
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>true} %>
<% end %>
<% end %>
<% end %>

View File

@ -16,13 +16,22 @@
<% end %>
<% end %>
</div>
<div class="homepagePostTitle break_word list_style upload_img">
<% if activity.parent %>
<%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% else %>
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% end %>
</div>
<% if is_activity %>
<div class="homepagePostTitle break_word list_style upload_img">
<% if activity.parent %>
<%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% else %>
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% end %>
</div>
<% else %>
<% if activity.parent %>
<% content = activity.parent.notes %>
<% else %>
<% content = activity.notes %>
<% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<% end %>
<div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %>
</div>
@ -85,10 +94,10 @@
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= user_activity_id %>">
<%= comment.notes.html_safe %>
</div>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<% end %>
@ -104,6 +113,7 @@
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
<%= hidden_field_tag 'reply_type',params[:reply_type],:value =>'user' %>
<%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>

View File

@ -22,7 +22,7 @@
init_activity_KindEditor_data(<%= jour.id%>, null, "87%", "<%=jour.class.to_s%>");
});
</script>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>false} %>
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
<% end %>
<%end%>

View File

@ -1,9 +1,9 @@
<% if @save_succ %>
<% if @user_activity_id %>
<% if @reply_type == 'user' %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% end %>
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
<% else %>