课程动态二级回复,讨论区一级/二级回复增加AT功能

This commit is contained in:
daiao 2017-03-13 15:59:28 +08:00
parent cfcf12d7ed
commit 376847689a
2 changed files with 21 additions and 8 deletions

View File

@ -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

View File

@ -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>