journalduhacker/app/views/users/show.html.erb

88 lines
2.5 KiB
Plaintext
Raw Normal View History

2012-06-30 21:14:35 +02:00
<div class="box wide">
<div class="legend">
<%= @showing_user.username %>
<% if @user %>
(<a href="/messages?to=<%= @showing_user.username %>">Send a Message</a>)
<% end %>
</div>
2012-06-30 21:14:35 +02:00
2012-09-16 22:05:48 +02:00
<div id="gravatar">
<img src="<%= @showing_user.avatar_url %>">
2012-09-09 02:26:40 +02:00
</div>
2012-06-30 21:14:35 +02:00
<label class="required">Status:</label>
2014-01-12 22:09:32 +01:00
<span class="d"
<%= @showing_user.is_banned? ? raw("style=\"color: red;\"") : "" %>>
<% if @showing_user.is_banned? %>
Inactive
<% else %>
Active
<% end %>
<%= @showing_user.is_admin? ? "administrator" :
(@showing_user.is_moderator? ? "moderator" : "user") %>
2012-06-30 21:14:35 +02:00
</span>
<br>
<label class="required">Joined:</label>
<span class="d">
<%= raw(time_ago_in_words_label(@showing_user.created_at)) %> ago
<% if @showing_user.invited_by_user %>
by invitation from
2014-01-12 22:09:32 +01:00
<%= link_to @showing_user.invited_by_user.try(:username),
@showing_user.invited_by_user %>
<% end %>
2012-06-30 21:14:35 +02:00
</span>
<br>
2013-02-14 01:50:51 +01:00
2014-01-12 22:09:32 +01:00
<% if @showing_user.is_banned? %>
<label class="required">Banned:</label>
<span class="d">
<%= raw(time_ago_in_words_label(@showing_user.banned_at)) %> ago
<% if @showing_user.banned_by_user %>
by <%= link_to @showing_user.banned_by_user.try(:username),
@showing_user.banned_by_user %>:
<em><%= @showing_user.banned_reason %></em>
<% end %>
</span>
<br>
<% end %>
2012-06-30 21:14:35 +02:00
<label class="required">Karma:</label>
<span class="d">
<%= @showing_user.karma %>, averaging <%=
number_with_precision(@showing_user.average_karma, :precision => 2) %>
per story/comment
2012-09-07 19:25:59 +02:00
</span>
<br>
2012-06-30 21:14:35 +02:00
<label class="required">Stories Submitted:</label>
<span class="d">
<% tag = @showing_user.most_common_story_tag %>
<a href="/newest/<%= @showing_user.username %>"><%=
@showing_user.stories_submitted_count %></a><%= tag ? ", " : "" %>
<% if tag %>
most commonly tagged <a href="<%= tag_url(tag.tag) %>"
class="<%= tag.css_class %>" title="<%= tag.description %>"><%=
tag.tag %></a>
<% end %>
2012-06-30 21:14:35 +02:00
</span>
<br>
2013-02-14 01:50:51 +01:00
2012-06-30 21:14:35 +02:00
<label class="required">Comments Posted:</label>
<span class="d">
<a href="/threads/<%= @showing_user.username %>"><%=
@showing_user.comments_posted_count %></a>
2012-06-30 21:14:35 +02:00
</span>
<br>
2012-07-01 02:52:54 +02:00
2012-06-30 21:14:35 +02:00
<label class="required">About:</label>
2012-07-01 02:52:54 +02:00
2012-09-16 22:05:48 +02:00
<div id="user_about" class="shorten_first_p">
<% if @showing_user.about.present? %>
<%= raw @showing_user.linkified_about %>
<% else %>
<span class="na">A mystery...</span>
<% end %>
2012-07-01 02:52:54 +02:00
</div>
2012-06-30 21:14:35 +02:00
</div>