diff --git a/app/assets/javascripts/app/controllers/layout_ref.js.coffee b/app/assets/javascripts/app/controllers/layout_ref.js.coffee index 7e5831f3e..e446e71a0 100644 --- a/app/assets/javascripts/app/controllers/layout_ref.js.coffee +++ b/app/assets/javascripts/app/controllers/layout_ref.js.coffee @@ -24,7 +24,10 @@ class Content extends App.ControllerContent for avatar in @$('.user.avatar') avatar = $(avatar) - size = if avatar.hasClass('big') then 50 else 40 + size = switch + when avatar.hasClass('size-80') then 80 + when avatar.hasClass('size-50') then 50 + else 40 @createUniqueAvatar avatar, size, avatar.data('firstname'), avatar.data('lastname'), avatar.data('userid') createUniqueAvatar: (holder, size, firstname, lastname, id) -> @@ -576,4 +579,15 @@ class ImportWizard extends App.ControllerContent App.Config.set( 'layout_ref/import_wizard', ImportWizard, 'Routes' ) +class UserZoom extends App.ControllerContent + + constructor: -> + super + @render() + + render: -> + @html App.view('layout_ref/user_zoom')() + +App.Config.set( 'layout_ref/user_zoom', UserZoom, 'Routes' ) + App.Config.set( 'LayoutRef', { prio: 1700, parent: '#current_user', name: 'Layout Reference', target: '#layout_ref', role: [ 'Admin' ] }, 'NavBarRight' ) diff --git a/app/assets/javascripts/app/models/user.js.coffee b/app/assets/javascripts/app/models/user.js.coffee index 19625a39c..0734eefea 100644 --- a/app/assets/javascripts/app/models/user.js.coffee +++ b/app/assets/javascripts/app/models/user.js.coffee @@ -52,24 +52,24 @@ class App.User extends App.Model else return '??' - avatar: (big = false, placement = '', cssClass = '') -> - if big - cssClass += ' big' + avatar: (size = 40, placement = '', cssClass = '') -> + cssClass += " size-#{ size }" + if placement placement = "data-placement=\"#{placement}\"" if @image is 'none' - return @uniqueAvatar(big, placement, cssClass) + return @uniqueAvatar(size, placement, cssClass) else "" - uniqueAvatar: (big = false, placement = '', cssClass = '') -> - if big - cssClass += ' big' + uniqueAvatar: (size = 40, placement = '', cssClass = '') -> + if size and !cssClass + cssClass += " size-#{ size }" width = 300 height = 226 - size = if big then 50 else 40 + size = parseInt(size, 10) rng = new Math.seedrandom(@id) x = rng() * (width - size) diff --git a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco index 5f5448bb1..7fb82e5ab 100644 --- a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco @@ -32,7 +32,7 @@
.avatar
.avatar.size-50
.avatar.size-80
Users and customers might not have a profile images because:
@@ -36,9 +51,12 @@ - - - + + + + + +-
- - - -diff --git a/app/assets/javascripts/app/views/profile/avatar-holder.jst.eco b/app/assets/javascripts/app/views/profile/avatar-holder.jst.eco index 265f4985d..e0d37a29e 100644 --- a/app/assets/javascripts/app/views/profile/avatar-holder.jst.eco +++ b/app/assets/javascripts/app/views/profile/avatar-holder.jst.eco @@ -1,4 +1,4 @@