]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/2698'
authorTom Hughes <tom@compton.nu>
Wed, 8 Jul 2020 18:10:01 +0000 (19:10 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 8 Jul 2020 18:10:01 +0000 (19:10 +0100)
31 files changed:
app/abilities/ability.rb
app/assets/javascripts/embed.js.erb
app/assets/javascripts/leaflet.layers.js
app/assets/javascripts/leaflet.map.js
app/assets/javascripts/leaflet.share.js
app/assets/stylesheets/common.scss
app/assets/stylesheets/small.scss
app/controllers/api/changesets_controller.rb
app/controllers/api/notes_controller.rb
app/controllers/api/traces_controller.rb
app/controllers/api/users_controller.rb
app/controllers/notes_controller.rb
app/views/browse/changeset.html.erb
app/views/browse/note.html.erb
app/views/diary_entries/_diary_comment.html.erb
app/views/diary_entries/_diary_entry.html.erb
app/views/issues/show.html.erb
app/views/notes/index.html.erb [moved from app/views/notes/mine.html.erb with 85% similarity]
app/views/traces/_trace.html.erb
app/views/users/_contact.html.erb
app/views/users/account.html.erb
app/views/users/confirm.html.erb
app/views/users/login.html.erb
app/views/users/show.html.erb
app/views/users/terms.html.erb
config/initializers/secure_headers.rb
config/locales/en.yml
config/routes.rb
test/abilities/abilities_test.rb
test/controllers/notes_controller_test.rb
vendor/assets/leaflet/leaflet.osm.js

index e72b4e85b64d55e6787cca9604c2dca29e0e3c78..d91b7a2e738015a163671fb1674107fc27c84152 100644 (file)
@@ -17,7 +17,7 @@ class Ability
       can [:index, :feed], Changeset
       can :index, ChangesetComment
       can [:index, :rss, :show, :comments], DiaryEntry
-      can [:mine], Note
+      can [:index], Note
       can [:index, :show], Redaction
       can [:index, :show, :data, :georss, :picture, :icon], Trace
       can [:terms, :login, :logout, :new, :create, :save, :confirm, :confirm_resend, :confirm_email, :lost_password, :reset_password, :show, :auth_success, :auth_failure], User
index ceb488f987681871e05c87476e5a464de126c79d..858b3130284a0857e8d48d5f37ff7cb1f14a7f2c 100644 (file)
@@ -35,6 +35,8 @@ window.onload = function () {
     new L.OSM.CycleMap(thunderforestOptions).addTo(map);
   } else if (args.layer === "transportmap") {
     new L.OSM.TransportMap(thunderforestOptions).addTo(map);
+  } else if (args.layer === "opnvkarte") {
+    new L.OSM.OPNVKarte().addTo(map);
   } else if (args.layer === "hot") {
     new L.OSM.HOT().addTo(map);
   }
index 87ff8737048a6319c91839416e41f38f23bff4da..ddcce195daba2d5f7724d2b81ab876d51d6efeeb 100644 (file)
@@ -116,7 +116,7 @@ L.OSM.layers = function (options) {
 
       $("<p>")
         .text(I18n.t("javascripts.map.layers.overlays"))
-        .attr("class", "deemphasize")
+        .attr("class", "text-muted")
         .appendTo(overlaySection);
 
       var overlays = $("<ul class='list-unstyled'>")
index a139b6dcd7080ab40045611dc9ab0ea8779f411c..497062e440167ae3f9478e26cdf6f39952c5c2e9 100644 (file)
@@ -19,6 +19,7 @@ L.OSM.Map = L.Map.extend({
     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 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/" });
 
     this.baseLayers = [];
@@ -48,6 +49,13 @@ L.OSM.Map = L.Map.extend({
       }));
     }
 
+    this.baseLayers.push(new L.OSM.OPNVKarte ({
+      attribution: copyright + ". " + memomaps + ". " + terms,
+      code: "O",
+      keyid: "opnvkarte",
+      name: I18n.t("javascripts.map.base.opnvkarte")
+    }));
+
     this.baseLayers.push(new L.OSM.HOT({
       attribution: copyright + ". " + hotosm + ". " + terms,
       code: "H",
index 8b1446ff8d4a849d3d2f889bd3b4d137cebebaea..c4a5d026580df296205c3c2bb86799bd292b773e 100644 (file)
@@ -116,7 +116,7 @@ L.OSM.share = function (options) {
           .on("click", select))
       .append(
         $("<p>")
-          .attr("class", "deemphasize")
+          .attr("class", "text-muted")
           .text(I18n.t("javascripts.share.paste_html"))
           .appendTo($linkSection));
 
@@ -147,7 +147,7 @@ L.OSM.share = function (options) {
 
     $("<div>")
       .attr("id", "export-warning")
-      .attr("class", "deemphasize")
+      .attr("class", "text-muted")
       .text(I18n.t("javascripts.share.only_standard_layer"))
       .appendTo($imageSection);
 
@@ -223,7 +223,7 @@ L.OSM.share = function (options) {
       .appendTo($form);
 
     $("<p>")
-      .attr("class", "deemphasize")
+      .attr("class", "text-muted")
       .html(I18n.t("javascripts.share.image_size") + " <span id=\"mapnik_image_width\"></span> x <span id=\"mapnik_image_height\"></span>")
       .appendTo($form);
 
index 3055d87aff0d71e67b9538b5dc61835abb5262f9..e3b79c5913b5e24ccbe6d4f3ad12d1a3c8222706 100644 (file)
@@ -30,11 +30,6 @@ small, aside {
 
 #container { position: relative; }
 
-.column-1 {
-  width: 50%;
-  margin: 0 0 $lineheight/2 0;
-}
-
 .small_icon {
   vertical-align: middle;
   margin-right: $lineheight/4;
@@ -101,6 +96,10 @@ a {
   }
 }
 
+.text-muted a {
+  color: $blue;
+}
+
 /* Rules for the header */
 
 #menu-icon {
@@ -1261,12 +1260,15 @@ tr.turn:hover {
 /* Rules for small maps in content areas */
 
 .content_map {
-  position: relative;
-  width: 45%;
-  height: 400px;
+  height: 200px;
   border: 1px solid $grey;
   margin-bottom: $lineheight;
-  float: right;
+}
+
+@include media-breakpoint-up(md) {
+  .content_map {
+    height: 400px;
+  }
 }
 
 /* Rules for the new trace form */
@@ -1312,16 +1314,6 @@ tr.turn:hover {
   margin-right: $lineheight;
 }
 
-.activity-block {
-  clear: left;
-  border-bottom: 1px solid $grey;
-  padding-bottom: $lineheight;
-  float: left;
-  h3 {
-    margin-bottom: $lineheight/2;
-  }
-}
-
 .contact-activity {
   margin-top: $lineheight;
   width: 100%;
@@ -1400,7 +1392,7 @@ tr.turn:hover {
     margin-top: $lineheight/2;
   }
 
-  &.deemphasize {
+  &.deleted {
     background-color: #fee;
   }
 
@@ -1455,7 +1447,7 @@ tr.turn:hover {
       padding-top: $lineheight;
       border-top: 1px solid $grey;
     }
-    &.deemphasize {
+    &.deleted {
       background-color: #fee;
     }
     p {
@@ -1550,11 +1542,6 @@ tr.turn:hover {
   display: inline !important;
 }
 
-.content_map.settings_map {
-  width: 50%;
-  float: none;
-}
-
 /* Rules for the oauth settings page */
 
 .oauth_clients .buttons .oauth-edit {
index 63edfd459b0109b9b32c98d2e772127937baac10..701d1046580e5d03efae23344e504ba29a5e6bdd 100644 (file)
@@ -9,10 +9,6 @@ body.small {
     -webkit-appearance: none;
   }
 
-  .column-1 {
-    width: 100%;
-  }
-
   #menu-icon {
     display: inline-block !important;
   }
@@ -104,15 +100,6 @@ body.small {
     top: 10px !important;
   }
 
-  .content_map {
-    width: 100%;
-    border: none;
-    float: none;
-    height: 200px;
-    max-height: none;
-    min-height: auto;
-  }
-
   /* Rules for the login form */
 
   #login_login input#user_email {
@@ -141,13 +128,6 @@ body.small {
     height: 300px !important;
   }
 
-  #userinformation .deemphasize {
-    position: relative;
-    right: auto; left: auto;
-    margin-top: 10px;
-    top: auto;
-  }
-
   &.site-about #content .attr h1 {
     font-size: 28px;
   }
index 31601522877dce62e24ee81bbd91a385eededa8a..a5a37b485868f8e986053cd723b17e0b671f5710 100644 (file)
@@ -2,7 +2,6 @@
 
 module Api
   class ChangesetsController < ApiController
-    layout "site"
     require "xml/libxml"
 
     before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe]
index a73240e5fabc4f849780cbcb9e2dd42a26c30352..cd71b437457e302f2e33c13d6faf90f9761c5e6f 100644 (file)
@@ -1,7 +1,5 @@
 module Api
   class NotesController < ApiController
-    layout "site", :only => [:mine]
-
     before_action :check_api_readable
     before_action :setup_user_auth, :only => [:create, :comment, :show]
     before_action :authorize, :only => [:close, :reopen, :destroy, :comment]
index 0b441bef986d9aa5ba4bfd1625001a6144b7115f..6c77f9dc4bae539cb581a60402e372f49dc80d7d 100644 (file)
@@ -1,7 +1,5 @@
 module Api
   class TracesController < ApiController
-    layout "site", :except => :georss
-
     before_action :authorize_web
     before_action :set_locale
     before_action :authorize
index d3387bd5ffaaa1f48a0e32dff1b32d25ae3eb639..d97e8774ecd7a5641f8cc94e301c9fef0ad3386d 100644 (file)
@@ -1,7 +1,5 @@
 module Api
   class UsersController < ApiController
-    layout "site", :except => [:api_details]
-
     before_action :disable_terms_redirect, :only => [:details]
     before_action :authorize, :only => [:details, :gpx_files]
 
index 7c6b033ca5adf6c6a8a10215d9ca94a49b89f80a..9f2fdb7e224c84233580ec6c146ac2bb5af19da9 100644 (file)
@@ -1,5 +1,5 @@
 class NotesController < ApplicationController
-  layout "site", :only => [:mine]
+  layout "site"
 
   before_action :check_api_readable
   before_action :authorize_web
@@ -11,11 +11,11 @@ class NotesController < ApplicationController
 
   ##
   # Display a list of notes by a specified user
-  def mine
+  def index
     if params[:display_name]
       if @user = User.active.find_by(:display_name => params[:display_name])
         @params = params.permit(:display_name)
-        @title = t "notes.mine.title", :user => @user.display_name
+        @title = t ".title", :user => @user.display_name
         @page = (params[:page] || 1).to_i
         @page_size = 10
         @notes = @user.notes
index afe3f83220c56fc49a7d3e93f3a0064703bad6d7..5a50aa91f5a789d4c6581e6ebd4d32381b86d445 100644 (file)
@@ -34,7 +34,7 @@
           <% @comments.each do |comment| %>
             <% if comment.visible %>
               <li id="c<%= comment.id %>">
-                <small class='deemphasize'>
+                <small class='text-muted'>
                   <%= t(".commented_by",
                         :when => friendly_date_ago(comment.created_at),
                         :exact_time => l(comment.created_at),
@@ -47,7 +47,7 @@
               </li>
             <% elsif current_user and current_user.moderator? %>
               <li id="c<%= comment.id %>">
-                <small class='deemphasize'>
+                <small class='text-muted'>
                   <%= t(".hidden_commented_by",
                         :when => friendly_date_ago(comment.created_at),
                         :exact_time => l(comment.created_at),
index ffc198b0a52ebf6c05db80184cb3fba30ac84a82..0b91ca1264b4cc4520c607758703b97a187d35dd 100644 (file)
@@ -24,7 +24,7 @@
   <% end -%>
 
   <% if current_user && current_user != @note.author %>
-    <p class="deemphasize"><%= report_link(t(".report"), @note) %></p>
+    <p class="text-muted"><%= report_link(t(".report"), @note) %></p>
   <% end %>
 
   <% if @note_comments.length > 1 %>
@@ -32,7 +32,7 @@
       <ul class="list-unstyled">
         <% @note_comments[1..-1].each do |comment| %>
           <li id="c<%= comment.id %>">
-            <small class='deemphasize'><%= note_event(comment.event, comment.created_at, comment.author) %></small>
+            <small class='text-muted'><%= note_event(comment.event, comment.created_at, comment.author) %></small>
             <%= comment.body.to_html %>
           </li>
         <% end %>
index db48478263968d0103adc44727c3706bdfabe036..9a3ff969dfecbd64fc0e0c987fd12352f22633f5 100644 (file)
@@ -1,6 +1,6 @@
-<div class="clearfix diary-comment<%= " deemphasize" unless diary_comment.visible? %>">
+<div class="clearfix diary-comment<%= " text-muted deleted" unless diary_comment.visible? %>">
   <%= user_thumbnail diary_comment.user %>
-  <p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= t(".comment_from_html", :link_user => (link_to diary_comment.user.display_name, user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %>
+  <p class="text-muted comment-heading" id="comment<%= diary_comment.id %>"><%= t(".comment_from_html", :link_user => (link_to diary_comment.user.display_name, user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %>
     <% if current_user and diary_comment.user.id != current_user.id %>
       | <%= report_link(t(".report"), diary_comment) %>
     <% end %>
index b0c464718011160ada4c5990be1faf64e3849f2d..48df5d18e06a974c4cfc6d124b353161d4f25799 100644 (file)
@@ -1,4 +1,4 @@
-<div class='diary_post<%= " deemphasize" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
+<div class='diary_post<%= " text-muted px-3 deleted" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
   <div class='post_heading clearfix'>
     <% if !@user %>
       <%= user_thumbnail diary_entry.user %>
@@ -6,7 +6,7 @@
 
     <h2><%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %></h2>
 
-    <small class='deemphasize'>
+    <small class='text-muted'>
       <%= t(".posted_by_html", :link_user => (link_to diary_entry.user.display_name, user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to diary_entry.language.name, :controller => "diary_entries", :action => "index", :display_name => nil, :language => diary_entry.language_code)) %>
     </small>
 
index 5efa6a1bb776b754cb86129622fec24faac88fbf..6472a496720a2f4482e3175916978c23f8123f9c 100644 (file)
@@ -1,7 +1,7 @@
 <% content_for :heading do %>
 <h2><%= t ".title", :status => @issue.status.humanize, :issue_id => @issue.id %></h2>
 <p><%= @issue.reportable.model_name.human %> : <%= link_to reportable_title(@issue.reportable), reportable_url(@issue.reportable) %></p>
-<p class="deemphasize">
+<p class="text-muted">
   <small>
     <%= @issue.assigned_role %>
     | <%= t ".reports", :count => @issue.reports.count %>
similarity index 85%
rename from app/views/notes/mine.html.erb
rename to app/views/notes/index.html.erb
index 2f68ba5c61359cb89591030d033543b821cfefc7..50059625d3b687e5980ac200224b05a7de48888b 100644 (file)
@@ -1,6 +1,6 @@
 <% content_for :heading do %>
-  <h2><%= t "notes.mine.heading", :user => @user.display_name %></h2>
-  <p><%= t "notes.mine.subheading_html", :user => link_to(@user.display_name, user_path(@user)) %></p>
+  <h2><%= t ".heading", :user => @user.display_name %></h2>
+  <p><%= t ".subheading_html", :user => link_to(@user.display_name, user_path(@user)) %></p>
 <% end %>
 
 <%= render :partial => "notes_paging_nav" %>
index 8980cb8f21cf2aae556845a1c26710f251379ad0..ff15836b7b2596f2ea783a907bd31da480d14cbf 100644 (file)
@@ -9,7 +9,7 @@
     <% end %>
   </td>
   <td><%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
-    <span class="deemphasize" title="<%= trace.timestamp %>"> ...
+    <span class="text-muted" title="<%= trace.timestamp %>"> ...
       <% if trace.inserted %>
         (<%= t ".count_points", :count => trace.size %>)
       <% end %>
index d067bd4781b4acc73a53de16a3621c62cf2a3b76..4446c519d4c45012b85d4721b8a5014228092b5f 100644 (file)
@@ -7,7 +7,7 @@
 <%= tag.div :class => "contact-activity clearfix", :data => { :user => user_data } do %>
   <%= user_thumbnail contact %>
   <div class='activity-details'>
-    <p class='deemphasize'>
+    <p class='text-muted'>
       <%= link_to contact.display_name, user_path(contact) %>
       <% if @user.home_lon and @user.home_lat and contact.home_lon and contact.home_lat %>
         <% distance = @user.distance(contact) %>
@@ -31,7 +31,7 @@
       <% end %>
     </p>
 
-    <ul class='secondary-actions clearfix deemphasize'>
+    <ul class='secondary-actions clearfix text-muted'>
       <li><%= link_to t("users.show.send message"), new_message_path(contact) %></li>
       <li>
         <% if current_user.is_friends_with?(contact) %>
index 0f2f3741fafafe874b136506fc669985c1c76e55..ad6614c76ca51a5f02a1c85330310f70d8b419b1 100644 (file)
       <input type="checkbox" name="updatehome" value="1" <% unless current_user.home_lat and current_user.home_lon %> checked="checked" <% end %> id="updatehome" />
       <label class="standard-label" for="updatehome"><%= t ".update home location on click" %></label>
     </div>
-    <%= tag.div "", :id => "map", :class => "content_map settings_map set_location" %>
+    <%= tag.div "", :id => "map", :class => "content_map set_location" %>
   </fieldset>
 
   <%= submit_tag t(".save changes button") %>
index 3a2e125789a66e818a843ea58d0ba3dff0eaec07..a3902c0a920a0b07ae746b7da70c0c305501228f 100644 (file)
 <% else %>
   <h1>
     <%= t ".introduction_1" %>
-    <span class="deemphasize">
+    <span class="text-muted">
       <%= t ".introduction_2" %>
     </span>
   </h1>
 
-  <p class='deemphasize'><%= t ".reconfirm_html",
-                               :reconfirm => url_for(:action => "confirm_resend") %></p>
+  <p class='text-muted'><%= t ".reconfirm_html",
+                              :reconfirm => url_for(:action => "confirm_resend") %></p>
 <% end %>
index ac61d7df7bbb02c9b79f80d1b0a41bb7f7672768..365245bf04a929b34bac7dcdd431d5dbdb406c39 100644 (file)
@@ -10,7 +10,7 @@
   <%= form_tag({ :action => "login" }, { :id => "login_form" }) do %>
     <%= hidden_field_tag("referer", h(params[:referer])) %>
 
-    <p class='deemphasize'><%= t ".no account" %> <%= link_to t(".register now"), :action => :new, :referer => params[:referer] %></p>
+    <p class='text-muted'><%= t ".no account" %> <%= link_to t(".register now"), :action => :new, :referer => params[:referer] %></p>
 
     <div id="loginForm" class="standard-form">
 
index 1332ab6e204f034edc9d7ffa7003f6d5f18947c2..440d68874ff9e323b38e63f3f8a9f86086f2d5b7 100644 (file)
@@ -11,7 +11,7 @@
             <span class='count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
           </li>
           <li>
-            <%= link_to t(".my notes"), :controller => "notes", :action => "mine" %>
+            <%= link_to t(".my notes"), user_notes_path(@user) %>
           </li>
           <li>
             <%= link_to t(".my traces"), :controller => "traces", :action => "mine" %>
@@ -53,7 +53,7 @@
             <span class='count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
           </li>
           <li>
-            <%= link_to t(".notes"), :controller => "notes", :action => "mine" %>
+            <%= link_to t(".notes"), user_notes_path(@user) %>
           </li>
           <li>
             <%= link_to t(".traces"), :controller => "traces", :action => "index", :display_name => @user.display_name %>
 
         <% end %>
 
-      <p class='deemphasize'>
+      <p class='text-muted'>
         <small>
           <%= t ".mapper since" %> <%= l @user.creation_time.to_date, :format => :long %>
           <% unless @user.terms_agreed %>
   </div>
 
   <% if current_user and current_user.administrator? -%>
-    <div class='admin-user-info deemphasize'>
+    <div class='admin-user-info text-muted'>
       <small><b><%= t ".email address" %></b> <%= @user.email %></small>
       <% unless @user.creation_ip.nil? -%>
         <small><b><%= t ".created from" %></b> <%= @user.creation_ip %></small>
 
 <% end %>
 
+<div class="row">
   <% if current_user and @user.id == current_user.id %>
-    <% if @user.home_lat.nil? or @user.home_lon.nil? %>
-      <div id="map" class="content_map">
-        <p id="no_home_location"><%= t(".if_set_location_html", :settings_link => (link_to t(".settings_link_text"), :controller => "users", :action => "account", :display_name => current_user.display_name)) %></p>
-      </div>
-    <% else %>
-      <% content_for :head do %>
-        <%= javascript_include_tag "user" %>
+    <div class="col-md order-md-last">
+      <% if @user.home_lat.nil? or @user.home_lon.nil? %>
+        <div id="map" class="content_map">
+          <p id="no_home_location"><%= t(".if_set_location_html", :settings_link => (link_to t(".settings_link_text"), :controller => "users", :action => "account", :display_name => current_user.display_name)) %></p>
+        </div>
+      <% else %>
+        <% content_for :head do %>
+          <%= javascript_include_tag "user" %>
+        <% end %>
+        <% user_data = {
+             :lon => current_user.home_lon,
+             :lat => current_user.home_lat,
+             :icon => image_path("marker-red.png"),
+             :description => render(:partial => "popup", :object => current_user, :locals => { :type => "your location" })
+           } %>
+        <%= tag.div "", :id => "map", :class => "content_map", :data => { :user => user_data } %>
       <% end %>
-      <% user_data = {
-           :lon => current_user.home_lon,
-           :lat => current_user.home_lat,
-           :icon => image_path("marker-red.png"),
-           :description => render(:partial => "popup", :object => current_user, :locals => { :type => "your location" })
-         } %>
-      <%= tag.div "", :id => "map", :class => "content_map", :data => { :user => user_data } %>
-    <% end %>
-
-    <% friends = @user.friends %>
-    <% nearby = @user.nearby - friends %>
-
-  <div class="activity-block column-1">
-    <h3><%= t ".my friends" %></h3>
-
-    <% if friends.empty? %>
-      <%= t ".no friends" %>
-    <% else %>
-      <ul class='secondary-actions clearfix'>
-        <li><%= link_to t(".friends_changesets"), friend_changesets_path %></li>
-        <li><%= link_to t(".friends_diaries"), friends_diary_entries_path %></li>
-      </ul>
-      <div id="friends-container">
-        <%= render :partial => "contact", :collection => friends, :locals => { :type => "friend" } %>
-      </div>
-    <% end %>
-  </div>
 
-  <div class="activity-block column-1">
-    <h3><%= t ".nearby users" %></h3>
-
-    <% if nearby.empty? %>
-      <%= t ".no nearby users" %>
-    <% else %>
-      <ul class='secondary-actions clearfix'>
-        <li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li>
-        <li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li>
-      </ul>
-      <div id="nearbyusers">
-        <%= render :partial => "contact", :collection => nearby, :locals => { :type => "nearby mapper" } %>
-      </div>
-    <% end %>
-  </div>
-<% end %>
+      <% friends = @user.friends %>
+      <% nearby = @user.nearby - friends %>
+    </div>
+
+    <div class="col-md">
+      <h3><%= t ".my friends" %></h3>
+
+      <% if friends.empty? %>
+        <%= t ".no friends" %>
+      <% else %>
+        <ul class='secondary-actions clearfix'>
+          <li><%= link_to t(".friends_changesets"), friend_changesets_path %></li>
+          <li><%= link_to t(".friends_diaries"), friends_diary_entries_path %></li>
+        </ul>
+        <div id="friends-container">
+          <%= render :partial => "contact", :collection => friends, :locals => { :type => "friend" } %>
+        </div>
+      <% end %>
+
+      <hr>
+
+      <h3><%= t ".nearby users" %></h3>
+
+      <% if nearby.empty? %>
+        <%= t ".no nearby users" %>
+      <% else %>
+        <ul class='secondary-actions clearfix'>
+          <li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li>
+          <li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li>
+        </ul>
+        <div id="nearbyusers">
+          <%= render :partial => "contact", :collection => nearby, :locals => { :type => "nearby mapper" } %>
+        </div>
+      <% end %>
+    </div>
+  <% end %>
+</div>
index 33ca3a3e63e030531c0304cf934d74d8cd7e29ca..bc8b86ef2256a269e25b0a6f8401fb419d3ea166 100644 (file)
@@ -9,12 +9,12 @@
 
 <%= form_tag({ :action => "save" }, { :class => "standard-form fillL" }) do %>
   <!-- legale is <%= @legale %> -->
-  <p class="deemphasize"><%= t ".read and accept with tou" %></p>
+  <p class="text-muted"><%= t ".read and accept with tou" %></p>
   <h4>
     <%= t ".heading_ct" %>
   </h4>
   <div class='standard-form-row horizontal-list clearfix'>
-    <p class="deemphasize"><%= t ".contributor_terms_explain" %></p>
+    <p class="text-muted"><%= t ".contributor_terms_explain" %></p>
     <label class="standard-label">
       <%= t ".legale_select" %>
     </label>
@@ -34,7 +34,7 @@
   </div>
 
   <div>
-    <p id="contributorGuidance" class="deemphasize">
+    <p id="contributorGuidance" class="text-muted">
       <%= t ".guidance_html",
             :summary => "https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary",
             :translations => "https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations" %>
@@ -50,7 +50,7 @@
   <h4>
     <%= t "layouts.tou" %>
   </h4>
-  <p class="deemphasize"><%= t ".tou_explain_html", :tou_link => link_to(t("layouts.tou"), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %></p>
+  <p class="text-muted"><%= t ".tou_explain_html", :tou_link => link_to(t("layouts.tou"), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %></p>
   <div class="standard-form-row">
     <label for="read_tou">
       <%= check_box_tag "read_tou" %>
index 78e9fee371f74ec480073aeed2bc146a7f134965..daf66bfc75eba53a48db397dbd656c9084256bcd 100644 (file)
@@ -7,7 +7,7 @@ csp_policy = {
   :form_action => %w['self'],
   :frame_ancestors => %w['self'],
   :frame_src => %w['self'],
-  :img_src => %w['self' data: www.gravatar.com *.wp.com tile.openstreetmap.org *.tile.openstreetmap.org *.tile.thunderforest.com *.openstreetmap.fr],
+  :img_src => %w['self' data: www.gravatar.com *.wp.com tile.openstreetmap.org *.tile.openstreetmap.org *.tile.thunderforest.com tileserver.memomaps.de *.openstreetmap.fr],
   :manifest_src => %w['self'],
   :media_src => %w['none'],
   :object_src => %w['self'],
index 2f2145b244653259fb9b3ef8c953465576747da4..9142c2eda3dcce0a8f66bd7d517c2b0230d1d0c3 100644 (file)
@@ -2448,7 +2448,7 @@ en:
       next: "Next »"
       previous: "« Previous"
   notes:
-    mine:
+    index:
       title: "Notes submitted or commented on by %{user}"
       heading: "%{user}'s notes"
       subheading_html: "Notes submitted or commented on by %{user}"
@@ -2502,6 +2502,7 @@ en:
         cycle_map: Cycle Map
         transport_map: Transport Map
         hot: Humanitarian
+        opnvkarte: ÖPNVKarte
       layers:
         header: Map Layers
         notes: Map Notes
@@ -2513,6 +2514,7 @@ en:
       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>"
       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>"
     site:
       edit_tooltip: Edit the map
index a98a114302d0576d33fecc637056107d647af49b..41dc7cfc536cddf041d114a0babb448d2732ad2b 100644 (file)
@@ -117,7 +117,7 @@ OpenStreetMap::Application.routes.draw do
   get "/note/new" => "browse#new_note"
   get "/user/:display_name/history" => "changesets#index"
   get "/user/:display_name/history/feed" => "changesets#feed", :defaults => { :format => :atom }
-  get "/user/:display_name/notes" => "notes#mine", :as => :my_notes
+  get "/user/:display_name/notes" => "notes#index", :as => :user_notes
   get "/history/friends" => "changesets#index", :friends => true, :as => "friend_changesets", :defaults => { :format => :html }
   get "/history/nearby" => "changesets#index", :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html }
 
index 99154b4b72cfaeb79ef35019ed4bdb0293f6c174..c27f758333d7d5818f2e6d1b52011369472707fb 100644 (file)
@@ -29,7 +29,7 @@ class GuestAbilityTest < AbilityTest
   test "note permissions for a guest" do
     ability = Ability.new nil
 
-    [:mine].each do |action|
+    [:index].each do |action|
       assert ability.can?(action, Note), "should be able to #{action} Notes"
     end
   end
index 6eda7d3a310cfbcf1197a0696eb4e335dcf67743..1450aced88275bec8b6e02c90199d81ba7469a43 100644 (file)
@@ -13,11 +13,11 @@ class NotesControllerTest < ActionDispatch::IntegrationTest
   def test_routes
     assert_routing(
       { :path => "/user/username/notes", :method => :get },
-      { :controller => "notes", :action => "mine", :display_name => "username" }
+      { :controller => "notes", :action => "index", :display_name => "username" }
     )
   end
 
-  def test_mine_success
+  def test_index_success
     first_user = create(:user)
     second_user = create(:user)
     moderator_user = create(:moderator_user)
@@ -33,43 +33,43 @@ class NotesControllerTest < ActionDispatch::IntegrationTest
     end
 
     # Note that the table rows include a header row
-    get my_notes_path(:display_name => first_user.display_name)
+    get user_notes_path(:display_name => first_user.display_name)
     assert_response :success
     assert_select "table.note_list tr", :count => 2
 
-    get my_notes_path(:display_name => second_user.display_name)
+    get user_notes_path(:display_name => second_user.display_name)
     assert_response :success
     assert_select "table.note_list tr", :count => 2
 
-    get my_notes_path(:display_name => "non-existent")
+    get user_notes_path(:display_name => "non-existent")
     assert_response :not_found
 
     session_for(moderator_user)
 
-    get my_notes_path(:display_name => first_user.display_name)
+    get user_notes_path(:display_name => first_user.display_name)
     assert_response :success
     assert_select "table.note_list tr", :count => 2
 
-    get my_notes_path(:display_name => second_user.display_name)
+    get user_notes_path(:display_name => second_user.display_name)
     assert_response :success
     assert_select "table.note_list tr", :count => 3
 
-    get my_notes_path(:display_name => "non-existent")
+    get user_notes_path(:display_name => "non-existent")
     assert_response :not_found
   end
 
-  def test_mine_paged
+  def test_index_paged
     user = create(:user)
 
     create_list(:note, 50) do |note|
       create(:note_comment, :note => note, :author => user)
     end
 
-    get my_notes_path(:display_name => user.display_name)
+    get user_notes_path(:display_name => user.display_name)
     assert_response :success
     assert_select "table.note_list tr", :count => 11
 
-    get my_notes_path(:display_name => user.display_name, :page => 2)
+    get user_notes_path(:display_name => user.display_name, :page => 2)
     assert_response :success
     assert_select "table.note_list tr", :count => 11
   end
index 0bde8f8a1b889fa2c1d24b1d45019daa45d74030..ad712e3a2f78bb07b13da28ff7f639541683333a 100644 (file)
@@ -35,6 +35,14 @@ L.OSM.TransportMap = L.OSM.TileLayer.extend({
   }
 });
 
+L.OSM.OPNVKarte = L.OSM.TileLayer.extend({
+  options: {
+    url: 'https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png',
+    maxZoom: 18,
+    attribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors. Tiles courtesy of <a href="http://memomaps.de/" target="_blank">MeMoMaps</a>'
+  }
+});
+
 L.OSM.HOT = L.OSM.TileLayer.extend({
   options: {
     url: 'https://tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png',