Merge branch 'master' into openid
This commit is contained in:
commit
03fb042591
63 changed files with 288 additions and 225 deletions
|
@ -249,18 +249,18 @@ class ApplicationController < ActionController::Base
|
|||
options = actions.extract_options!
|
||||
cache_path = options[:cache_path] || Hash.new
|
||||
|
||||
options[:unless] = case options[:unless]
|
||||
when NilClass then Array.new
|
||||
when Array then options[:unless]
|
||||
else unlessp = [ options[:unless] ]
|
||||
end
|
||||
|
||||
options[:unless].push(Proc.new do |controller|
|
||||
controller.params.include?(:page)
|
||||
end)
|
||||
|
||||
options[:cache_path] = Proc.new do |controller|
|
||||
user = controller.instance_variable_get("@user")
|
||||
|
||||
case
|
||||
when user.nil? then user = :none
|
||||
when user.display_name == controller.params[:display_name] then user = :self
|
||||
when user.administrator? then user = :administrator
|
||||
when user.moderator? then user = :moderator
|
||||
else user = :other
|
||||
end
|
||||
|
||||
cache_path.merge(controller.params).merge(:locale => I18n.locale, :user => user)
|
||||
cache_path.merge(controller.params).merge(:locale => I18n.locale)
|
||||
end
|
||||
|
||||
actions.push(options)
|
||||
|
@ -271,8 +271,9 @@ class ApplicationController < ActionController::Base
|
|||
##
|
||||
# extend expire_action to expire all variants
|
||||
def expire_action(options = {})
|
||||
path = ActionCachePath.path_for(self, options, false).gsub('?', '.').gsub(':', '.')
|
||||
expire_fragment(Regexp.new(Regexp.escape(path) + "\\..*"))
|
||||
I18n.available_locales.each do |locale|
|
||||
super options.merge(:locale => locale)
|
||||
end
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
@ -15,18 +15,17 @@ class TraceController < ApplicationController
|
|||
before_filter :offline_redirect, :only => [:create, :edit, :delete, :data, :api_data, :api_create]
|
||||
around_filter :api_call_handle_error, :only => [:api_details, :api_data, :api_create]
|
||||
|
||||
caches_action :list, :unless => :logged_in?, :layout => false
|
||||
caches_action :view, :layout => false
|
||||
caches_action :list, :view, :layout => false
|
||||
caches_action :georss, :layout => true
|
||||
cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create], :unless => OSM_STATUS == :database_offline
|
||||
cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create], :unless => OSM_STATUS == :database_offline
|
||||
|
||||
# Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.).
|
||||
# target_user - if set, specifies the user to fetch traces for. if not set will fetch all traces
|
||||
def list(target_user = nil, action = "list")
|
||||
def list
|
||||
# from display name, pick up user id if one user's traces only
|
||||
display_name = params[:display_name]
|
||||
if target_user.nil? and !display_name.blank?
|
||||
if !display_name.blank?
|
||||
target_user = User.find(:first, :conditions => { :status => ["active", "confirmed"], :display_name => display_name })
|
||||
if target_user.nil?
|
||||
@title = t'trace.no_such_user.title'
|
||||
|
@ -103,7 +102,7 @@ class TraceController < ApplicationController
|
|||
end
|
||||
|
||||
# final helper vars for view
|
||||
@action = action
|
||||
@target_user = target_user
|
||||
@display_name = target_user.display_name if target_user
|
||||
@all_tags = tagset.values
|
||||
@trace = Trace.new(:visibility => default_visibility) if @user
|
||||
|
@ -143,6 +142,10 @@ class TraceController < ApplicationController
|
|||
logger.info("id is #{@trace.id}")
|
||||
flash[:notice] = t 'trace.create.trace_uploaded'
|
||||
|
||||
if @user.traces.count(:conditions => { :inserted => false }) > 4
|
||||
flash[:warning] = t 'trace.trace_header.traces_waiting', :count => @user.traces.count(:conditions => { :inserted => false })
|
||||
end
|
||||
|
||||
redirect_to :action => 'mine'
|
||||
end
|
||||
else
|
||||
|
|
|
@ -40,14 +40,53 @@ module ApplicationHelper
|
|||
return js
|
||||
end
|
||||
|
||||
def style_rules
|
||||
css = ""
|
||||
|
||||
css << ".hidden { display: none }";
|
||||
css << ".hide_unless_logged_in { display: none }" unless @user;
|
||||
css << ".hide_if_logged_in { display: none }" if @user;
|
||||
css << ".hide_if_user_#{@user.id} { display: none }" if @user;
|
||||
css << ".show_if_user_#{@user.id} { display: inline }" if @user;
|
||||
css << ".hide_unless_administrator { display: none }" unless @user and @user.administrator?;
|
||||
|
||||
return content_tag(:style, css)
|
||||
end
|
||||
|
||||
def if_logged_in(tag = :div, &block)
|
||||
concat(content_tag(tag, capture(&block), :class => "hide_unless_logged_in"))
|
||||
end
|
||||
|
||||
def if_not_logged_in(tag = :div, &block)
|
||||
concat(content_tag(tag, capture(&block), :class => "hide_if_logged_in"))
|
||||
end
|
||||
|
||||
def if_user(user, tag = :div, &block)
|
||||
if user
|
||||
concat(content_tag(tag, capture(&block), :class => "hidden show_if_user_#{user.id}"))
|
||||
end
|
||||
end
|
||||
|
||||
def unless_user(user, tag = :div, &block)
|
||||
if user
|
||||
concat(content_tag(tag, capture(&block), :class => "hide_if_user_#{user.id}"))
|
||||
else
|
||||
concat(content_tag(tag, capture(&block)))
|
||||
end
|
||||
end
|
||||
|
||||
def if_administrator(tag = :div, &block)
|
||||
concat(content_tag(tag, capture(&block), :class => "hide_unless_administrator"))
|
||||
end
|
||||
|
||||
def describe_location(lat, lon, zoom = nil, language = nil)
|
||||
zoom = zoom || 14
|
||||
language = language || request.user_preferred_languages.join(',')
|
||||
url = "http://nominatim.openstreetmap.org/reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{language}"
|
||||
|
||||
begin
|
||||
Timeout::timeout(4) do
|
||||
response = REXML::Document.new(Net::HTTP.get(URI.parse(url)))
|
||||
response = Timeout::timeout(4) do
|
||||
REXML::Document.new(Net::HTTP.get(URI.parse(url)))
|
||||
end
|
||||
rescue Exception
|
||||
response = nil
|
||||
|
|
|
@ -48,7 +48,7 @@ class Notifier < ActionMailer::Base
|
|||
def message_notification(message)
|
||||
common_headers message.recipient
|
||||
from_header message.sender.display_name, "m", message.id, message.digest
|
||||
subject message.title
|
||||
subject I18n.t('notifier.message_notification.subject_header', :subject => message.title, :locale => locale)
|
||||
body :to_user => message.recipient.display_name,
|
||||
:from_user => message.sender.display_name,
|
||||
:body => message.body,
|
||||
|
|
|
@ -29,6 +29,8 @@ class User < ActiveRecord::Base
|
|||
validates_email_format_of :email
|
||||
validates_email_format_of :new_email, :allow_blank => true
|
||||
validates_format_of :display_name, :with => /^[^\/;.,?]*$/
|
||||
validates_format_of :display_name, :with => /^\S/, :message => "has leading whitespace"
|
||||
validates_format_of :display_name, :with => /\S$/, :message => "has trailing whitespace"
|
||||
validates_numericality_of :home_lat, :allow_nil => true
|
||||
validates_numericality_of :home_lon, :allow_nil => true
|
||||
validates_numericality_of :home_zoom, :only_integer => true, :allow_nil => true
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%= user_thumbnail diary_comment.user, :style => "float: right" %>
|
||||
<h4 id="comment<%= diary_comment.id %>"><%= t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => l(diary_comment.created_at, :format => :friendly)) %></h4>
|
||||
<%= htmlize(diary_comment.body) %>
|
||||
<% if @user && @user.administrator? %>
|
||||
<%= link_to t('diary_entry.diary_comment.hide_link'), {:action => 'hidecomment', :display_name => @user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id}, {:confirm => t('diary_entry.diary_comment.confirm')} %>
|
||||
<% if_administrator(:span) do %>
|
||||
<%= link_to t('diary_entry.diary_comment.hide_link'), {:action => 'hidecomment', :display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id}, {:confirm => t('diary_entry.diary_comment.confirm')} %>
|
||||
<% end %>
|
||||
<hr />
|
||||
|
|
|
@ -1,25 +1,30 @@
|
|||
<b><%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></b><br />
|
||||
|
||||
<div xml:lang="<%= diary_entry.language_code %>" lang="<%= diary_entry.language_code %>">
|
||||
<%= htmlize(diary_entry.body) %>
|
||||
<%= htmlize(diary_entry.body) %>
|
||||
</div>
|
||||
|
||||
<% if diary_entry.latitude and diary_entry.longitude %>
|
||||
<%= render :partial => "location", :object => diary_entry %>
|
||||
<br />
|
||||
<%= render :partial => "location", :object => diary_entry %>
|
||||
<br />
|
||||
<% end %>
|
||||
|
||||
<%= t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name), :created => l(diary_entry.created_at, :format => :friendly), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :language => diary_entry.language_code) %>
|
||||
|
||||
<% if params[:action] == 'list' %>
|
||||
<br />
|
||||
<%= link_to t('diary_entry.diary_entry.comment_link'), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'newcomment' %>
|
||||
|
|
||||
<%= link_to t('diary_entry.diary_entry.reply_link'), :controller => 'message', :action => 'new', :display_name => diary_entry.user.display_name, :title => "Re: #{diary_entry.title}" %>
|
||||
|
|
||||
<%= link_to t('diary_entry.diary_entry.comment_count', :count => diary_entry.visible_comments.count), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'comments' %>
|
||||
<br />
|
||||
<%= link_to t('diary_entry.diary_entry.comment_link'), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'newcomment' %>
|
||||
|
|
||||
<%= link_to t('diary_entry.diary_entry.reply_link'), :controller => 'message', :action => 'new', :display_name => diary_entry.user.display_name, :title => "Re: #{diary_entry.title}" %>
|
||||
|
|
||||
<%= link_to t('diary_entry.diary_entry.comment_count', :count => diary_entry.visible_comments.count), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'comments' %>
|
||||
<% end %>
|
||||
<% if @user == diary_entry.user %>
|
||||
| <%= link_to t('diary_entry.diary_entry.edit_link'), :action => 'edit', :display_name => @user.display_name, :id => diary_entry.id %>
|
||||
<% if_user(diary_entry.user, :span) do %>
|
||||
| <%= link_to t('diary_entry.diary_entry.edit_link'), :action => 'edit', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>
|
||||
<% end %>
|
||||
<% if @user && @user.administrator? %>
|
||||
| <%= link_to t('diary_entry.diary_entry.hide_link'), {:action => 'hide', :display_name => @user.display_name, :id => diary_entry.id}, {:confirm => t('diary_entry.diary_entry.confirm')} %>
|
||||
<% if_administrator(:span) do %>
|
||||
| <%= link_to t('diary_entry.diary_entry.hide_link'), {:action => 'hide', :display_name => diary_entry.user.display_name, :id => diary_entry.id}, {:confirm => t('diary_entry.diary_entry.confirm')} %>
|
||||
<% end %>
|
||||
|
||||
<br />
|
||||
<hr />
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<h2><%= h(@title) %></h2>
|
||||
|
||||
<% if @this_user %>
|
||||
<% if @user == @this_user %>
|
||||
<% if_user(@this_user) do %>
|
||||
<%= link_to image_tag("new.png", :border=>0) + t('diary_entry.list.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('diary_entry.list.new_title')} %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @user %>
|
||||
<% if_logged_in do %>
|
||||
<%= link_to image_tag("new.png", :border=>0) + t('diary_entry.list.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('diary_entry.list.new_title')} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -8,19 +8,19 @@
|
|||
|
||||
<%= render :partial => 'diary_comment', :collection => @entry.visible_comments %>
|
||||
|
||||
<% if @user %>
|
||||
<% if_logged_in(:div) do %>
|
||||
<h4 id="newcomment"><%= t 'diary_entry.view.leave_a_comment' %></h4>
|
||||
|
||||
<h4 id="newcomment"><%= t 'diary_entry.view.leave_a_comment' %></h4>
|
||||
<%= error_messages_for 'diary_comment' %>
|
||||
<% form_for :diary_comment, @diary_comment, :url => { :action => 'comment' } do |f| %>
|
||||
<%= f.text_area :body, :cols => 80, :rows => 5 %>
|
||||
<br />
|
||||
<br />
|
||||
<%= submit_tag t('diary_entry.view.save_button') %>
|
||||
<%= error_messages_for 'diary_comment' %>
|
||||
|
||||
<% form_for :diary_comment, @diary_comment, :url => { :action => 'comment' } do |f| %>
|
||||
<%= f.text_area :body, :cols => 80, :rows => 5 %>
|
||||
<br />
|
||||
<br />
|
||||
<%= submit_tag t('diary_entry.view.save_button') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<h4 id="newcomment"><%= t("diary_entry.view.login_to_leave_a_comment", :login_link => link_to(t("diary_entry.view.login"), :controller => 'user', :action => 'login', :referer => request.request_uri)) %></h4>
|
||||
|
||||
<% if_not_logged_in(:div) do %>
|
||||
<h4 id="newcomment"><%= t("diary_entry.view.login_to_leave_a_comment", :login_link => link_to(t("diary_entry.view.login"), :controller => 'user', :action => 'login', :referer => request.request_uri)) %></h4>
|
||||
<% end %>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<%= stylesheet_link_tag 'print', :media => "print" %>
|
||||
<%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %>
|
||||
<%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %>
|
||||
<%= style_rules %>
|
||||
<%= yield :head %>
|
||||
<title><%= t 'layouts.project_name.title' %><%= ' | '+ h(@title) if @title %></title>
|
||||
</head>
|
||||
|
@ -123,10 +124,6 @@
|
|||
<%= yield :left_menu %>
|
||||
</div>
|
||||
|
||||
<div id="sotm" class="notice">
|
||||
<%= link_to image_tag("sotm.png", :alt => t('layouts.sotm2010'), :title => t('layouts.sotm2010'), :border => "0"), "http://www.stateofthemap.org/register/" %>
|
||||
</div>
|
||||
|
||||
<%= yield :optionals %>
|
||||
|
||||
<center>
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<% if @user.traces.count(:conditions => ["inserted=?", false]) > 4 %>
|
||||
<p><%= t'trace.trace_header.traces_waiting', :count => @user.traces.count(:conditions => ["inserted=?", false]) %></p>
|
||||
<% end %>
|
||||
|
||||
<% form_for :trace, @trace, :url => { :action => "create" }, :html => { :multipart => true } do |f| %>
|
||||
<table>
|
||||
<tr><td align="right"><%= t'trace.trace_form.upload_gpx' %></td><td><%= f.file_field :gpx_file, :size => 50, :maxlength => 255 %></td></tr>
|
||||
<tr><td align="right"><%= t'trace.trace_form.description' %></td><td><%= f.text_field :description, :size => 50, :maxlength => 255 %></td></tr>
|
||||
<tr><td align="right"><%= t'trace.trace_form.tags' %></td><td><%= f.text_field :tagstring, :size => 50, :maxlength => 255 %> (<%= t'trace.trace_form.tags_help' %>)</td></tr>
|
||||
<tr><td align="right"><%= t'trace.trace_form.visibility' %></td><td><%= f.select :visibility, [[t('trace.visibility.private'),"private"],[t('trace.visibility.public'),"public"],[t('trace.visibility.trackable'),"trackable"],[t('trace.visibility.identifiable'),"identifiable"]] %> <span class="minorNote">(<a href="<%= t'trace.trace_form.visibility_help_url' %>"><%= t'trace.trace_form.visibility_help' %></a>)</span></td></tr>
|
||||
<tr><td></td><td><%= submit_tag t('trace.trace_form.upload_button') %> | <a href="<%= t'trace.trace_form.help_url' %>"><%= t'trace.trace_form.help' %></a></td></tr>
|
||||
</table>
|
||||
<% end %>
|
|
@ -1,18 +0,0 @@
|
|||
<h1><%= h(@title) %></h1>
|
||||
|
||||
<% content_for :head do %>
|
||||
<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
|
||||
<% if @user.nil? or @display_name.nil? or @user.display_name != @display_name %>
|
||||
| <%= link_to t('trace.trace_header.see_just_your_traces'), :action => 'mine' %>
|
||||
<% end %>
|
||||
<% if @tag or @display_name %>
|
||||
| <%= link_to t('trace.trace_header.see_all_traces'), :controller => 'trace', :action => 'list' %>
|
||||
<% end %>
|
||||
<% if @tag and @user and @user.display_name == @display_name %>
|
||||
| <%= link_to t('trace.trace_header.see_your_traces'), :controller => 'trace', :action => 'mine' %>
|
||||
<% end %>
|
||||
</p>
|
|
@ -1,13 +0,0 @@
|
|||
<%= render :partial => 'trace_paging_nav' %>
|
||||
|
||||
<table id="trace_list" cellpadding="3">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<%= render :partial => 'trace', :collection => @traces unless @traces.nil? %>
|
||||
</table>
|
||||
|
||||
<%= render :partial => 'trace_paging_nav' %>
|
||||
|
||||
<%= render :partial => 'trace_optionals' %>
|
|
@ -2,4 +2,12 @@
|
|||
|
||||
<%= error_messages_for 'trace' %>
|
||||
|
||||
<%= render :partial => 'trace_form' %>
|
||||
<% form_for :trace, @trace, :url => { :action => "create" }, :html => { :multipart => true } do |f| %>
|
||||
<table>
|
||||
<tr><td align="right"><%= t'trace.trace_form.upload_gpx' %></td><td><%= f.file_field :gpx_file, :size => 50, :maxlength => 255 %></td></tr>
|
||||
<tr><td align="right"><%= t'trace.trace_form.description' %></td><td><%= f.text_field :description, :size => 50, :maxlength => 255 %></td></tr>
|
||||
<tr><td align="right"><%= t'trace.trace_form.tags' %></td><td><%= f.text_field :tagstring, :size => 50, :maxlength => 255 %> (<%= t'trace.trace_form.tags_help' %>)</td></tr>
|
||||
<tr><td align="right"><%= t'trace.trace_form.visibility' %></td><td><%= f.select :visibility, [[t('trace.visibility.private'),"private"],[t('trace.visibility.public'),"public"],[t('trace.visibility.trackable'),"trackable"],[t('trace.visibility.identifiable'),"identifiable"]] %> <span class="minorNote">(<a href="<%= t'trace.trace_form.visibility_help_url' %>"><%= t'trace.trace_form.visibility_help' %></a>)</span></td></tr>
|
||||
<tr><td></td><td><%= submit_tag t('trace.trace_form.upload_button') %> | <a href="<%= t'trace.trace_form.help_url' %>"><%= t'trace.trace_form.help' %></a></td></tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
|
|
@ -1,5 +1,35 @@
|
|||
<%= render :partial => 'trace_header' %>
|
||||
<% if @user and @user.display_name == @display_name %>
|
||||
<%= render :partial => 'trace_form' %>
|
||||
<h1><%= h(@title) %></h1>
|
||||
|
||||
<% content_for :head do %>
|
||||
<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %>
|
||||
<% end %>
|
||||
<%= render :partial => 'trace_list' %>
|
||||
|
||||
<p>
|
||||
<%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
|
||||
<% unless_user(@target_user, :span) do %>
|
||||
| <%= link_to t('trace.trace_header.your_traces'), :action => 'mine' %>
|
||||
<% end %>
|
||||
| <%= link_to t('trace.trace_header.upload_trace'), :action => 'create' %>
|
||||
<% if @tag %>
|
||||
<% if @display_name %>
|
||||
| <%= link_to t('trace.trace_header.see_all_traces'), :controller => 'trace', :action => 'list' %>
|
||||
<% end %>
|
||||
<% if_user(@target_user, :span) do %>
|
||||
| <%= link_to t('trace.trace_header.see_your_traces'), :controller => 'trace', :action => 'mine' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<%= render :partial => 'trace_paging_nav' %>
|
||||
|
||||
<table id="trace_list" cellpadding="3">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<%= render :partial => 'trace', :collection => @traces unless @traces.nil? %>
|
||||
</table>
|
||||
|
||||
<%= render :partial => 'trace_paging_nav' %>
|
||||
|
||||
<%= render :partial => 'trace_optionals' %>
|
||||
|
|
|
@ -52,13 +52,11 @@
|
|||
|
||||
<br /><br />
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<% if @trace.user == @user %>
|
||||
<td><%= button_to t('trace.view.edit_track'), :controller => 'trace', :action => 'edit', :id => @trace.id %></td>
|
||||
<% end %>
|
||||
<% if @trace.user == @user %>
|
||||
<td><%= button_to t('trace.view.delete_track'), :controller => 'trace', :action => 'delete', :id => @trace.id %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table>
|
||||
<% if_user(@trace.user) do %>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= button_to t('trace.view.edit_track'), :controller => 'trace', :action => 'edit', :id => @trace.id %></td>
|
||||
<td><%= button_to t('trace.view.delete_track'), :controller => 'trace', :action => 'delete', :id => @trace.id %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
<h1><%= t "user.suspended.heading" %></h1>
|
||||
|
||||
<%= t "user.suspended.body", link_to t("user.suspended.webmaster"), "mailto:webmaster@openstreetmap.org" %>
|
||||
<%= t "user.suspended.body", :webmaster => link_to(t("user.suspended.webmaster"), "mailto:webmaster@openstreetmap.org") %>
|
||||
|
|
|
@ -28,7 +28,10 @@ standard_settings: &standard_settings
|
|||
spam_threshold: 50
|
||||
# Default legale (jurisdiction location) for contributor terms
|
||||
default_legale: GB
|
||||
|
||||
# Memory limits (in Mb)
|
||||
#soft_memory_limit: 512
|
||||
#hard_memory_limit: 2048
|
||||
|
||||
development:
|
||||
<<: *standard_settings
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ Rails::Initializer.run do |config|
|
|||
# Use the database for sessions instead of the cookie-based default,
|
||||
# which shouldn't be used to store highly confidential information
|
||||
# (create the session table with 'rake db:sessions:create')
|
||||
unless OSM_STATUS == :database_offline
|
||||
unless OSM_STATUS == :database_offline or OSM_STATUS == :database_readonly
|
||||
config.action_controller.session_store = :sql_session_store
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if defined?(ActiveRecord::ConnectionAdaptors::AbstractAdaptor)
|
||||
if defined?(ActiveRecord::ConnectionAdaptors::AbstractAdapter)
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters
|
||||
class AbstractAdapter
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
# Set a hard limit of 1Gb on the virtual size of the process
|
||||
if Process.const_defined?(:RLIMIT_AS)
|
||||
Process.setrlimit Process::RLIMIT_AS, 1024*1024*1024, Process::RLIM_INFINITY
|
||||
end
|
42
config/initializers/memory_limits.rb
Normal file
42
config/initializers/memory_limits.rb
Normal file
|
@ -0,0 +1,42 @@
|
|||
# Setup any specified hard limit on the virtual size of the process
|
||||
if APP_CONFIG.include?('hard_memory_limit') and Process.const_defined?(:RLIMIT_AS)
|
||||
Process.setrlimit Process::RLIMIT_AS, APP_CONFIG['hard_memory_limit']*1024*1024, Process::RLIM_INFINITY
|
||||
end
|
||||
|
||||
# If we're running under passenger and a soft memory limit is
|
||||
# configured then setup some rack middleware to police the limit
|
||||
if APP_CONFIG.include?('soft_memory_limit') and defined?(PhusionPassenger)
|
||||
# Define some rack middleware to police the soft memory limit
|
||||
class MemoryLimit
|
||||
def initialize(app)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
# Process this requst
|
||||
status, headers, body = @app.call(env)
|
||||
|
||||
# Restart if we've hit our memory limit
|
||||
if resident_size > APP_CONFIG['soft_memory_limit']
|
||||
Process.kill("USR1", 0)
|
||||
end
|
||||
|
||||
# Return the result of this request
|
||||
[status, headers, body]
|
||||
end
|
||||
private
|
||||
def resident_size
|
||||
# Read statm to get process sizes. Format is
|
||||
# Size RSS Shared Text Lib Data
|
||||
fields = File.open("/proc/self/statm") do |file|
|
||||
fields = file.gets.split(" ")
|
||||
end
|
||||
|
||||
# Return resident size in megabytes
|
||||
return fields[1].to_i / 256
|
||||
end
|
||||
end
|
||||
|
||||
# Install the memory limit checker
|
||||
Rails.configuration.middleware.use MemoryLimit
|
||||
end
|
|
@ -873,7 +873,6 @@ af:
|
|||
footer1: U kan ook die boodskap by {{readurl}} lees
|
||||
footer2: en u kan antwoord by {{replyurl}}
|
||||
hi: Hallo {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} het 'n nuwe boodskap aan u gestuur"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Bevestig u e-posadres"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1052,7 +1052,6 @@ aln:
|
|||
footer2: dhe ju muni me ju përgjigj tek {{replyurl}}
|
||||
header: "{{from_user}} ju ka dërgu një mesazh përmes OpenStreetMap me titullin {{subject}}:"
|
||||
hi: Tung {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} ju ka dërgu juve një mesazh të ri"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Konfirmoje email adresën tonde"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1056,7 +1056,6 @@ ar:
|
|||
footer2: ويمكنك الرد على {{replyurl}}
|
||||
header: "{{from_user}} قام بإرسال رسالة لك عبر خريطة الشارع المفتوحة بالعنوان {{subject}}:"
|
||||
hi: مرحبًا {{to_user}}،
|
||||
subject: "[خريطة الشارع المفتوحة] {{user}} أرسل لك رسالة جديدة"
|
||||
signup_confirm:
|
||||
subject: "[خريطة الشارع المفتوحة] أكّد عنوان بريدك الإلكتروني"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -973,7 +973,6 @@ arz:
|
|||
footer2: ويمكنك الرد على {{replyurl}}
|
||||
header: "{{from_user}} قام بإرسال رساله لك عبر خريطه الشارع المفتوحه بالعنوان {{subject}}:"
|
||||
hi: مرحبًا {{to_user}}،
|
||||
subject: "[خريطه الشارع المفتوحة] {{user}} أرسل لك رساله جديدة"
|
||||
signup_confirm:
|
||||
subject: "[خريطه الشارع المفتوحة] أكّد عنوان بريدك الإلكتروني"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -428,7 +428,6 @@ be:
|
|||
footer2: і вы можаце адказаць на {{replyurl}}
|
||||
header: "{{from_user}} адправіў вам паведамленне з тэмай {{subject}} праз OpenStreetMap:"
|
||||
hi: Прывітанне, {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} даслаў вам новае паведамленне"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Пацвердзіце ваш адрас электроннай пошты"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1039,7 +1039,6 @@ br:
|
|||
footer2: ha gallout a rit respont da {{replyurl}}
|
||||
header: "{{from_user}} en deus kaset deoc'h ur gemennadenn dre OpenStreetMap gant an danvez {{subject}} :"
|
||||
hi: Demat {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} en deus kaset ur gemennadenn deoc'h"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Kadarnaat ho chomlec'h postel"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -381,10 +381,15 @@ cs:
|
|||
secondary: Silnice II. třídy
|
||||
steps: Schody
|
||||
historic:
|
||||
battlefield: Bojiště
|
||||
memorial: Památník
|
||||
museum: Muzeum
|
||||
wreck: Vrak
|
||||
landuse:
|
||||
allotments: Zahrádkářská kolonie
|
||||
cemetery: Hřbitov
|
||||
construction: Staveniště
|
||||
landfill: Skládka
|
||||
vineyard: Vinice
|
||||
leisure:
|
||||
garden: Zahrada
|
||||
|
@ -424,7 +429,12 @@ cs:
|
|||
village: Vesnice
|
||||
railway:
|
||||
halt: Železniční zastávka
|
||||
level_crossing: Železniční přejezd
|
||||
light_rail: Rychlodráha
|
||||
monorail: Monorail
|
||||
narrow_gauge: Úzkorozchodná dráha
|
||||
subway: Stanice metra
|
||||
subway_entrance: Vstup do metra
|
||||
shop:
|
||||
hairdresser: Kadeřnictví
|
||||
tourism:
|
||||
|
@ -498,6 +508,7 @@ cs:
|
|||
shop_tooltip: Obchod se zbožím s logem OpenStreetMap
|
||||
sign_up: zaregistrovat se
|
||||
sign_up_tooltip: Vytvořit si uživatelský účet pro editaci
|
||||
sotm2010: Přijeďte na konferenci OpenStreetMap 2010 – Zpráva o stavu mapy, 9.–11. července v Gironě!
|
||||
tag_line: Otevřená wiki-mapa světa
|
||||
user_diaries: Deníčky
|
||||
user_diaries_tooltip: Zobrazit deníčky uživatelů
|
||||
|
@ -514,9 +525,12 @@ cs:
|
|||
inbox:
|
||||
date: Datum
|
||||
from: Od
|
||||
my_inbox: Má doručená pošta
|
||||
no_messages_yet: Zatím nemáte žádné zprávy. Co třeba kontaktovat nějaké {{people_mapping_nearby_link}}?
|
||||
outbox: odeslaná pošta
|
||||
people_mapping_nearby: uživatele poblíž
|
||||
subject: Předmět
|
||||
title: Doručená pošta
|
||||
you_have: Máte {{new_count}} nových a {{old_count}} starých zpráv
|
||||
mark:
|
||||
as_read: Zpráva označena jako přečtená
|
||||
|
@ -536,12 +550,22 @@ cs:
|
|||
title: Odeslat zprávu
|
||||
outbox:
|
||||
date: Datum
|
||||
inbox: doručená pošta
|
||||
my_inbox: Má {{inbox_link}}
|
||||
no_sent_messages: Nemáte žádné odeslané zprávy. Co třeba kontaktovat nějaké {{people_mapping_nearby_link}}?
|
||||
outbox: odeslaná pošta
|
||||
people_mapping_nearby: uživatele poblíž
|
||||
subject: Předmět
|
||||
title: Odeslaná pošta
|
||||
to: Komu
|
||||
you_have_sent_messages: Máte {{count}} odeslaných zpráv
|
||||
read:
|
||||
back_to_inbox: Zpět do přijatých zpráv
|
||||
back_to_outbox: Zpět do odeslaných zpráv
|
||||
date: Datum
|
||||
from: Od
|
||||
reading_your_messages: Čtení zpráv
|
||||
reading_your_sent_messages: Čtení odeslaných zpráv
|
||||
reply_button: Odpovědět
|
||||
subject: Předmět
|
||||
to: Komu
|
||||
|
@ -568,7 +592,6 @@ cs:
|
|||
footer2: a můžete odpovědět na {{replyurl}}
|
||||
header: "{{from_user}} vám poslal(a) prostřednictvím OpenStreetMap zprávu s předmětem {{subject}}:"
|
||||
hi: Dobrý den, uživateli {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} vám poslal novou zprávu"
|
||||
signup_confirm_plain:
|
||||
the_wiki_url: http://wiki.openstreetmap.org/wiki/Cs:Beginners_Guide?uselang=cs
|
||||
wiki_signup_url: http://wiki.openstreetmap.org/index.php?title=Special:UserLogin&type=signup&returnto=Cs:Main_Page&uselang=cs
|
||||
|
|
|
@ -1067,7 +1067,6 @@ de:
|
|||
footer2: und hier {{replyurl}} antworten
|
||||
header: "{{from_user}} hat dir eine Nachricht über OpenStreetMap mit dem Betreff {{subject}} gesendet:"
|
||||
hi: Hallo {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} hat dir eine Nachricht gesendet"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Deine E-Mail-Adresse bestätigen"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1062,7 +1062,6 @@ dsb:
|
|||
footer2: a na {{replyurl}} wótegroniś
|
||||
header: "{{from_user}} jo śi pósłał powěsć pśez OpenStreetMap z temowym nadpismom {{subject}}:"
|
||||
hi: Witaj {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} jo śi nowu powěsć pósłał"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Twóju e-mailowu adresu wobkšuśiś"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -933,7 +933,6 @@ en:
|
|||
shop: Shop
|
||||
shop_tooltip: Shop with branded OpenStreetMap merchandise
|
||||
shop_url: http://wiki.openstreetmap.org/wiki/Merchandise
|
||||
sotm2010: 'Come to the 2010 OpenStreetMap Conference, The State of the Map, July 9-11 in Girona!'
|
||||
license:
|
||||
alt: CC by-sa 2.0
|
||||
title: OpenStreetMap data is licensed under the Creative Commons Attribution-Share Alike 2.0 Generic License
|
||||
|
@ -1062,6 +1061,7 @@ en:
|
|||
header: "{{from_user}} has commented on your recent OpenStreetMap diary entry with the subject {{subject}}:"
|
||||
footer: "You can also read the comment at {{readurl}} and you can comment at {{commenturl}} or reply at {{replyurl}}"
|
||||
message_notification:
|
||||
subject_header: "[OpenStreetMap] {{subject}}"
|
||||
hi: "Hi {{to_user}},"
|
||||
header: "{{from_user}} has sent you a message through OpenStreetMap with the subject {{subject}}:"
|
||||
footer1: "You can also read the message at {{readurl}}"
|
||||
|
@ -1351,7 +1351,8 @@ en:
|
|||
help: "Help"
|
||||
help_url: "http://wiki.openstreetmap.org/wiki/Upload"
|
||||
trace_header:
|
||||
see_just_your_traces: "See just your traces, or upload a trace"
|
||||
your_traces: "See just your traces"
|
||||
upload_trace: "Upload a trace"
|
||||
see_all_traces: "See all traces"
|
||||
see_your_traces: "See all your traces"
|
||||
traces_waiting: "You have {{count}} traces waiting for upload. Please consider waiting for these to finish before uploading any more, so as not to block the queue for other users."
|
||||
|
|
|
@ -1054,7 +1054,6 @@ es:
|
|||
footer2: y puedes responder en {{replyurl}}
|
||||
header: "{{from_user}} te ha enviado un mensaje a través de OpenStreetMap con el asunto {{subject}}:"
|
||||
hi: Hola {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} te ha enviado un nuevo mensaje"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Confirme su dirección de correo electrónico"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -843,7 +843,6 @@ fi:
|
|||
greeting: Hei,
|
||||
message_notification:
|
||||
hi: Hei {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} on lähettänyt sinulle viestin"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Sähköpostiosoitteen vahvistus"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1057,7 +1057,6 @@ fr:
|
|||
footer2: et vous pouvez répondre sur {{replyurl}}
|
||||
header: "{{from_user}} vous a envoyé un message depuis OpenStreetMap avec le sujet {{subject}} :"
|
||||
hi: Bonjour {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} vous a envoyé un message"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Confirmer votre adresse de courriel"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1052,7 +1052,6 @@ hr:
|
|||
footer2: i možete odgovoriti na {{replyurl}}
|
||||
header: "{{from_user}} ti je poslao poruku preko OpenStreetMap sa predmetom {{subject}}:"
|
||||
hi: Bok {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} ti je poslao novu poruku"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] potvrdi email adresu"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1063,7 +1063,6 @@ hsb:
|
|||
footer2: a móžeš na {{replyurl}} wotmołwić
|
||||
header: "{{from_user}} je ći přez OpenStreetMap powěsć z temowym nadpismom {{subject}} pósłał:"
|
||||
hi: Witaj {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} je ći nowu powěsć pósłał"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Twoju e-mejlowu adresu wobkrućić"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -920,7 +920,7 @@ hu:
|
|||
shop_tooltip: Bolt márkás OpenStreetMap árukkal
|
||||
sign_up: regisztráció
|
||||
sign_up_tooltip: Új felhasználói fiók létrehozása szerkesztéshez
|
||||
sotm2010: Gyere a 2010-es OpenStreetMap konferenciára, The State of the Map, július 9-11. Amszterdamban!
|
||||
sotm2010: Gyere a 2010-es OpenStreetMap konferenciára, The State of the Map, július 9-11. Gironában!
|
||||
tag_line: A szabad világtérkép
|
||||
user_diaries: Naplók
|
||||
user_diaries_tooltip: Felhasználói naplók megtekintése
|
||||
|
@ -1056,7 +1056,6 @@ hu:
|
|||
footer2: "és válaszolhatsz rá itt: {{replyurl}}"
|
||||
header: "{{from_user}} küldött neked egy üzenetet az OpenStreetMapon keresztül {{subject}} tárggyal:"
|
||||
hi: Szia {{to_user}}!
|
||||
subject: "[OpenStreetMap] {{user}} küldött neked egy új üzenetet"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] E-mail cím megerősítése"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1052,7 +1052,6 @@ ia:
|
|||
footer2: e tu pote responder a {{replyurl}}
|
||||
header: "{{from_user}} te ha inviate un message per OpenStreetMap con le subjecto {{subject}}:"
|
||||
hi: Salute {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} te ha inviate un nove message"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Confirma tu adresse de e-mail"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -740,7 +740,6 @@ is:
|
|||
footer2: og svarað á {{replyurl}}
|
||||
header: "{{from_user}} hefur send þér skilaboð á OpenStreetMap með titlinum „{{subject}}“:"
|
||||
hi: Hæ {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} sendi þér ný skilaboð"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Staðfestu netfangið þitt"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -747,7 +747,6 @@ it:
|
|||
footer2: e puoi rispondere a {{replyurl}}
|
||||
header: "{{from_user}} ti ha inviato un messaggio tramite OpenStreetMap con l'oggetto {{subject}}:"
|
||||
hi: Ciao {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} ti ha inviato un nuovo messaggio"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Conferma il tuo indirizzo email"
|
||||
signup_confirm_html:
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1053,7 +1053,6 @@ nl:
|
|||
footer2: en u kunt antwoorden op {{replyurl}}
|
||||
header: "{{from_user}} heeft u een bericht gezonden via OpenStreetMap met het onderwerp {{subject}}:"
|
||||
hi: Hallo {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} heeft u een nieuw bericht gezonden"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Bevestig uw e-mailadres"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -953,7 +953,6 @@
|
|||
footer2: og du kan svare til {{replyurl}}
|
||||
header: "{{from_user}} har sendt deg en melding gjennom OpenStreetMap med emnet {{subject}}:"
|
||||
hi: Hei {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} sendte deg en melding"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Bekreft din e-postadresse"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1034,7 +1034,6 @@ pl:
|
|||
footer2: możesz odpowiedzieć pod adresem {{replyurl}}
|
||||
header: "{{from_user}} wysłał do Ciebie wiadomość z OpenStreetMap o temacie {{subject}}:"
|
||||
hi: Witaj {{to_user}},
|
||||
subject: "[OpenStreetMap] Użytkownik {{user}} przysłał nową wiadomość"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Prośba o potwierdzenie adresu e-mail"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -1082,7 +1082,6 @@ pt-BR:
|
|||
footer2: e pode respondê-la em {{replyurl}}
|
||||
header: "{{from_user}} enviou uma mensagem pelo OpenStreetMap para você com o assunto {{subject}}:"
|
||||
hi: Olá {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} enviou uma mensagem para você"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Confirme seu endereço de e-mail"
|
||||
signup_confirm_html:
|
||||
|
@ -1527,7 +1526,7 @@ pt-BR:
|
|||
webmaster: webmaster
|
||||
terms:
|
||||
agree: Concordo
|
||||
consider_pd: Desejo que minhas contribuições sejam de Domínio Público
|
||||
consider_pd: Em adição ao disposto acima, eu desejo que minhas contribuições sejam de Domínio Público
|
||||
consider_pd_why: o que é isso?
|
||||
decline: Discordo
|
||||
heading: Termos do Colaborador
|
||||
|
|
|
@ -1064,7 +1064,6 @@ ru:
|
|||
footer2: и вы можете ответить на {{replyurl}}
|
||||
header: "{{from_user}} отправил вам сообщение с темой {{subject}} через OpenStreetMap:"
|
||||
hi: Привет, {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} прислал вам новое сообщение"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Подтвердите ваш адрес электронной почты"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -982,7 +982,6 @@ sk:
|
|||
footer2: a môžete odpovedať na {{replyurl}}
|
||||
header: "{{from_user}} vám zaslal správu cez OpenStreetMap s predmetom {{subject}}:"
|
||||
hi: Ahoj {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} pošleme vám novú správu"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Potvrďte svoju e-mailovú adresu"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -628,7 +628,6 @@ sl:
|
|||
footer2: in nanj odgovorite na naslovu {{replyurl}}
|
||||
header: "Uporabnik {{from_user}} vam je prek OpenStreetMap poslal novo sporočilo glede {{subject}}:"
|
||||
hi: Pozdravljeni, {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} vam je poslal novo sporočilo"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Potrdite svoj elektronski naslov"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -734,7 +734,6 @@ sr-EC:
|
|||
message_notification:
|
||||
footer2: и можете одговорити на њу {{replyurl}}
|
||||
hi: Поздрав {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} вам је послао нову поруку"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Потврдите вашу адресу е-поште"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# Export driver: syck
|
||||
# Author: AS
|
||||
# Author: Andygol
|
||||
# Author: KEL
|
||||
# Author: Prima klasy4na
|
||||
# Author: Yurkoy
|
||||
# Author: Тест
|
||||
|
@ -925,6 +926,7 @@ uk:
|
|||
shop_tooltip: Магазин з фірмовою символікою OpenStreetMap
|
||||
sign_up: реєстрація
|
||||
sign_up_tooltip: Створити обліковий запис для редагування
|
||||
sotm2010: Запрошуємо на конференцію OpenStreetMap 2010 "The State of the Map", яка проходить 10-12 липня в Амстердамі!
|
||||
tag_line: Вільна Вікі-мапа Світу
|
||||
user_diaries: Щоденники
|
||||
user_diaries_tooltip: Подивитись щоденники
|
||||
|
@ -1061,7 +1063,6 @@ uk:
|
|||
footer2: і ви можете відповісти на {{replyurl}}
|
||||
header: "{{from_user}} надіслав вам повідомлення через OpenStreetMap з темою {{subject}}:"
|
||||
hi: Привіт, {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} надіслав вам нове повідомлення"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Підтвердіть вашу адресу електронної пошти"
|
||||
signup_confirm_html:
|
||||
|
@ -1497,7 +1498,7 @@ uk:
|
|||
webmaster: веб-майстер
|
||||
terms:
|
||||
agree: Приймаю
|
||||
consider_pd: Я вважаю, що мій внесок є суспільним надбанням
|
||||
consider_pd: На додаток до зазначеної угоди, я вважаю, що мій внесок є суспільним надбанням
|
||||
consider_pd_why: що це?
|
||||
decline: Відхилити
|
||||
heading: Умови співпраці
|
||||
|
|
|
@ -960,7 +960,6 @@ vi:
|
|||
footer2: và trả lời tại {{replyurl}}
|
||||
header: "{{from_user}} đã gửi thư cho bạn dùng OpenStreetMap có tiêu đề {{subject}}:"
|
||||
hi: Chào {{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}} đã gửi thư mới cho bạn"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] Xác nhận địa chỉ thư điện tử của bạn"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -360,7 +360,6 @@ zh-CN:
|
|||
footer2: 并且您可以在{{replyurl}}回复
|
||||
header: "{{from_user}}已经通过OpenStreetMap向您发送标题为{{subject}}的消息:"
|
||||
hi: 您好{{to_user}},
|
||||
subject: "[OpenStreetMap] {{user}}给您发送新消息"
|
||||
signup_confirm_html:
|
||||
click_the_link: 如果是您本人,那么欢迎您!请点击一下链接确认帐户并阅读更多关于OpenStreetMap的信息
|
||||
current_user: 一个基于其所处位置的,当前用户分类列表可从这里获得<a href="http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.
|
||||
|
|
|
@ -536,7 +536,6 @@ zh-TW:
|
|||
footer2: 並在 {{replyurl}} 回覆
|
||||
header: "{{from_user}} 透過 OpenStreetMap 寄給您主旨為 {{subject}} 的訊息:"
|
||||
hi: "{{to_user}}您好,"
|
||||
subject: "[OpenStreetMap] {{user}} 寄給您新的訊息"
|
||||
signup_confirm:
|
||||
subject: "[OpenStreetMap] 確認您的電子郵件"
|
||||
signup_confirm_html:
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# Export driver: syck
|
||||
# Author: AS
|
||||
# Author: Andygol
|
||||
# Author: KEL
|
||||
# Author: Prima klasy4na
|
||||
uk:
|
||||
a_poi: $1 об’єкта (POI)
|
||||
|
@ -136,6 +137,7 @@ uk:
|
|||
option_layer_os_streetview: "В.БРИТАНІЯ: OS StreetView"
|
||||
option_layer_osmarender: OSM — Osmarender
|
||||
option_layer_streets_haiti: "Гаїті: назви вулиць"
|
||||
option_layer_surrey_air_survey: "UK: Surrey Air Survey"
|
||||
option_layer_tip: Оберіть фон
|
||||
option_limitways: Попереджати при завантаженні\nвеликих обсягів даних
|
||||
option_microblog_id: "Ім'я мікроблогу:"
|
||||
|
|
|
@ -104,7 +104,7 @@ class DiffReader
|
|||
|
||||
# take the first element and check that it is an osmChange element
|
||||
@reader.read
|
||||
raise APIBadUserInput.new("Document element should be 'osmChange'.") if @reader.name != 'osmChange'
|
||||
raise OSM::APIBadUserInput.new("Document element should be 'osmChange'.") if @reader.name != 'osmChange'
|
||||
|
||||
result = OSM::API.new.get_xml_doc
|
||||
result.root.name = "diffResult"
|
||||
|
@ -185,7 +185,7 @@ class DiffReader
|
|||
# delete doesn't have to contain a full payload, according to
|
||||
# the wiki docs, so we just extract the things we need.
|
||||
new_id = xml['id'].to_i
|
||||
raise API::APIBadXMLError.new(model, xml, "ID attribute is required") if new_id.nil?
|
||||
raise OSM::APIBadXMLError.new(model, xml, "ID attribute is required") if new_id.nil?
|
||||
|
||||
# if the ID is a placeholder then map it to the real ID
|
||||
model_sym = model.to_s.downcase.to_sym
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
|
@ -34,21 +34,24 @@ function createMap(divName, options) {
|
|||
var mapnik = new OpenLayers.Layer.OSM.Mapnik(i18n("javascripts.map.base.mapnik"), {
|
||||
keyid: "mapnik",
|
||||
displayOutsideMaxExtent: true,
|
||||
wrapDateLine: true
|
||||
wrapDateLine: true,
|
||||
layerCode: "M"
|
||||
});
|
||||
map.addLayer(mapnik);
|
||||
|
||||
var osmarender = new OpenLayers.Layer.OSM.Osmarender(i18n("javascripts.map.base.osmarender"), {
|
||||
keyid: "osmarender",
|
||||
displayOutsideMaxExtent: true,
|
||||
wrapDateLine: true
|
||||
wrapDateLine: true,
|
||||
layerCode: "O"
|
||||
});
|
||||
map.addLayer(osmarender);
|
||||
|
||||
var cyclemap = new OpenLayers.Layer.OSM.CycleMap(i18n("javascripts.map.base.cycle_map"), {
|
||||
keyid: "cyclemap",
|
||||
displayOutsideMaxExtent: true,
|
||||
wrapDateLine: true
|
||||
wrapDateLine: true,
|
||||
layerCode: "C"
|
||||
});
|
||||
map.addLayer(cyclemap);
|
||||
|
||||
|
@ -60,16 +63,11 @@ function createMap(divName, options) {
|
|||
], {
|
||||
displayOutsideMaxExtent: true,
|
||||
wrapDateLine: true,
|
||||
numZoomLevels: 19
|
||||
numZoomLevels: 19,
|
||||
layerCode: "N"
|
||||
});
|
||||
map.addLayer(noname);
|
||||
|
||||
var maplint = new OpenLayers.Layer.OSM.Maplint(i18n("javascripts.map.overlays.maplint"), {
|
||||
displayOutsideMaxExtent: true,
|
||||
wrapDateLine: true
|
||||
});
|
||||
map.addLayer(maplint);
|
||||
|
||||
var numZoomLevels = Math.max(mapnik.numZoomLevels, osmarender.numZoomLevels);
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("Markers", {
|
||||
|
@ -226,39 +224,53 @@ function getEventPosition(event) {
|
|||
function getMapLayers() {
|
||||
var layerConfig = "";
|
||||
|
||||
for (var layers = map.getLayersBy("isBaseLayer", true), i = 0; i < layers.length; i++) {
|
||||
layerConfig += layers[i] == map.baseLayer ? "B" : "0";
|
||||
}
|
||||
|
||||
for (var layers = map.getLayersBy("isBaseLayer", false), i = 0; i < layers.length; i++) {
|
||||
layerConfig += layers[i].getVisibility() ? "T" : "F";
|
||||
for (var i = 0; i < map.layers.length; i++) {
|
||||
if (map.layers[i].layerCode && map.layers[i].getVisibility()) {
|
||||
layerConfig += map.layers[i].layerCode;
|
||||
}
|
||||
}
|
||||
|
||||
return layerConfig;
|
||||
}
|
||||
|
||||
function setMapLayers(layerConfig) {
|
||||
var l = 0;
|
||||
if (layerConfig.charAt(0) == "B" || layerConfig.charAt(0) == "0") {
|
||||
var l = 0;
|
||||
|
||||
for (var layers = map.getLayersBy("isBaseLayer", true), i = 0; i < layers.length; i++) {
|
||||
var c = layerConfig.charAt(l++);
|
||||
for (var layers = map.getLayersBy("isBaseLayer", true), i = 0; i < layers.length; i++) {
|
||||
var c = layerConfig.charAt(l++);
|
||||
|
||||
if (c == "B") {
|
||||
map.setBaseLayer(layers[i]);
|
||||
if (c == "B") {
|
||||
map.setBaseLayer(layers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (layerConfig.charAt(l) == "B" || layerConfig.charAt(l) == "0") {
|
||||
l++;
|
||||
}
|
||||
while (layerConfig.charAt(l) == "B" || layerConfig.charAt(l) == "0") {
|
||||
l++;
|
||||
}
|
||||
|
||||
for (var layers = map.getLayersBy("isBaseLayer", false), i = 0; i < layers.length; i++) {
|
||||
var c = layerConfig.charAt(l++);
|
||||
for (var layers = map.getLayersBy("isBaseLayer", false), i = 0; i < layers.length; i++) {
|
||||
var c = layerConfig.charAt(l++);
|
||||
|
||||
if (c == "T") {
|
||||
layers[i].setVisibility(true);
|
||||
} else if(c == "F") {
|
||||
layers[i].setVisibility(false);
|
||||
if (c == "T") {
|
||||
layers[i].setVisibility(true);
|
||||
} else if(c == "F") {
|
||||
layers[i].setVisibility(false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < map.layers.length; i++) {
|
||||
if (map.layers[i].layerCode) {
|
||||
if (layerConfig.indexOf(map.layers[i].layerCode) >= 0) {
|
||||
if (map.layers[i].isBaseLayer) {
|
||||
map.setBaseLayer(map.layers[i]);
|
||||
} else {
|
||||
map.layers[i].setVisibility(true);
|
||||
}
|
||||
} else {
|
||||
map.layers[i].setVisibility(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,10 +107,8 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj
|
|||
args[objtype] = objid;
|
||||
}
|
||||
|
||||
// This is a hack to omit the default mapnik layer (B000FTF) from
|
||||
// the shortlink. B000FTFT is then the "Object" layer which we get
|
||||
// on /?{node,way,relation}=id
|
||||
if (layers && (layers != "B000FTF") && (layers != "B000FTFT")) {
|
||||
// This is a hack to omit the default mapnik layer from the shortlink.
|
||||
if (layers && layers != "M") {
|
||||
args["layers"] = layers;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -111,31 +111,3 @@ OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
|||
|
||||
CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Layer.OSM.Maplint
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.OSM>
|
||||
*/
|
||||
OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.OSM.Maplint
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String}
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
var url = [
|
||||
"http://d.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
|
||||
"http://e.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
|
||||
"http://f.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png"
|
||||
];
|
||||
options = OpenLayers.Util.extend({ numZoomLevels: 18, isBaseLayer: false, visibility: false }, options);
|
||||
var newArguments = [name, url, options];
|
||||
OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Layer.OSM.Maplint"
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.node { padding-left: 25px; }
|
||||
.way { padding-left: 25px; }
|
||||
.relation { padding-left: 25px; }
|
||||
|
||||
.deleted { text-decoration: line-through; }
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ mail = TMail::Mail.parse(STDIN.readlines.join)
|
|||
|
||||
message = Message.new(:sender => from, :recipient => to,
|
||||
:sent_on => Time.now.getutc,
|
||||
:title => mail.subject,
|
||||
:title => mail.subject.sub(/\[OpenStreetMap\] */, ""),
|
||||
:body => mail.body)
|
||||
message.save!
|
||||
|
||||
|
|
|
@ -137,7 +137,9 @@ class DiaryEntryControllerTest < ActionController::TestCase
|
|||
assert_select "p", :text => /#{new_body}/, :count => 1
|
||||
assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1
|
||||
# As we're not logged in, check that you cannot edit
|
||||
assert_select "a[href='/user/#{users(:normal_user).display_name}/diary/#{diary_entries(:normal_user_entry_1).id}/edit']", :text => "Edit this entry", :count => 0
|
||||
assert_select "span[class=hidden show_if_user_#{users(:normal_user).id}]", :count => 1 do
|
||||
assert_select "a[href='/user/#{users(:normal_user).display_name}/diary/#{diary_entries(:normal_user_entry_1).id}/edit']", :text => "Edit this entry", :count => 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue