@title = t 'user.new.title'
@user = User.new(params[:user])
- country_code = params[:legale] || OSM.IPToCountry(request.remote_ip)
- @text = OSM.legal_text_for_country(country_code)
+ @legale = params[:legale] || OSM.IPToCountry(request.remote_ip) || APP_CONFIG['default_legale']
+ @text = OSM.legal_text_for_country(@legale)
- if @user.invalid?
+ if request.xhr?
+ render :update do |page|
+ page.replace_html "contributorTerms", :partial => "terms"
+ end
+ elsif @user.invalid?
render :action => 'new'
end
end
if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"})
render :action => 'new'
+ elsif params[:decline]
+ redirect_to t 'user.terms.declined'
else
@user = User.new(params[:user])