!@user.nil?
end
+ ##
+ # render a "no such user" page
+ def render_unknown_user(name)
+ @title = t "user.no_such_user.title"
+ @not_found_user = name
+
+ render :template => "user/no_such_user", :status => :not_found
+ end
+
private
# extract authorisation credentials from headers, returns user = nil if none
changesets = changesets.where("false")
end
elsif request.format == :html
- @title = t 'user.no_such_user.title'
- @not_found_user = params[:display_name]
- render :template => 'user/no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
return
end
end
:order => 'created_at DESC',
:per_page => 20)
else
- @title = t'diary_entry.no_such_user.title'
- @not_found_user = params[:display_name]
-
- render :action => 'no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
end
elsif params[:language]
@title = t 'diary_entry.list.in_language_title', :language => Language.find(params[:language]).english_name
render :action => 'no_such_entry', :status => :not_found
end
else
- @not_found_user = params[:display_name]
-
- render :action => 'no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
end
end
:per_page => 20)
@page = (params[:page] || 1).to_i
else
- @title = t'diary_entry.no_such_user.title'
- @not_found_user = params[:display_name]
- render :action => 'no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
end
end
private
end
end
else
- @title = t'message.no_such_user.title'
- render :action => 'no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
end
end
if !display_name.blank?
target_user = User.active.where(:display_name => display_name).first
if target_user.nil?
- @title = t'trace.no_such_user.title'
- @not_found_user = display_name
- render :action => 'no_such_user', :status => :not_found
+ render_unknown_user display_name
return
end
end
# ensure that there is a "this_user" instance variable
def lookup_this_user
unless @this_user = User.find_by_display_name(params[:display_name])
- @not_found_user = params[:display_name]
- render :template => 'user/no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
end
end
(@this_user.visible? or (@user and @user.administrator?))
@title = @this_user.display_name
else
- @title = t 'user.no_such_user.title'
- @not_found_user = params[:display_name]
- render :action => 'no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
end
end
# ensure that there is a "this_user" instance variable
def lookup_this_user
unless @this_user = User.find_by_display_name(params[:display_name])
- @not_found_user = params[:display_name]
- render :template => 'user/no_such_user', :status => :not_found
+ render_unknown_user params[:display_name]
end
end
+++ /dev/null
-<h2><%= t 'diary_entry.no_such_user.heading', :user => @not_found_user %></h2>
-<p><%= t 'diary_entry.no_such_user.body', :user => @not_found_user %></p>
+++ /dev/null
-<h1><%= t'message.no_such_user.heading' %></h1>
-<p><%= t'message.no_such_user.body' %></p>
+++ /dev/null
-<h2><%= t'trace.no_such_user.heading', :user => @not_found_user %></h2>
-<p><%= t'trace.no_such_user.body', :user => @not_found_user %></p>
title: "No such diary entry"
heading: "No entry with the id: %{id}"
body: "Sorry, there is no diary entry or comment with the id %{id}. Please check your spelling, or maybe the link you clicked is wrong."
- no_such_user:
- title: "No such user"
- heading: "The user %{user} does not exist"
- body: "Sorry, there is no user with the name %{user}. Please check your spelling, or maybe the link you clicked is wrong."
diary_entry:
posted_by: "Posted by %{link_user} on %{created} in %{language_link}"
comment_link: Comment on this entry
back_to_inbox: "Back to inbox"
message_sent: "Message sent"
limit_exceeded: "You have sent a lot of messages recently. Please wait a while before trying to send any more."
- no_such_user:
- title: "No such user"
- heading: "No such user"
- body: "Sorry there is no user with that name."
no_such_message:
title: "No such message"
heading: "No such message"
visibility: "Visibility:"
visibility_help: "what does this mean?"
visibility_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
- no_such_user:
- title: "No such user"
- heading: "The user %{user} does not exist"
- body: "Sorry, there is no user with the name %{user}. Please check your spelling, or maybe the link you clicked is wrong."
trace_form:
upload_gpx: "Upload GPX File:"
description: "Description:"