个人留言中的at启用

dev_hjq
guange 10 years ago
parent fc0b589760
commit d8ef2f0965

@ -34,6 +34,12 @@ class AtController < ApplicationController
find_homework(id) find_homework(id)
when 'Topic' when 'Topic'
find_topic(id) find_topic(id)
when 'JournalsForMessage'
find_journals_for_message(id)
when 'Principal'
find_principal(id)
when 'All'
nil
else else
nil nil
end end
@ -120,7 +126,11 @@ class AtController < ApplicationController
#JournalsForMessage #JournalsForMessage
def find_journals_for_message(id) def find_journals_for_message(id)
jounrnal = JournalsForMessage.find(id) jounrnal = JournalsForMessage.find(id)
find_at_users(jounrnal.jour_type, jounrnal.jour_id) if jounrnal.jour_type == 'Principal'
[jounrnal.user] + (JournalsForMessage.where(m_reply_id: id).map(&:user) || [])
else
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
end
end end
#Poll #Poll
@ -129,8 +139,6 @@ class AtController < ApplicationController
#Journal #Journal
def find_journal(id) def find_journal(id)
journal = Journal.find(id)
find_at_users(journal.journalized_type, journal.journalized_id)
end end
#Document #Document
@ -145,7 +153,6 @@ class AtController < ApplicationController
#Principal #Principal
def find_principal(id) def find_principal(id)
end end
#BlogComment #BlogComment

@ -47,7 +47,11 @@ class AtMessage < ActiveRecord::Base
"回复帖子: " "回复帖子: "
end + at_message.subject end + at_message.subject
when 'JournalsForMessage' when 'JournalsForMessage'
"作业: #{at_message.jour.name} 中留言" if at_message.jour_type == 'Principal'
"留言: 在#{at_message.at_user.show_name}主页中留言"
else
"作业: #{at_message.jour.name} 中留言"
end
else else
logger.error "error type: #{at_message_type}" logger.error "error type: #{at_message_type}"
end end
@ -92,7 +96,12 @@ class AtMessage < ActiveRecord::Base
when 'Message' when 'Message'
{controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board} {controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board}
when 'JournalsForMessage' when 'JournalsForMessage'
{controller: :homework_common, action: :index, course: at_message.jour.course_id} if at_message.jour_type == 'Principal'
{controller: :users, action: :user_messages, id: at_message.at_user}
else
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
end
else else
logger.error "error type: #{at_message_type}" logger.error "error type: #{at_message_type}"
end end

@ -12,7 +12,8 @@
:minHeight=>40, :minHeight=>40,
:input_html => { :id => 'jour_content', :input_html => { :id => 'jour_content',
:class => 'talk_text fl', :class => 'talk_text fl',
:maxlength => 5000 }%> :maxlength => 5000 }
%>
<div class="cl"></div> <div class="cl"></div>
<p id="jour_content_span"></p> <p id="jour_content_span"></p>
</li> </li>

@ -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) %>
<%#= javascript_include_tag "init_KindEditor","user" %> <%#= javascript_include_tag "init_KindEditor","user" %>
<% end %> <% end %>
<style type="text/css"> <style type="text/css">

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save