my karma means nothing
This commit is contained in:
parent
3f425a7abc
commit
6dcf35dc25
|
@ -73,14 +73,20 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def as_json(options = {})
|
||||
h = super(:only => [
|
||||
attrs = [
|
||||
:username,
|
||||
:created_at,
|
||||
:is_admin,
|
||||
:is_moderator,
|
||||
:karma,
|
||||
:about,
|
||||
])
|
||||
]
|
||||
|
||||
if !self.is_admin?
|
||||
attrs.push :karma
|
||||
end
|
||||
|
||||
attrs.push :about
|
||||
|
||||
h = super(:only => attrs)
|
||||
h[:avatar_url] = avatar_url
|
||||
h
|
||||
end
|
||||
|
|
|
@ -12,11 +12,14 @@
|
|||
<% elsif user.is_new? %>
|
||||
class="new_user"
|
||||
<% end %>
|
||||
><%= user.username %></a> (<%= user.karma %>)
|
||||
><%= user.username %></a>
|
||||
<% if user.is_admin? %>
|
||||
(administrator)
|
||||
<% elsif user.is_moderator? %>
|
||||
(moderator)
|
||||
<% else %>
|
||||
(<%= user.karma %>)
|
||||
<% if user.is_moderator? %>
|
||||
(moderator)
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -78,13 +78,15 @@
|
|||
<br>
|
||||
<% end %>
|
||||
|
||||
<label class="required">Karma:</label>
|
||||
<span class="d">
|
||||
<%= @showing_user.karma %>, averaging <%=
|
||||
number_with_precision(@showing_user.average_karma, :precision => 2) %>
|
||||
per story/comment
|
||||
</span>
|
||||
<br>
|
||||
<% if !@showing_user.is_admin? %>
|
||||
<label class="required">Karma:</label>
|
||||
<span class="d">
|
||||
<%= @showing_user.karma %>, averaging <%=
|
||||
number_with_precision(@showing_user.average_karma, :precision => 2) %>
|
||||
per story/comment
|
||||
</span>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
<label class="required">Stories Submitted:</label>
|
||||
<span class="d">
|
||||
|
|
|
@ -24,11 +24,14 @@
|
|||
<% elsif user.is_new? %>
|
||||
class="new_user"
|
||||
<% end %>
|
||||
><%= user.username %></a> (<%= user.karma %>)
|
||||
><%= user.username %></a>
|
||||
<% if user.is_admin? %>
|
||||
(administrator)
|
||||
<% elsif user.is_moderator? %>
|
||||
(moderator)
|
||||
<% else %>
|
||||
(<%= user.karma %>)
|
||||
<% if user.is_moderator? %>
|
||||
(moderator)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if (children = @users_by_parent[user.id]) %>
|
||||
<% # drill down deeper in the tree %>
|
||||
|
|
Loading…
Reference in a new issue