commit
676ef6e176
|
@ -136,8 +136,14 @@ class AtController < ApplicationController
|
|||
#Message
|
||||
def find_message(id)
|
||||
message = Message.find(id)
|
||||
at_persons = message.board.messages.map(&:author)
|
||||
(at_persons || []) + (find_project(message.board.project_id)||[])
|
||||
if message.board.course_id.nil?
|
||||
at_persons = message.board.messages.map(&:author)
|
||||
(at_persons || []) + (find_project(message.board.project_id)||[])
|
||||
else
|
||||
type = 'Course'
|
||||
course_id = message.board.course_id
|
||||
find_at_users(type, course_id)
|
||||
end
|
||||
end
|
||||
|
||||
#News
|
||||
|
|
|
@ -121,7 +121,7 @@ class ForumsController < ApplicationController
|
|||
order = ""
|
||||
@order_str = ""
|
||||
if(params[:reorder_complex])
|
||||
order = "last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
|
||||
order = "replies_count #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
|
||||
@order_str = "reorder_complex="+params[:reorder_complex]
|
||||
elsif(params[:reorder_popu])
|
||||
order = "replies_count #{params[:reorder_popu]}"
|
||||
|
|
|
@ -318,6 +318,8 @@
|
|||
len = t.length;
|
||||
for(var i=0;i<len;i++){
|
||||
t[i].href = 'javascript:void(0)';
|
||||
// 火狐浏览器点击弹开空白页
|
||||
t[i].target = '_self';
|
||||
}
|
||||
// 退出按钮可用
|
||||
var d = document.getElementById("logout_trustie");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
@ -105,11 +105,18 @@
|
|||
<em class="talkWrapArrow"></em>
|
||||
<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} %>
|
||||
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
|
||||
<%= 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 nhname='new_message_<%= @topic.id%>' style="display:none;">
|
||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
||||
<input type="hidden" name="journal_id" value="<%= @topic.id %>"/>
|
||||
<div nhname='toolbar_container_<%= @topic.id %>' ></div>
|
||||
<div class="cl"></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @topic.id%>' name="content"></textarea>
|
||||
<div class="cl"></div>
|
||||
<span nhname='contentmsg_<%= @topic.id%>' class="fl"></span>
|
||||
<a id="new_message_submit_btn_<%= @topic.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
}
|
||||
}
|
||||
$(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 %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,15 +1,29 @@
|
|||
<%if @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}) %>");
|
||||
<% 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}) %>");
|
||||
<% end %>
|
||||
<% if @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}) %>");
|
||||
// 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%>
|
||||
$("#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 @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}) %>");
|
||||
<% end %>
|
||||
<% elsif @course %>
|
||||
$("#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 @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 %>
|
||||
$("#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}) %>");
|
||||
<%end%>
|
||||
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity");
|
||||
$("#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}) %>");
|
||||
<% end %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id %>, "", "100%", "UserActivity");
|
|
@ -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="pr">
|
||||
<div class="homepagePostPortrait">
|
||||
|
|
|
@ -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") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
|
|
Loading…
Reference in New Issue