forked from cflipse/altered_beast
-
Notifications
You must be signed in to change notification settings - Fork 16
/
show.html.erb
62 lines (49 loc) · 2.77 KB
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<% @page_title = @user.display_name %>
<% content_for :right do %>
<% if admin? %>
<% if @user.active? && !@user.suspended? %>
<%= form_for @user.moderatorships.build do |f| %>
<h6><%= I18n.t 'txt.admin.admin_and_moderation', :default => 'Admin & Moderation' %></h6>
<% if @user.forums.present? %>
<p><%= I18n.t 'txt.admin.remove_moderated_forum', :default => 'This user can moderate the following forums. Click one to remove.' %></p>
<ul class="flat">
<% @user.forums.moderatable.each do |forum| %>
<li>
<%= link_to forum.name, moderatorship_path(forum.moderatorship_id), :method => :delete, :confirm => I18n.t('txt.admin.remove_user_as_moderator', :default => 'Remove user as moderator for %{forum}?', :forum => forum.name) %>
</li>
<% end %>
</ul>
<% end %>
<% if @user.available_forums.present? %>
<p>
<label><%= I18n.t 'txt.admin.add_as_moderator', :default => 'Add as moderator' %></label><br />
<%= f.collection_select :forum_id, @user.available_forums, :id, :name, :include_blank => " - " %>
</p>
<p>
<%= f.submit I18n.t 'txt.save', :default => 'Save' %>
<%= f.hidden_field :user_id %>
</p>
<% end %>
<% end %>
<p><%= link_to I18n.t('txt.admin.suspend_user_account', :default => "Suspend user account"), suspend_user_path(@user), :method => :put %></p>
<% else %>
<p><%= I18n.t 'txt.admin.user_account_is_suspended', :default => "User account is suspended" %>. <%= link_to I18n.t('txt.admin.unsuspend_user_account', :default => "Unsuspend user account"), unsuspend_user_path(@user), :method => :put %></p>
<% end %>
<p><%= link_to I18n.t('txt.admin.edit_user_account', :default => "Edit user account"), edit_user_path(@user) %></p>
<% end %>
<% end %>
<p style="float:right;"><%= avatar_for @user, 80 %></p>
<h1><%= @user.display_name %></h1>
<p class="subtitle">
<%= feed_icon_tag @user.display_name, user_posts_path(:user_id => @user, :format => :rss) %>
<span>
<%= I18n.t 'txt.count_topics', :count => @user.topics.size, :num => number_with_delimiter(@user.topics.size) %>,
<%= I18n.t 'txt.count_posts', :count => @user.posts.size, :num => number_with_delimiter(@user.posts.size) %>
(<%= I18n.t 'txt.view', :default => 'view' %> <%= link_to I18n.t('txt.all', :default => 'all'), user_posts_path(@user) %> | <%= link_to I18n.t('txt.monitored', :default => 'monitored'), "#" %> <%= I18n.t 'txt.posts', :default => 'posts' %>)<br />
</span>
</p>
<%= @user.bio_html %>
<% unless @user.website.blank? %>
<p><strong><%= I18n.t 'txt.website', :default => 'Website' %></strong> <%= sanitize link_to(@user.website.gsub("http://",""), "http://" + @user.website.gsub("http://","")) %>
<% end %>
<p><%= I18n.t 'txt.user_since', :default => 'User since %{date}', :date => @user.created_at.to_date.to_s(:long) %></p>