commit
676ef6e176
|
@ -136,8 +136,14 @@ class AtController < ApplicationController
|
||||||
#Message
|
#Message
|
||||||
def find_message(id)
|
def find_message(id)
|
||||||
message = Message.find(id)
|
message = Message.find(id)
|
||||||
|
if message.board.course_id.nil?
|
||||||
at_persons = message.board.messages.map(&:author)
|
at_persons = message.board.messages.map(&:author)
|
||||||
(at_persons || []) + (find_project(message.board.project_id)||[])
|
(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
|
end
|
||||||
|
|
||||||
#News
|
#News
|
||||||
|
|
|
@ -121,7 +121,7 @@ class ForumsController < ApplicationController
|
||||||
order = ""
|
order = ""
|
||||||
@order_str = ""
|
@order_str = ""
|
||||||
if(params[:reorder_complex])
|
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]
|
@order_str = "reorder_complex="+params[:reorder_complex]
|
||||||
elsif(params[:reorder_popu])
|
elsif(params[:reorder_popu])
|
||||||
order = "replies_count #{params[:reorder_popu]}"
|
order = "replies_count #{params[:reorder_popu]}"
|
||||||
|
|
|
@ -318,6 +318,8 @@
|
||||||
len = t.length;
|
len = t.length;
|
||||||
for(var i=0;i<len;i++){
|
for(var i=0;i<len;i++){
|
||||||
t[i].href = 'javascript:void(0)';
|
t[i].href = 'javascript:void(0)';
|
||||||
|
// 火狐浏览器点击弹开空白页
|
||||||
|
t[i].target = '_self';
|
||||||
}
|
}
|
||||||
// 退出按钮可用
|
// 退出按钮可用
|
||||||
var d = document.getElementById("logout_trustie");
|
var d = document.getElementById("logout_trustie");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<%= content_for(:header_tags) do %>
|
<%= 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 %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,11 +105,18 @@
|
||||||
<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 %>">
|
||||||
|
<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| %>
|
<%= 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} %>
|
<input type="hidden" name="journal_id" value="<%= @topic.id %>"/>
|
||||||
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
|
<div nhname='toolbar_container_<%= @topic.id %>' ></div>
|
||||||
<%= 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;" %>
|
<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 %>
|
<% end %>
|
||||||
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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");
|
|
@ -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">
|
||||||
|
|
|
@ -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 %>
|
||||||
|
|
Loading…
Reference in New Issue