Improves popups for users and organizations.

This commit is contained in:
Martin Edenhofer 2013-05-22 02:43:42 +02:00
parent c6d7e061f8
commit e0a59f86a0
7 changed files with 54 additions and 10 deletions

View file

@ -281,7 +281,7 @@ class App.Controller extends Spine.Controller
if user[item.name]
# 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' )
data.push item

View file

@ -92,14 +92,24 @@ class App.Navigation extends App.Controller
processData: true,
success: (data, status, xhr) =>
# load user collection
if data.load.organizations
App.Collection.load( type: 'Organization', data: data.load.organizations )
# load user collection
if 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
if data.load.tickets
App.Collection.load( type: 'Ticket', data: data.load.tickets )

View file

@ -24,7 +24,7 @@ class App.UserInfo extends App.Controller
if user[item.name]
# 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
data.push item

View file

@ -1,6 +1,18 @@
<table style="width: 100%;">
<tr>
<td><%- @P( @organization ) %></td>
<td>...</td>
<td><%- @T( 'Shared' ) %></td>
<td><%- @P( @organization.shared ) %></td>
</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 %>

View file

@ -20,6 +20,14 @@
</div>
<% 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']): %>
<div class="row">
<div class="customer-info">

View file

@ -5,6 +5,14 @@
</div>
<% 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']): %>
<div class="row">
<div class="customer-info">

View file

@ -40,7 +40,13 @@ class SearchController < ApplicationController
organization_result = []
organizations.each do |organization|
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
result = []