Improves popups for users and organizations.
This commit is contained in:
parent
c6d7e061f8
commit
e0a59f86a0
7 changed files with 54 additions and 10 deletions
|
@ -281,7 +281,7 @@ class App.Controller extends Spine.Controller
|
||||||
if user[item.name]
|
if user[item.name]
|
||||||
|
|
||||||
# do not show firstname and lastname / already show via diplayName()
|
# do not show firstname and lastname / already show via diplayName()
|
||||||
if item.name isnt 'firstname' && item.name isnt 'lastname'
|
if item.name isnt 'firstname' && item.name isnt 'lastname' && item.name isnt 'organization'
|
||||||
if item.info #&& ( @user[item.name] || item.name isnt 'note' )
|
if item.info #&& ( @user[item.name] || item.name isnt 'note' )
|
||||||
data.push item
|
data.push item
|
||||||
|
|
||||||
|
|
|
@ -92,14 +92,24 @@ class App.Navigation extends App.Controller
|
||||||
processData: true,
|
processData: true,
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
# load user collection
|
|
||||||
if data.load.organizations
|
|
||||||
App.Collection.load( type: 'Organization', data: data.load.organizations )
|
|
||||||
|
|
||||||
# load user collection
|
# load user collection
|
||||||
if data.load.users
|
if data.load.users
|
||||||
App.Collection.load( type: 'User', data: data.load.users )
|
App.Collection.load( type: 'User', data: data.load.users )
|
||||||
|
|
||||||
|
# load user collection
|
||||||
|
if data.load.organizations
|
||||||
|
console.log(999999999)
|
||||||
|
for organization_id, organization of data.load.organizations
|
||||||
|
console.log(2222, organization)
|
||||||
|
if organization.user_ids
|
||||||
|
organization.users = []
|
||||||
|
for user_id in organization.user_ids
|
||||||
|
user = App.Collection.find( 'User', user_id )
|
||||||
|
console.log(111, user_id)
|
||||||
|
organization.users.push user
|
||||||
|
App.Collection.load( type: 'Organization', data: data.load.organizations )
|
||||||
|
|
||||||
|
|
||||||
# load ticket collection
|
# load ticket collection
|
||||||
if data.load.tickets
|
if data.load.tickets
|
||||||
App.Collection.load( type: 'Ticket', data: data.load.tickets )
|
App.Collection.load( type: 'Ticket', data: data.load.tickets )
|
||||||
|
|
|
@ -24,7 +24,7 @@ class App.UserInfo extends App.Controller
|
||||||
if user[item.name]
|
if user[item.name]
|
||||||
|
|
||||||
# do not show firstname and lastname / already show via diplayName()
|
# do not show firstname and lastname / already show via diplayName()
|
||||||
if item.name isnt 'firstname' && item.name isnt 'lastname'
|
if item.name isnt 'firstname' && item.name isnt 'lastname' && item.name isnt 'organization'
|
||||||
if item.info
|
if item.info
|
||||||
data.push item
|
data.push item
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,18 @@
|
||||||
<table style="width: 100%;">
|
<table style="width: 100%;">
|
||||||
<tr>
|
<tr>
|
||||||
<td><%- @P( @organization ) %></td>
|
<td><%- @T( 'Shared' ) %></td>
|
||||||
<td>...</td>
|
<td><%- @P( @organization.shared ) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
<tr>
|
||||||
|
<td><%- @T( 'Note' ) %></td>
|
||||||
|
<td><%- @P( @organization.note ) %></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<% if @organization.users: %>
|
||||||
|
<strong><%- @T('Users') %></strong>
|
||||||
|
<ul>
|
||||||
|
<% for user in @organization.users: %>
|
||||||
|
<li><%= user.displayName() %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
|
|
@ -20,6 +20,14 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @user['organization']: %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="customer-info">
|
||||||
|
<strong><%- @T( 'Organization' ) %></strong><br/>
|
||||||
|
<%- @P( @user['organization'] ) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<% if !_.isEmpty(@user['accounts']): %>
|
<% if !_.isEmpty(@user['accounts']): %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="customer-info">
|
<div class="customer-info">
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @user['organization']: %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="customer-info">
|
||||||
|
<strong><%- @T( 'Organization' ) %></strong><br/>
|
||||||
|
<%- @P( @user['organization'] ) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<% if !_.isEmpty(@user['accounts']): %>
|
<% if !_.isEmpty(@user['accounts']): %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="customer-info">
|
<div class="customer-info">
|
||||||
|
|
|
@ -40,7 +40,13 @@ class SearchController < ApplicationController
|
||||||
organization_result = []
|
organization_result = []
|
||||||
organizations.each do |organization|
|
organizations.each do |organization|
|
||||||
organization_result.push organization.id
|
organization_result.push organization.id
|
||||||
organizations_data[ organization.id ] = Organization.find( organization.id )
|
organizations_data[ organization.id ] = Organization.find( organization.id ).attributes
|
||||||
|
organizations_data[ organization.id ][:user_ids] = []
|
||||||
|
users = User.where( :organization_id => organization.id ).limit(10)
|
||||||
|
users.each {|user|
|
||||||
|
users_data[ user.id ] = User.user_data_full( user.id )
|
||||||
|
organizations_data[ organization.id ][:user_ids].push user.id
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
|
Loading…
Reference in a new issue