Skip to content

Commit

Permalink
oy....
Browse files Browse the repository at this point in the history
  • Loading branch information
fusion94 committed Mar 13, 2013
1 parent fc93ad8 commit f086bac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/backbone/plugins/user_list.js.coffee
Expand Up @@ -8,6 +8,7 @@ class Kandan.Plugins.UserList
<div class="user clearfix">
<img class="avatar" src="<%= avatarUrl %>"/>
<span class="name"><%= name %></span>
<span class="name">&nbsp;<%= admins %></span>
</div>
'''

Expand All @@ -19,9 +20,11 @@ class Kandan.Plugins.UserList
displayName = null
displayName = user.username # Defaults to username
displayName ||= user.email # Revert to user email address if that's all we have
isAdmin = user.is_admin

$users.append @template({
name: displayName,
admins: isAdmin,
avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25})
})
$el.html($users)
Expand Down
4 changes: 2 additions & 2 deletions app/models/activity_observer.rb
Expand Up @@ -11,7 +11,7 @@ def after_save(activity)
def message_broadcast_data(activity)
faye_channel = "/channels/#{activity.channel.to_param}"
broadcast_data = activity.attributes.merge({
:user => activity.user.as_json(:only => [:id, :email, :first_name, :last_name, :gravatar_hash, :active, :locale, :username]),
:user => activity.user.as_json(:only => [:id, :email, :first_name, :last_name, :gravatar_hash, :active, :locale, :username, :is_admin]),
:channel => activity.channel.attributes
})
[faye_channel, broadcast_data]
Expand All @@ -22,7 +22,7 @@ def upload_broadcast_data(activity)
broadcast_data = {
:event => "attachment#upload",
:entity => activity.attributes.merge({
:user => activity.user.as_json(:only => [:id, :email, :first_name, :last_name, :gravatar_hash, :active, :locale, :username]),
:user => activity.user.as_json(:only => [:id, :email, :first_name, :last_name, :gravatar_hash, :active, :locale, :username, :is_admin]),
:channel => activity.channel.attributes
}),
:extra => {
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Expand Up @@ -83,4 +83,4 @@
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
add_index "users", ["email"], :name => "index_users_on_email", :unique => true

end
end

0 comments on commit f086bac

Please sign in to comment.