for admins, show some private info about users in user profiles
This commit is contained in:
parent
976eb522e8
commit
fd00205625
|
@ -337,10 +337,6 @@ div#footer a {
|
||||||
|
|
||||||
|
|
||||||
/* other specifics */
|
/* other specifics */
|
||||||
div#user_about {
|
|
||||||
margin-left: 12em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#gravatar {
|
div#gravatar {
|
||||||
border: 2px solid #fff;
|
border: 2px solid #fff;
|
||||||
border-radius: 100% 100%;
|
border-radius: 100% 100%;
|
||||||
|
@ -945,8 +941,7 @@ table.data td p:last-child {
|
||||||
.box label,
|
.box label,
|
||||||
.box span,
|
.box span,
|
||||||
.box select,
|
.box select,
|
||||||
.box br,
|
.box br {
|
||||||
.box div.d {
|
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
}
|
}
|
||||||
.box br {
|
.box br {
|
||||||
|
@ -971,6 +966,9 @@ table.data td p:last-child {
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
.box div.d {
|
||||||
|
margin-left: 7em;
|
||||||
|
}
|
||||||
|
|
||||||
.box input.normal,
|
.box input.normal,
|
||||||
.box label.normal {
|
.box label.normal {
|
||||||
|
@ -981,7 +979,8 @@ table.data td p:last-child {
|
||||||
|
|
||||||
.box span.d label,
|
.box span.d label,
|
||||||
.box td label,
|
.box td label,
|
||||||
.box .legend label {
|
.box .legend label,
|
||||||
|
.box div.d label {
|
||||||
display: inline;
|
display: inline;
|
||||||
float: none;
|
float: none;
|
||||||
vertical-align: baseline;
|
vertical-align: baseline;
|
||||||
|
@ -1016,7 +1015,9 @@ table.data td p:last-child {
|
||||||
.box.wide .hintblock {
|
.box.wide .hintblock {
|
||||||
margin-left: 12em;
|
margin-left: 12em;
|
||||||
}
|
}
|
||||||
|
.box.wide div.d {
|
||||||
|
margin-left: 12em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* for flash_notices() and flash_errors() */
|
/* for flash_notices() and flash_errors() */
|
||||||
|
|
|
@ -262,4 +262,11 @@ class User < ActiveRecord::Base
|
||||||
Message.where("recipient_user_id = ? AND (has_been_read = ? AND " <<
|
Message.where("recipient_user_id = ? AND (has_been_read = ? AND " <<
|
||||||
"deleted_by_recipient = ?)", self.id, false, false).count)
|
"deleted_by_recipient = ?)", self.id, false, false).count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def votes_for_others
|
||||||
|
self.votes.joins(:story, :comment).
|
||||||
|
where("comments.user_id <> votes.user_id AND " <<
|
||||||
|
"stories.user_id <> votes.user_id").
|
||||||
|
order("id DESC")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
class Vote < ActiveRecord::Base
|
class Vote < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :story
|
belongs_to :story
|
||||||
|
belongs_to :comment
|
||||||
|
|
||||||
COMMENT_REASONS = {
|
COMMENT_REASONS = {
|
||||||
"O" => "Off-topic",
|
"O" => "Off-topic",
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
<% if @showing_user.is_active? %>
|
<% if @showing_user.is_active? %>
|
||||||
<label class="required">About:</label>
|
<label class="required">About:</label>
|
||||||
|
|
||||||
<div id="user_about" class="shorten_first_p">
|
<div class="d shorten_first_p">
|
||||||
<% if @showing_user.about.present? %>
|
<% if @showing_user.about.present? %>
|
||||||
<%= raw @showing_user.linkified_about %>
|
<%= raw @showing_user.linkified_about %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -117,4 +117,54 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if @user && @user.is_admin? && !@showing_user.is_moderator? %>
|
||||||
|
<div style="clear: both;"></div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<div class="legend">
|
||||||
|
Administrative Information
|
||||||
|
</div>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<label class="required">E-Mail:</label>
|
||||||
|
<span class="d">
|
||||||
|
<%= @showing_user.email %>
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<label class="required">Recent Votes:</label>
|
||||||
|
<div class="d shorten_first_p">
|
||||||
|
<% @showing_user.votes_for_others.limit(10).each do |v| %>
|
||||||
|
<p>
|
||||||
|
<% if v.vote == 1 %>
|
||||||
|
+1
|
||||||
|
<% else %>
|
||||||
|
<%= v.vote %>
|
||||||
|
<% if v.comment_id %>
|
||||||
|
(<%= Vote::COMMENT_REASONS[v.reason] %>)
|
||||||
|
<% else %>
|
||||||
|
(<%= Vote::STORY_REASONS[v.reason] %>)
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
on
|
||||||
|
<% if v.comment_id %>
|
||||||
|
<a href="<%= v.comment.short_id_url %>">comment</a>
|
||||||
|
by
|
||||||
|
<a href="/u/<%= v.comment.user.try(:username) %>"><%=
|
||||||
|
v.comment.user.try(:username) %></a>
|
||||||
|
on
|
||||||
|
<a href="<%= v.story.short_id_url %>"><%= v.story.title %></a>
|
||||||
|
<% elsif v.story_id && !v.comment_id %>
|
||||||
|
<a href="<%= v.story.short_id_url %>"><%= v.story.title %></a>
|
||||||
|
by
|
||||||
|
<a href="/u/<%= v.story.user.try(:username) %>"><%=
|
||||||
|
v.story.user.try(:username) %></a>
|
||||||
|
<% end %>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue