Fixed not shown history.

This commit is contained in:
Martin Edenhofer 2016-09-28 20:06:28 +02:00
parent 08bacb77d9
commit f673c7028a
5 changed files with 41 additions and 14 deletions

View file

@ -40,9 +40,9 @@ class App.OrganizationProfile extends App.Controller
organization: organization
))
new ActionRow(
el: elLocal.find('.js-action')
new Organization(
object_id: organization.id
el: elLocal.find('.js-name')
)
new Object(
@ -51,6 +51,11 @@ class App.OrganizationProfile extends App.Controller
task_key: @task_key
)
new ActionRow(
el: elLocal.find('.js-action')
object_id: organization.id
)
new App.TicketStats(
el: elLocal.find('.js-ticket-stats')
organization: organization
@ -76,7 +81,7 @@ class ActionRow extends App.ObserverController
render: (organization) =>
# start action controller
showHistory = ->
showHistory = =>
new App.OrganizationHistory(
organization_id: organization.id
container: @el.closest('.content')
@ -182,6 +187,14 @@ class Object extends App.ObserverController
org.updateAttributes(data)
@log 'debug', 'update', name, value, org
class Organization extends App.ObserverController
model: 'Organization'
observe:
name: true
render: (organization) =>
@html App.Utils.htmlEscape(organization.displayName())
class Member extends App.ObserverController
model: 'User'
observe:

View file

@ -41,17 +41,28 @@ class App.UserProfile extends App.Controller
user: user
))
new ActionRow(
el: elLocal.find('.js-action')
new User(
object_id: user.id
el: elLocal.find('.js-name')
)
if user.organization_id
new Organization(
object_id: user.organization_id
el: elLocal.find('.js-organization')
)
new Object(
el: elLocal.find('.js-object-container')
object_id: user.id
task_key: @task_key
)
new ActionRow(
el: elLocal.find('.js-action')
object_id: user.id
)
new App.TicketStats(
el: elLocal.find('.js-ticket-stats')
user: user
@ -164,12 +175,6 @@ class Object extends App.ObserverController
maxlength: 250
})
if user.organization_id
new Organization(
object_id: user.organization_id
el: @$('.js-organization')
)
update: (e) =>
name = $(e.target).attr('data-name')
value = $(e.target).html()
@ -191,6 +196,15 @@ class Organization extends App.ObserverController
organization: organization
)
class User extends App.ObserverController
model: 'User'
observe:
firstname: true
lastname: true
render: (user) =>
@html App.Utils.htmlEscape(user.displayName())
class Router extends App.ControllerPermanent
requiredPermission: 'ticket.agent'
constructor: (params) ->

View file

@ -115,7 +115,7 @@ class App.User extends App.Model
if data['accounts']
for account of data['accounts']
if account == 'twitter'
data['accounts'][account]['link'] = 'http://twitter.com/' + data['accounts'][account]['username']
data['accounts'][account]['link'] = 'https://twitter.com/' + data['accounts'][account]['username']
if account == 'facebook'
data['accounts'][account]['link'] = 'https://www.facebook.com/profile.php?id=' + data['accounts'][account]['uid']

View file

@ -5,7 +5,7 @@
<div class="profile-organizationIcon">
<%- @Icon('organization') %>
</div>
<h1><%= @organization.displayName() %></h1>
<h1 class="js-name"></h1>
</div>
<div class="js-object-container"></div>
<div class="profile-section js-ticket-stats"></div>

View file

@ -3,7 +3,7 @@
<div class="profile-section vertical centered">
<div class="align-right profile-action js-action"></div>
<%- @user.avatar("80") %>
<h1><%= @user.displayName() %></h1>
<h1 class="js-name"></h1>
<% if @user.organization: %>
<div class="profile-organization js-organization"></div>
<% end %>