end
def authorize(realm = "Web Password", errormessage = "Couldn't authenticate you")
- # make the @user object from any auth sources we have
+ # make the current_user object from any auth sources we have
setup_user_auth
# handle authenticate pass/fail
end
##
- # ensure that there is a "this_user" instance variable
- def lookup_this_user
- render_unknown_user params[:display_name] unless @this_user = User.active.find_by(:display_name => params[:display_name])
+ # ensure that there is a "user" instance variable
+ def lookup_user
+ render_unknown_user params[:display_name] unless @user = User.active.find_by(:display_name => params[:display_name])
end
##
before_action :authorize_web
before_action :set_locale
before_action :require_user, :only => [:new, :edit, :comment, :hide, :hidecomment, :subscribe, :unsubscribe]
- before_action :lookup_this_user, :only => [:view, :comments]
+ before_action :lookup_user, :only => [:view, :comments]
before_action :check_database_readable
before_action :check_database_writable, :only => [:new, :edit, :comment, :hide, :hidecomment, :subscribe, :unsubscribe]
before_action :require_administrator, :only => [:hide, :hidecomment]
def list
if params[:display_name]
- @this_user = User.active.find_by(:display_name => params[:display_name])
+ @user = User.active.find_by(:display_name => params[:display_name])
- if @this_user
- @title = t "diary_entry.list.user_title", :user => @this_user.display_name
- @entries = @this_user.diary_entries
+ if @user
+ @title = t "diary_entry.list.user_title", :user => @user.display_name
+ @entries = @user.diary_entries
else
render_unknown_user params[:display_name]
return
end
def view
- @entry = @this_user.diary_entries.visible.where(:id => params[:id]).first
+ @entry = @user.diary_entries.visible.where(:id => params[:id]).first
if @entry
@title = t "diary_entry.view.title", :user => params[:display_name], :title => @entry.title
else
def comments
@comment_pages, @comments = paginate(:diary_comments,
:conditions => {
- :user_id => @this_user,
+ :user_id => @user,
:visible => true
},
:order => "created_at DESC",
before_action :authorize_web
before_action :set_locale
before_action :require_user
- before_action :lookup_this_user, :only => [:new]
+ before_action :lookup_user, :only => [:new]
before_action :check_database_readable
before_action :check_database_writable, :only => [:new, :reply, :mark]
before_action :allow_thirdparty_images, :only => [:new, :read]
flash[:error] = t "message.new.limit_exceeded"
else
@message = Message.new(message_params)
- @message.recipient = @this_user
+ @message.recipient = @user
@message.sender = current_user
@message.sent_on = Time.now.getutc
end
end
- @message ||= Message.new(message_params.merge(:recipient => @this_user))
+ @message ||= Message.new(message_params.merge(:recipient => @user))
@title = t "message.new.title"
end
# Display a list of notes by a specified user
def mine
if params[:display_name]
- if @this_user = User.active.find_by(:display_name => params[:display_name])
+ if @user = User.active.find_by(:display_name => params[:display_name])
@params = params.permit(:display_name)
- @title = t "note.mine.title", :user => @this_user.display_name
- @heading = t "note.mine.heading", :user => @this_user.display_name
- @description = t "note.mine.subheading", :user => render_to_string(:partial => "user", :object => @this_user)
+ @title = t "note.mine.title", :user => @user.display_name
+ @heading = t "note.mine.heading", :user => @user.display_name
+ @description = t "note.mine.subheading", :user => render_to_string(:partial => "user", :object => @user)
@page = (params[:page] || 1).to_i
@page_size = 10
- @notes = @this_user.notes
+ @notes = @user.notes
@notes = @notes.visible unless current_user && current_user.moderator?
@notes = @notes.order("updated_at DESC, id").distinct.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author).to_a
else
before_action :set_locale
before_action :require_user, :only => [:new, :create, :edit, :update, :revoke]
before_action :require_moderator, :only => [:new, :create, :edit, :update, :revoke]
- before_action :lookup_this_user, :only => [:new, :create, :blocks_on, :blocks_by]
+ before_action :lookup_user, :only => [:new, :create, :blocks_on, :blocks_by]
before_action :lookup_user_block, :only => [:show, :edit, :update, :revoke]
before_action :require_valid_params, :only => [:create, :update]
before_action :check_database_readable
def create
if @valid_params
@user_block = UserBlock.new(
- :user => @this_user,
+ :user => @user,
:creator => current_user,
:reason => params[:user_block][:reason],
:ends_at => Time.now.getutc + @block_period.hours,
)
if @user_block.save
- flash[:notice] = t("user_block.create.flash", :name => @this_user.display_name)
+ flash[:notice] = t("user_block.create.flash", :name => @user.display_name)
redirect_to @user_block
else
render :action => "new"
@params = params.permit(:display_name)
@user_blocks_pages, @user_blocks = paginate(:user_blocks,
:include => [:user, :creator, :revoker],
- :conditions => { :user_id => @this_user.id },
+ :conditions => { :user_id => @user.id },
:order => "user_blocks.ends_at DESC",
:per_page => 20)
end
@params = params.permit(:display_name)
@user_blocks_pages, @user_blocks = paginate(:user_blocks,
:include => [:user, :creator, :revoker],
- :conditions => { :creator_id => @this_user.id },
+ :conditions => { :creator_id => @user.id },
:order => "user_blocks.ends_at DESC",
:per_page => 20)
end
end
def api_read
- if @this_user.visible?
+ if @user.visible?
render :action => :api_read, :content_type => "text/xml"
else
head :gone
end
def api_details
- @this_user = current_user
+ @user = current_user
render :action => :api_read, :content_type => "text/xml"
end
end
def view
- @this_user = User.find_by(:display_name => params[:display_name])
+ @user = User.find_by(:display_name => params[:display_name])
- if @this_user &&
- (@this_user.visible? || (current_user && current_user.administrator?))
- @title = @this_user.display_name
+ if @user &&
+ (@user.visible? || (current_user && current_user.administrator?))
+ @title = @user.display_name
else
render_unknown_user params[:display_name]
end
##
# sets a user's status
def set_status
- @this_user.status = params[:status]
- @this_user.save
+ @user.status = params[:status]
+ @user.save
redirect_to :action => "view", :display_name => params[:display_name]
end
##
# delete a user, marking them as deleted and removing personal data
def delete
- @this_user.delete
+ @user.delete
redirect_to :action => "view", :display_name => params[:display_name]
end
end
##
- # ensure that there is a "this_user" instance variable
+ # ensure that there is a "user" instance variable
def lookup_user_by_id
- @this_user = User.find(params[:id])
+ @user = User.find(params[:id])
end
##
- # ensure that there is a "this_user" instance variable
+ # ensure that there is a "user" instance variable
def lookup_user_by_name
- @this_user = User.find_by(:display_name => params[:display_name])
+ @user = User.find_by(:display_name => params[:display_name])
rescue ActiveRecord::RecordNotFound
- redirect_to :action => "view", :display_name => params[:display_name] unless @this_user
+ redirect_to :action => "view", :display_name => params[:display_name] unless @user
end
##
before_action :authorize_web
before_action :require_user
- before_action :lookup_this_user
+ before_action :lookup_user
before_action :require_administrator
before_action :require_valid_role
before_action :not_in_role, :only => [:grant]
before_action :in_role, :only => [:revoke]
def grant
- @this_user.roles.create(:role => @role, :granter => current_user)
- redirect_to user_path(@this_user)
+ @user.roles.create(:role => @role, :granter => current_user)
+ redirect_to user_path(@user)
end
def revoke
# checks that administrator role is not revoked from current user
- if current_user == @this_user && @role == "administrator"
+ if current_user == @user && @role == "administrator"
flash[:error] = t("user_role.filter.not_revoke_admin_current_user")
else
- UserRole.where(:user_id => @this_user.id, :role => @role).delete_all
+ UserRole.where(:user_id => @user.id, :role => @role).delete_all
end
- redirect_to user_path(@this_user)
+ redirect_to user_path(@user)
end
private
def require_administrator
unless current_user.administrator?
flash[:error] = t "user_role.filter.not_an_administrator"
- redirect_to user_path(@this_user)
+ redirect_to user_path(@user)
end
end
@role = params[:role]
unless UserRole::ALL_ROLES.include?(@role)
flash[:error] = t("user_role.filter.not_a_role", :role => @role)
- redirect_to user_path(@this_user)
+ redirect_to user_path(@user)
end
end
##
# checks that the user doesn't already have this role
def not_in_role
- if @this_user.has_role? @role
+ if @user.has_role? @role
flash[:error] = t("user_role.filter.already_has_role", :role => @role)
- redirect_to user_path(@this_user)
+ redirect_to user_path(@user)
end
end
##
# checks that the user already has this role
def in_role
- unless @this_user.has_role? @role
+ unless @user.has_role? @role
flash[:error] = t("user_role.filter.doesnt_have_role", :role => @role)
- redirect_to user_path(@this_user)
+ redirect_to user_path(@user)
end
end
end
<div class='diary_post'>
<div class='post_heading clearfix'>
- <% if !@this_user %>
+ <% if !@user %>
<%= user_thumbnail diary_entry.user %>
<% end %>
<% content_for :heading do %>
- <h1><%= t('diary_entry.comments.has_commented_on', :display_name => @this_user.display_name) %></h1>
+ <h1><%= t('diary_entry.comments.has_commented_on', :display_name => @user.display_name) %></h1>
<% end %>
<table class="messages" width="100%">
<% content_for :heading do %>
- <div <% if @this_user %> id="userinformation"<% end %> >
- <% if @this_user %>
- <%= user_image @this_user %>
+ <div <% if @user %> id="userinformation"<% end %> >
+ <% if @user %>
+ <%= user_image @user %>
<% end %>
<h1><%= h(@title) %></h1>
<li><%= rss_link_to :action => 'rss', :language => params[:language] %></li>
<% end -%>
- <% if @this_user %>
- <%= if_user(@this_user) do %>
+ <% if @user %>
+ <%= if_user(@user) do %>
<li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('diary_entry.list.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('diary_entry.list.new_title')} %></li>
<% end %>
<% else %>
<% else %>
<h4><%= t 'diary_entry.list.recent_entries' %></h4>
- <% if @this_user %>
+ <% if @user %>
<%= render :partial => 'diary_entry', :collection => @entries %>
<% else %>
<%= render :partial => 'diary_list_entry', :collection => @entries %>
<div class='activity-details'>
<p class='deemphasize'>
<%= link_to h(contact.display_name), user_path(contact) %>
- <% if @this_user.home_lon and @this_user.home_lat and contact.home_lon and contact.home_lat %>
- <% distance = @this_user.distance(contact) %>
+ <% if @user.home_lon and @user.home_lat and contact.home_lon and contact.home_lat %>
+ <% distance = @user.distance(contact) %>
<% if distance < 1 %>
(<%= t 'user.view.m away', :count => (distance * 1000).round %>)
<% else %>
xml.instruct! :xml, :version => "1.0"
xml.osm("version" => API_VERSION, "generator" => GENERATOR) do
- xml.tag! "user", :id => @this_user.id,
- :display_name => @this_user.display_name,
- :account_created => @this_user.creation_time.xmlschema do
- xml.tag! "description", @this_user.description if @this_user.description
- if current_user && current_user == @this_user
- xml.tag! "contributor-terms", :agreed => @this_user.terms_agreed.present?,
- :pd => @this_user.consider_pd
+ xml.tag! "user", :id => @user.id,
+ :display_name => @user.display_name,
+ :account_created => @user.creation_time.xmlschema do
+ xml.tag! "description", @user.description if @user.description
+ if current_user && current_user == @user
+ xml.tag! "contributor-terms", :agreed => @user.terms_agreed.present?,
+ :pd => @user.consider_pd
else
- xml.tag! "contributor-terms", :agreed => @this_user.terms_agreed.present?
+ xml.tag! "contributor-terms", :agreed => @user.terms_agreed.present?
end
- xml.tag! "img", :href => user_image_url(@this_user, :size => 256) if @this_user.image.file? || @this_user.image_use_gravatar
+ xml.tag! "img", :href => user_image_url(@user, :size => 256) if @user.image.file? || @user.image_use_gravatar
xml.tag! "roles" do
- @this_user.roles.each do |role|
+ @user.roles.each do |role|
xml.tag! role.role
end
end
- xml.tag! "changesets", :count => @this_user.changesets.size
- xml.tag! "traces", :count => @this_user.traces.size
+ xml.tag! "changesets", :count => @user.changesets.size
+ xml.tag! "traces", :count => @user.traces.size
xml.tag! "blocks" do
- xml.tag! "received", :count => @this_user.blocks.size,
- :active => @this_user.blocks.active.size
- if @this_user.moderator?
- xml.tag! "issued", :count => @this_user.blocks_created.size,
- :active => @this_user.blocks_created.active.size
+ xml.tag! "received", :count => @user.blocks.size,
+ :active => @user.blocks.active.size
+ if @user.moderator?
+ xml.tag! "issued", :count => @user.blocks_created.size,
+ :active => @user.blocks_created.active.size
end
end
- if current_user && current_user == @this_user
- if @this_user.home_lat && @this_user.home_lon
- xml.tag! "home", :lat => @this_user.home_lat,
- :lon => @this_user.home_lon,
- :zoom => @this_user.home_zoom
+ if current_user && current_user == @user
+ if @user.home_lat && @user.home_lon
+ xml.tag! "home", :lat => @user.home_lat,
+ :lon => @user.home_lon,
+ :zoom => @user.home_zoom
end
- if @this_user.languages
+ if @user.languages
xml.tag! "languages" do
- @this_user.languages.split(",") { |lang| xml.tag! "lang", lang }
+ @user.languages.split(",") { |lang| xml.tag! "lang", lang }
end
end
xml.tag! "messages" do
- xml.tag! "received", :count => @this_user.messages.size,
- :unread => @this_user.new_messages.size
- xml.tag! "sent", :count => @this_user.sent_messages.size
+ xml.tag! "received", :count => @user.messages.size,
+ :unread => @user.new_messages.size
+ xml.tag! "sent", :count => @user.sent_messages.size
end
end
end
<% content_for :heading do %>
<div id='userinformation'>
- <%= user_image @this_user %>
+ <%= user_image @user %>
<div class='userinformation-inner'>
- <h1><%= @this_user.display_name %><%= role_icons(@this_user) %></h1>
- <% if current_user and @this_user.id == current_user.id %>
+ <h1><%= @user.display_name %><%= role_icons(@user) %></h1>
+ <% if current_user and @user.id == current_user.id %>
<!-- Displaying user's own profile page to themself -->
<ul class='secondary-actions clearfix'>
<li>
<ul class='secondary-actions clearfix'>
<li>
- <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
- <span class='count-number'><%= number_with_delimiter(@this_user.changesets.size) %></span>
+ <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
+ <span class='count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
</li>
<li>
<%= link_to t('user.view.notes'), :controller => 'notes', :action=> 'mine' %>
</li>
<li>
- <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'list', :display_name => @this_user.display_name %>
- <span class='count-number'><%= number_with_delimiter(@this_user.traces.size) %></span>
+ <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'list', :display_name => @user.display_name %>
+ <span class='count-number'><%= number_with_delimiter(@user.traces.size) %></span>
</li>
<!-- Displaying another user's profile page -->
<li>
- <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
+ <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @user.display_name %>
</li>
<li>
- <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
- <span class='count-number'><%= number_with_delimiter(@this_user.diary_entries.size) %></span>
+ <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
+ <span class='count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
</li>
<li>
- <%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
+ <%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @user.display_name %>
</li>
<li>
- <% if current_user and current_user.is_friends_with?(@this_user) %>
- <%= link_to t('user.view.remove as friend'), remove_friend_path(:display_name => @this_user.display_name), :method => :post %>
+ <% if current_user and current_user.is_friends_with?(@user) %>
+ <%= link_to t('user.view.remove as friend'), remove_friend_path(:display_name => @user.display_name), :method => :post %>
<% elsif current_user %>
- <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name), :method => :post %>
+ <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @user.display_name), :method => :post %>
<% else %>
- <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %>
+ <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @user.display_name) %>
<% end %>
</li>
- <% if @this_user.blocks.exists? %>
+ <% if @user.blocks.exists? %>
<li>
- <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
- <span class='count-number'><%= number_with_delimiter(@this_user.blocks.active.size) %></span>
+ <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @user.display_name %>
+ <span class='count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
</li>
<% end %>
- <% if @this_user.moderator? and @this_user.blocks_created.exists? %>
+ <% if @user.moderator? and @user.blocks_created.exists? %>
<li>
- <%= link_to t('user.view.moderator_history'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @this_user.display_name %>
- <span class='count-number'><%= number_with_delimiter(@this_user.blocks_created.active.size) %></span>
+ <%= link_to t('user.view.moderator_history'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @user.display_name %>
+ <span class='count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
</li>
<% end %>
<% if current_user and current_user.moderator? %>
<li>
- <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @this_user.display_name %>
+ <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @user.display_name %>
</li>
<% end %>
<% if current_user and current_user.administrator? %>
<ul class='secondary-actions clearfix'>
- <% if ["active", "confirmed"].include? @this_user.status %>
+ <% if ["active", "confirmed"].include? @user.status %>
<li>
- <%= link_to t('user.view.deactivate_user'), set_status_user_path(:status => 'pending', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
+ <%= link_to t('user.view.deactivate_user'), set_status_user_path(:status => 'pending', :display_name => @user.display_name), :data => { :confirm => t('user.view.confirm') } %>
</li>
- <% elsif ["pending"].include? @this_user.status %>
+ <% elsif ["pending"].include? @user.status %>
<li>
- <%= link_to t('user.view.activate_user'), set_status_user_path(:status => 'active', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
+ <%= link_to t('user.view.activate_user'), set_status_user_path(:status => 'active', :display_name => @user.display_name), :data => { :confirm => t('user.view.confirm') } %>
</li>
<% end %>
- <% if ["active", "suspended"].include? @this_user.status %>
+ <% if ["active", "suspended"].include? @user.status %>
<li>
- <%= link_to t('user.view.confirm_user'), set_status_user_path(:status => 'confirmed', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
+ <%= link_to t('user.view.confirm_user'), set_status_user_path(:status => 'confirmed', :display_name => @user.display_name), :data => { :confirm => t('user.view.confirm') } %>
</li>
<% end %>
<li>
- <% if ["pending", "active", "confirmed", "suspended"].include? @this_user.status %>
- <%= link_to t('user.view.hide_user'), set_status_user_path(:status => 'deleted', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
+ <% if ["pending", "active", "confirmed", "suspended"].include? @user.status %>
+ <%= link_to t('user.view.hide_user'), set_status_user_path(:status => 'deleted', :display_name => @user.display_name), :data => { :confirm => t('user.view.confirm') } %>
<% else %>
- <%= link_to t('user.view.unhide_user'), set_status_user_path(:status => 'active', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
+ <%= link_to t('user.view.unhide_user'), set_status_user_path(:status => 'active', :display_name => @user.display_name), :data => { :confirm => t('user.view.confirm') } %>
</li>
<% end %>
<li>
- <%= link_to t('user.view.delete_user'), delete_user_path(:display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
+ <%= link_to t('user.view.delete_user'), delete_user_path(:display_name => @user.display_name), :data => { :confirm => t('user.view.confirm') } %>
</li>
</ul>
<p class='deemphasize'>
<small>
- <%= t 'user.view.mapper since' %> <%= l @this_user.creation_time.to_date, :format => :long %>
- <% unless @this_user.terms_agreed %>
+ <%= t 'user.view.mapper since' %> <%= l @user.creation_time.to_date, :format => :long %>
+ <% unless @user.terms_agreed %>
|
<%= t 'user.view.ct status' %>
- <% if @this_user.terms_seen? -%>
+ <% if @user.terms_seen? -%>
<%= t 'user.view.ct declined' %>
<% else -%>
<%= t 'user.view.ct undecided' %>
</p>
</div>
- <div class="user-description richtext"><%= @this_user.description.to_html %></div>
+ <div class="user-description richtext"><%= @user.description.to_html %></div>
</div>
<% if current_user and current_user.administrator? -%>
<div class='admin-user-info deemphasize'>
- <small><b><%= t 'user.view.email address' %></b> <%= @this_user.email %></small>
- <% unless @this_user.creation_ip.nil? -%>
- <small><b><%= t 'user.view.created from' %></b> <%= @this_user.creation_ip %></small>
+ <small><b><%= t 'user.view.email address' %></b> <%= @user.email %></small>
+ <% unless @user.creation_ip.nil? -%>
+ <small><b><%= t 'user.view.created from' %></b> <%= @user.creation_ip %></small>
<% end -%>
- <small><b><%= t 'user.view.status' %></b> <%= @this_user.status.capitalize %></small>
- <small><b><%= t 'user.view.spam score' %></b> <%= @this_user.spam_score %></small>
+ <small><b><%= t 'user.view.status' %></b> <%= @user.status.capitalize %></small>
+ <small><b><%= t 'user.view.spam score' %></b> <%= @user.spam_score %></small>
</div>
<% end -%>
<% end %>
- <% if current_user and @this_user.id == current_user.id %>
- <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
+ <% if current_user and @user.id == current_user.id %>
+ <% if @user.home_lat.nil? or @user.home_lon.nil? %>
<div id="map" class="content_map">
<p id="no_home_location"><%= raw(t 'user.view.if set location', :settings_link => (link_to t('user.view.settings_link_text'), :controller => 'user', :action => 'account', :display_name => current_user.display_name)) %></p>
</div>
<%= content_tag "div", "", :id => "map", :class => "content_map", :data => {:user => user_data} %>
<% end %>
- <% friends = @this_user.friends.collect { |f| f.befriendee } %>
- <% nearby = @this_user.nearby - friends %>
+ <% friends = @user.friends.collect { |f| f.befriendee } %>
+ <% nearby = @user.nearby - friends %>
<div class="activity-block column-1">
<h3><%= t 'user.view.my friends' %></h3>
-<% @title = t('user_block.blocks_by.title', :name => h(@this_user.display_name)) %>
+<% @title = t('user_block.blocks_by.title', :name => h(@user.display_name)) %>
<% content_for :heading do %>
- <h1><%= raw(t('user_block.blocks_by.heading', :name => link_to(h(@this_user.display_name), user_path(@this_user)))) %></h1>
+ <h1><%= raw(t('user_block.blocks_by.heading', :name => link_to(h(@user.display_name), user_path(@user)))) %></h1>
<% end %>
<% unless @user_blocks.empty? %>
<%= render :partial => 'blocks', :locals => { :show_revoke_link => (current_user and current_user.moderator?), :show_user_name => true, :show_creator_name => false } %>
<% else %>
-<p><%= t "user_block.blocks_by.empty", :name => h(@this_user.display_name) %></p>
+<p><%= t "user_block.blocks_by.empty", :name => h(@user.display_name) %></p>
<% end %>
-<% @title = t('user_block.blocks_on.title', :name => h(@this_user.display_name)) %>
+<% @title = t('user_block.blocks_on.title', :name => h(@user.display_name)) %>
<% content_for :heading do %>
- <h1><%= raw(t('user_block.blocks_on.heading', :name => link_to(h(@this_user.display_name), user_path(@this_user)))) %></h1>
+ <h1><%= raw(t('user_block.blocks_on.heading', :name => link_to(h(@user.display_name), user_path(@user)))) %></h1>
<% end %>
<% unless @user_blocks.empty? %>
<%= render :partial => 'blocks', :locals => { :show_revoke_link => (current_user and current_user.moderator?), :show_user_name => false, :show_creator_name => true } %>
<% else %>
-<p><%= t "user_block.blocks_on.empty", :name => h(@this_user.display_name) %></p>
+<p><%= t "user_block.blocks_on.empty", :name => h(@user.display_name) %></p>
<% end %>
-<% @title = t 'user_block.new.title', :name => h(@this_user.display_name) %>
+<% @title = t 'user_block.new.title', :name => h(@user.display_name) %>
<% content_for :heading do %>
<h1><%= raw t('user_block.new.heading',
:name => link_to(
- h(@this_user.display_name),
- user_path(@this_user))) %></h1>
+ h(@user.display_name),
+ user_path(@user))) %></h1>
<% end %>
<%= form_for(@user_block) do |f| %>
<%= f.error_messages %>
<p>
- <%= f.label :reason, t('user_block.new.reason', :name => @this_user.display_name) %><br />
+ <%= f.label :reason, t('user_block.new.reason', :name => @user.display_name) %><br />
<%= richtext_area :user_block, :reason, :cols => 80, :rows => 20 %>
</p>
<p>
<%= f.label :needs_view, t('user_block.new.needs_view') %>
</p>
<p>
- <%= hidden_field_tag 'display_name', @this_user.display_name %>
+ <%= hidden_field_tag 'display_name', @user.display_name %>
<%= f.submit t('user_block.new.submit') %>
</p>
<% end %>