initialize: function (id, options) {
L.Map.prototype.initialize.call(this, id, options);
- var copyright = I18n.t("javascripts.map.copyright", { copyright_url: "/copyright" });
- var donate = I18n.t("javascripts.map.donate_link_text", { donate_url: "https://donate.openstreetmap.org" });
- var terms = I18n.t("javascripts.map.terms", { terms_url: "https://wiki.osmfoundation.org/wiki/Terms_of_Use" });
- var cyclosm = I18n.t("javascripts.map.cyclosm", { cyclosm_url: "https://www.cyclosm.org", osmfrance_url: "https://openstreetmap.fr/" });
- var thunderforest = I18n.t("javascripts.map.thunderforest", { thunderforest_url: "https://www.thunderforest.com/" });
- var memomaps = I18n.t("javascripts.map.opnvkarte", { memomaps_url: "https://memomaps.de/" });
- var hotosm = I18n.t("javascripts.map.hotosm", { hotosm_url: "https://www.hotosm.org/", osmfrance_url: "https://openstreetmap.fr/" });
+ var copyright_link = $("<a>", {
+ href: "/copyright",
+ text: I18n.t("javascripts.map.openstreetmap_contributors")
+ }).prop("outerHTML");
+ var copyright = I18n.t("javascripts.map.copyright_text", { copyright_link: copyright_link });
+
+ var donate = $("<a>", {
+ "href": "https://donate.openstreetmap.org",
+ "class": "donate-attr",
+ "text": I18n.t("javascripts.map.make_a_donation")
+ }).prop("outerHTML");
+
+ var terms = $("<a>", {
+ href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
+ text: I18n.t("javascripts.map.website_and_api_terms")
+ }).prop("outerHTML");
+
+ var cyclosm_link = $("<a>", {
+ href: "https://www.cyclosm.org",
+ target: "_blank",
+ text: I18n.t("javascripts.map.cyclosm_name")
+ }).prop("outerHTML");
+ var osm_france_link = $("<a>", {
+ href: "https://openstreetmap.fr/",
+ target: "_blank",
+ text: I18n.t("javascripts.map.osm_france")
+ }).prop("outerHTML");
+ var cyclosm = I18n.t("javascripts.map.cyclosm_credit", { cyclosm_link: cyclosm_link, osm_france_link: osm_france_link });
+
+ var thunderforest_link = $("<a>", {
+ href: "https://www.thunderforest.com/",
+ target: "_blank",
+ text: I18n.t("javascripts.map.andy_allan")
+ }).prop("outerHTML");
+ var thunderforest = I18n.t("javascripts.map.thunderforest_credit", { thunderforest_link: thunderforest_link });
+
+ var memomaps_link = $("<a>", {
+ href: "https://memomaps.de/",
+ target: "_blank",
+ text: I18n.t("javascripts.map.memomaps")
+ }).prop("outerHTML");
+ var memomaps = I18n.t("javascripts.map.opnvkarte_credit", { memomaps_link: memomaps_link });
+
+ var hotosm_link = $("<a>", {
+ href: "https://www.hotosm.org/",
+ target: "_blank",
+ text: I18n.t("javascripts.map.hotosm_name")
+ }).prop("outerHTML");
+ var hotosm = I18n.t("javascripts.map.hotosm_credit", { hotosm_link: hotosm_link, osm_france_link: osm_france_link });
this.baseLayers = [];
def note_event(event, at, by)
if by.nil?
- t("notes.show.#{event}_by_anonymous_html",
- :when => friendly_date_ago(at),
- :exact_time => l(at))
+ t("notes.show.event_#{event}_by_anonymous_html",
+ :time_ago => tag.abbr(friendly_date_ago(at),
+ :title => l(at)))
else
- t("notes.show.#{event}_by_html",
- :when => friendly_date_ago(at),
- :exact_time => l(at),
+ t("notes.show.event_#{event}_by_html",
+ :time_ago => tag.abbr(friendly_date_ago(at),
+ :title => l(at)),
:user => note_author(by))
end
end
<%= render "sidebar_header", :title => t("site.sidebar.search_results") %>
<% @sources.each do |source| %>
- <h4><%= t(".title.#{source}_html") %></h4>
+ <h4>
+ <%= t(".title.results_from_html", :results_link => link_to(t(".title.#{source}"),
+ t(".title.#{source}_url"))) %>
+ </h4>
<div class="search_results_entry mx-n3" data-href="<%= url_for @params.merge(:action => "search_#{source}") %>">
<div class="text-center loader">
<div class="spinner-border" role="status">
<div class='col-sm'>
<h5><%= t "site.welcome.add_a_note.title" %></h5>
<p><%= t "site.welcome.add_a_note.para_1" %></p>
- <p><%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %></p>
+ <p><%= t ".how_to_help.add_a_note.instructions_1_html", :note_icon => tag.a(:class => "icon note") %></p>
</div>
</div>
<%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %>
<%= f.email_field :email, :tabindex => 1 %>
- <%= f.email_field :email_confirmation, :tabindex => 2 %>
+ <%= f.email_field :email_confirmation, :help => t(".email_confirmation_help_html",
+ :privacy_policy_link => link_to(t(".privacy_policy"),
+ t(".privacy_policy_url"),
+ :title => t(".privacy_policy_title"))),
+ :tabindex => 2 %>
<%= f.text_field :display_name, :help => t(".display name description"), :tabindex => 3 %>
reason: The reason why the user is being blocked. Please be as calm and as reasonable as possible, giving as much detail as you can about the situation, remembering that the message will be publicly visible. Bear in mind that not all users understand the community jargon, so please try to use layman's terms.
needs_view: Does the user need to log in before this block will be cleared?
user:
- email_confirmation: 'Your address is not displayed publicly, see our <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy" title="OSMF privacy policy including section on email addresses">privacy policy</a> for more information.'
new_email: "(never displayed publicly)"
datetime:
distance_in_words_ago:
geocoder:
search:
title:
- latlon_html: 'Results from <a href="https://openstreetmap.org/">Internal</a>'
- osm_nominatim_html: 'Results from <a href="https://nominatim.openstreetmap.org/">OpenStreetMap Nominatim</a>'
- osm_nominatim_reverse_html: 'Results from <a href="https://nominatim.openstreetmap.org/">OpenStreetMap Nominatim</a>'
+ results_from_html: 'Results from %{results_link}'
+ latlon: Internal
+ latlon_url: https://openstreetmap.org/
+ osm_nominatim: OpenStreetMap Nominatim
+ osm_nominatim_url: https://nominatim.openstreetmap.org/
+ osm_nominatim_reverse: OpenStreetMap Nominatim
+ osm_nominatim_reverse_url: https://nominatim.openstreetmap.org/
search_osm_nominatim:
prefix_format: "%{name}"
prefix:
If you have noticed a problem with our map data, for example a road is missing or your address, the best way to
proceed is to join the OpenStreetMap community and add or repair the data yourself.
add_a_note:
- instructions_html: |
- Just click <a class='icon note'></a> or the same icon on the map display.
+ instructions_1_html: |
+ Just click %{note_icon} or the same icon on the map display.
This will add a marker to the map, which you can move
by dragging. Add your message, then click save, and other mappers will investigate.
other_concerns:
auth no password: "With third party authentication a password is not required, but some extra tools or server may still need one."
continue: Sign Up
terms accepted: "Thanks for accepting the new contributor terms!"
+ email_confirmation_help_html: 'Your address is not displayed publicly, see our %{privacy_policy_link} for more information.'
+ privacy_policy: privacy policy
+ privacy_policy_url: https://wiki.osmfoundation.org/wiki/Privacy_Policy
+ privacy_policy_title: OSMF privacy policy including section on email addresses
terms:
title: "Terms"
heading: "Terms"
open_title: "Unresolved note #%{note_name}"
closed_title: "Resolved note #%{note_name}"
hidden_title: "Hidden note #%{note_name}"
- opened_by_html: "Created by %{user} <abbr title='%{exact_time}'>%{when}</abbr>"
- opened_by_anonymous_html: "Created by anonymous <abbr title='%{exact_time}'>%{when}</abbr>"
- commented_by_html: "Comment from %{user} <abbr title='%{exact_time}'>%{when}</abbr>"
- commented_by_anonymous_html: "Comment from anonymous <abbr title='%{exact_time}'>%{when}</abbr>"
- closed_by_html: "Resolved by %{user} <abbr title='%{exact_time}'>%{when}</abbr>"
- closed_by_anonymous_html: "Resolved by anonymous <abbr title='%{exact_time}'>%{when}</abbr>"
- reopened_by_html: "Reactivated by %{user} <abbr title='%{exact_time}'>%{when}</abbr>"
- reopened_by_anonymous_html: "Reactivated by anonymous <abbr title='%{exact_time}'>%{when}</abbr>"
- hidden_by_html: "Hidden by %{user} <abbr title='%{exact_time}'>%{when}</abbr>"
+ event_opened_by_html: "Created by %{user} %{time_ago}"
+ event_opened_by_anonymous_html: "Created by anonymous %{time_ago}"
+ event_commented_by_html: "Comment from %{user} %{time_ago}"
+ event_commented_by_anonymous_html: "Comment from anonymous %{time_ago}"
+ event_closed_by_html: "Resolved by %{user} %{time_ago}"
+ event_closed_by_anonymous_html: "Resolved by anonymous %{time_ago}"
+ event_reopened_by_html: "Reactivated by %{user} %{time_ago}"
+ event_reopened_by_anonymous_html: "Reactivated by anonymous %{time_ago}"
+ event_hidden_by_html: "Hidden by %{user} %{time_ago}"
report: report this note
coordinates_html: "%{latitude}, %{longitude}"
anonymous_warning: This note includes comments from anonymous users which should be independently verified.
gps: Public GPS Traces
overlays: Enable overlays for troubleshooting the map
title: "Layers"
- copyright: "© <a href='%{copyright_url}'>OpenStreetMap contributors</a>"
- donate_link_text: "<a class='donate-attr' href='%{donate_url}'>Make a Donation</a>"
- terms: "<a href='%{terms_url}' target='_blank'>Website and API terms</a>"
- cyclosm: "Tiles style by <a href='%{cyclosm_url}' target='_blank'>CyclOSM</a> hosted by <a href='%{osmfrance_url}' target='_blank'>OpenStreetMap France</a>"
- thunderforest: "Tiles courtesy of <a href='%{thunderforest_url}' target='_blank'>Andy Allan</a>"
- opnvkarte: "Tiles courtesy of <a href='%{memomaps_url}' target='_blank'>MeMoMaps</a>"
- hotosm: "Tiles style by <a href='%{hotosm_url}' target='_blank'>Humanitarian OpenStreetMap Team</a> hosted by <a href='%{osmfrance_url}' target='_blank'>OpenStreetMap France</a>"
+ copyright_text: "© %{copyright_link}"
+ openstreetmap_contributors: "OpenStreetMap contributors"
+ make_a_donation: Make a Donation
+ website_and_api_terms: Website and API terms
+ cyclosm_credit: "Tiles style by %{cyclosm_link} hosted by %{osm_france_link}"
+ cyclosm_name: CyclOSM
+ osm_france: OpenStreetMap France
+ thunderforest_credit: "Tiles courtesy of %{thunderforest_link}"
+ andy_allan: Andy Allan
+ opnvkarte_credit: "Tiles courtesy of %{memomaps_link}"
+ memomaps: MeMoMaps
+ hotosm_credit: "Tiles style by %{hotosm_link} hosted by %{osm_france_link}"
+ hotosm_name: Humanitarian OpenStreetMap Team
site:
edit_tooltip: Edit the map
edit_disabled_tooltip: Zoom in to edit the map
date = Time.new(2014, 3, 5, 21, 37, 45, "+00:00")
user = create(:user)
- assert_match %r{^Created by anonymous <abbr title='Wed, 05 Mar 2014 21:37:45 \+0000'><span title=" 5 March 2014 at 21:37">.* ago</span></abbr>$}, note_event("opened", date, nil)
- assert_match %r{^Resolved by <a href="/user/#{ERB::Util.u(user.display_name)}">#{user.display_name}</a> <abbr title='Wed, 05 Mar 2014 21:37:45 \+0000'><span title=" 5 March 2014 at 21:37">.* ago</span></abbr>$}, note_event("closed", date, user)
+ assert_match %r{^Created by anonymous <abbr title="Wed, 05 Mar 2014 21:37:45 \+0000"><span title=" 5 March 2014 at 21:37">.* ago</span></abbr>$}, note_event("opened", date, nil)
+ assert_match %r{^Resolved by <a href="/user/#{ERB::Util.u(user.display_name)}">#{user.display_name}</a> <abbr title="Wed, 05 Mar 2014 21:37:45 \+0000"><span title=" 5 March 2014 at 21:37">.* ago</span></abbr>$}, note_event("closed", date, user)
end
def test_note_author