parent
57d05d147e
commit
3476731b83
@ -0,0 +1,25 @@
|
|||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
class AtController < ApplicationController
|
||||||
|
respond_to :js
|
||||||
|
|
||||||
|
def show
|
||||||
|
type = params[:type]
|
||||||
|
case type
|
||||||
|
when "Issue"
|
||||||
|
@users = find_issue(params)
|
||||||
|
else
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def find_issue(params)
|
||||||
|
#1. issues list persons
|
||||||
|
#2. project persons
|
||||||
|
issue = Issue.find(params[:id])
|
||||||
|
journals = issue.journals
|
||||||
|
at_persons = journals.map(&:user) + issue.project.users
|
||||||
|
at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id}
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,8 @@
|
|||||||
|
(function(){
|
||||||
|
window.atPersonLists = [];
|
||||||
|
<% @users && @users.each_with_index do |person,index| %>
|
||||||
|
var o = {id: <%=index%>, name: '<%=person.show_name%>', login: '<%=person.login%>', searchKey: '<%=person.get_at_show_name%>'};
|
||||||
|
atPersonLists.push(o);
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
})();
|
Loading…
Reference in new issue