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

View file

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

View file

@ -115,7 +115,7 @@ class App.User extends App.Model
if data['accounts'] if data['accounts']
for account of data['accounts'] for account of data['accounts']
if account == 'twitter' 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' if account == 'facebook'
data['accounts'][account]['link'] = 'https://www.facebook.com/profile.php?id=' + data['accounts'][account]['uid'] 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"> <div class="profile-organizationIcon">
<%- @Icon('organization') %> <%- @Icon('organization') %>
</div> </div>
<h1><%= @organization.displayName() %></h1> <h1 class="js-name"></h1>
</div> </div>
<div class="js-object-container"></div> <div class="js-object-container"></div>
<div class="profile-section js-ticket-stats"></div> <div class="profile-section js-ticket-stats"></div>

View file

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