diff --git a/app/assets/javascripts/app/controllers/_default_navbar.js.coffee b/app/assets/javascripts/app/controllers/_default_navbar.js.coffee index 592d07938..54e43a773 100644 --- a/app/assets/javascripts/app/controllers/_default_navbar.js.coffee +++ b/app/assets/javascripts/app/controllers/_default_navbar.js.coffee @@ -2,9 +2,8 @@ App.Config.set( 'User', { prio: 1000, parent: '', callback: -> - item = {} - item['name'] = App.Session.get( 'login' ) - item['image'] = App.Session.get( 'imageUrl' ) + item = {} + item['name'] = App.Session.get( 'login' ) if App.Session.get() item['avatar'] = App.Session.get().avatar() return item diff --git a/app/assets/javascripts/app/models/organization.js.coffee b/app/assets/javascripts/app/models/organization.js.coffee index a081eed1c..14c7b3a2b 100644 --- a/app/assets/javascripts/app/models/organization.js.coffee +++ b/app/assets/javascripts/app/models/organization.js.coffee @@ -27,6 +27,6 @@ class App.Organization extends App.Model data['members'] = [] for user_id in data['member_ids'] if App.User.exists( user_id ) - user = App.User.fullLocal( user_id ) + user = App.User.find( user_id ) data['members'].push user data diff --git a/app/assets/javascripts/app/models/user.js.coffee b/app/assets/javascripts/app/models/user.js.coffee index 3f0685336..16b0fa3a0 100644 --- a/app/assets/javascripts/app/models/user.js.coffee +++ b/app/assets/javascripts/app/models/user.js.coffee @@ -63,7 +63,8 @@ class App.User extends App.Model else if @vip cssClass += " vip" - "" + image = @imageUrl() + "" uniqueAvatar: (size, placement = '', cssClass = '', avatar) -> width = 300 @@ -84,6 +85,12 @@ class App.User extends App.Model cssClass += " vip" "#{ @initials() }" + imageUrl: -> + return if !@image + # set image url + @constructor.apiPath + '/users/image/' + @image + + @_fillUp: (data) -> # set socal media links @@ -94,9 +101,6 @@ class App.User extends App.Model if account == 'facebook' data['accounts'][account]['link'] = 'https://www.facebook.com/profile.php?id=' + data['accounts'][account]['uid'] - # set image url - data.imageUrl = @apiPath + '/users/image/' + data.image - if data.organization_id data.organization = App.Organization.find(data.organization_id) diff --git a/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco b/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco index a32548e19..7130d2afa 100644 --- a/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco +++ b/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco @@ -11,7 +11,7 @@