<commit_before><% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>
<p><%= t 'layouts.osm_offline' %>
</p>
<% elsif OSM_STATUS == :database_readonly or OSM_STATUS == :api_readonly %>
<p><%= t 'layouts.osm_read_only' %>
</p>
<% elsif !@user.data_public? %>
<p><%= t 'site.edit.not_public' %></p>
<p><%= t 'site.edit.not_public_description', 
:user_page => (link_to t('site.edit.user_page_link'), {:controller => 'user', :action => 'account', :display_name => @user.display_name, :anchor => 'public'}) %></p>
<p><%= t 'site.edit.anon_edits', :link => link_to(t('site.edit.anon_edits_link_text'), t('site.edit.anon_edits_link')) %></p>
<% else %>
<% content_for :greeting do %>
<% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
<%= link_to_function t('layouts.home'), "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)", { :title => t('layouts.home_tooltip') } %> |
<% end %>
<% end %>

<%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
<%= render :partial => 'search' %>

<%
session[:token] = @user.tokens.create.token unless session[:token]

# Decide on a lat lon to initialise potlatch with. Various ways of doing this
if params['lon'] and params['lat']
	lon =  h(params['lon']) 
	lat =  h(params['lat']) 
	zoom =  h(params['zoom'])

elsif params['mlon'] and params['mlat'] 
	lon =  h(params['mlon']) 
	lat =  h(params['mlat']) 
	zoom =  h(params['zoom'])
	
elsif params['gpx']
	#use gpx id to locate (dealt with below)
	
elsif cookies.key?("_osm_location")
	lon,lat,zoom,layers = cookies["_osm_location"].split("|")
	
elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil? 
	lon =  @user.home_lon<commit_msg>Check that the token is valid before using it.<commit_after><% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>
<p><%= t 'layouts.osm_offline' %>
</p>
<% elsif OSM_STATUS == :database_readonly or OSM_STATUS == :api_readonly %>
<p><%= t 'layouts.osm_read_only' %>
</p>
<% elsif !@user.data_public? %>
<p><%= t 'site.edit.not_public' %></p>
<p><%= t 'site.edit.not_public_description', 
:user_page => (link_to t('site.edit.user_page_link'), {:controller => 'user', :action => 'account', :display_name => @user.display_name, :anchor => 'public'}) %></p>
<p><%= t 'site.edit.anon_edits', :link => link_to(t('site.edit.anon_edits_link_text'), t('site.edit.anon_edits_link')) %></p>
<% else %>
<% content_for :greeting do %>
<% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
<%= link_to_function t('layouts.home'), "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)", { :title => t('layouts.home_tooltip') } %> |
<% end %>
<% end %>

<%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
<%= render :partial => 'search' %>

<%
session[:token] = @user.tokens.create.token unless session[:token] and UserToken.find_by_token(session[:token])

# Decide on a lat lon to initialise potlatch with. Various ways of doing this
if params['lon'] and params['lat']
	lon =  h(params['lon']) 
	lat =  h(params['lat']) 
	zoom =  h(params['zoom'])

elsif params['mlon'] and params['mlat'] 
	lon =  h(params['mlon']) 
	lat =  h(params['mlat']) 
	zoom =  h(params['zoom'])
	
elsif params['gpx']
	#use gpx id to locate (dealt with below)
	
elsif cookies.key?("_osm_location")
	lon,lat,zoom,layers = cookies["_osm_location"].split("|")
	
elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil? 
	lon =  @user.home_lon
{'fraction_non_alphanumeric': 0.22168192219679633, 'fraction_numerical': 0.0011441647597254005, 'mean_word_length': 5.41651376146789, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '214583', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1326, 'n_words': 287}