<% @page_title = @user.display_name -%> <% content_for :right do %> <% if admin? %>

Admin & Moderation

<% if @user.forums.any? -%>

This user can moderate the following forums. Select one to remove it.

<% @user.forums.find(:all, :select => 'forums.*, moderatorships.id as moderatorship_id').each do |forum| -%>
<%# form_for() calls form_tag() which for :method => :delete writes out a hidden INPUT field at the time of writing - but wraps it in an outer DIV. This broke earlier layout using
  • items to hold the buttons. Sigh - I have so many reservations about Rails 1.2.x... Anyway, herein, a rather tragic workaround which gives up on
  • tags but puts its own (currently redundant) DIV around the small form, to ensure line breaks work even in future Rails gets rid of its own strange little DIV. -%> <% form_for(:user, { :html => { :method => :delete, :class => 'xdialog', :onsubmit => 'return confirm("Are you sure you want to remove the user as a moderator for this forum?");' }, :url => moderator_path(@user, forum.moderatorship_id), } ) do |f| -%> <%= submit_tag forum.name %> <% end -%>
  • <% end -%> <% end -%>

    <% form_for :user, :url => admin_user_path(@user), :html => {:class => "xdialog"} do |f| -%>

    <%= submit_tag :Save %>

    <% end -%> <% end -%> <% end %>

    <%= avatar_for @user, 80 %>

    <%=h @user.display_name %>

    <%= feed_icon_tag @user.display_name, formatted_user_posts_path(:user_id => @user, :format => :rss) %> <%= pluralize @user.topics.count, 'topic' %>, <%= pluralize @user.posts_count, 'post' %> (view <%= link_to "all", user_posts_path(@user) %> | <%= link_to 'monitored', monitored_posts_path(@user) %> posts)

    <%= @user.bio_html %> <% unless @user.website.blank? -%>

    Website: <%= white_list link_to(@user.website.gsub("http://",""), "http://" + @user.website.gsub("http://","")) %> <% end -%>

    User since <%= @user.created_at.to_date.to_s :long %>