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
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);
}
$("<p>")
.text(I18n.t("javascripts.map.layers.overlays"))
- .attr("class", "deemphasize")
+ .attr("class", "text-muted")
.appendTo(overlaySection);
var overlays = $("<ul class='list-unstyled'>")
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 = [];
}));
}
+ 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",
.on("click", select))
.append(
$("<p>")
- .attr("class", "deemphasize")
+ .attr("class", "text-muted")
.text(I18n.t("javascripts.share.paste_html"))
.appendTo($linkSection));
$("<div>")
.attr("id", "export-warning")
- .attr("class", "deemphasize")
+ .attr("class", "text-muted")
.text(I18n.t("javascripts.share.only_standard_layer"))
.appendTo($imageSection);
.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);
#container { position: relative; }
-.column-1 {
- width: 50%;
- margin: 0 0 $lineheight/2 0;
-}
-
.small_icon {
vertical-align: middle;
margin-right: $lineheight/4;
}
}
+.text-muted a {
+ color: $blue;
+}
+
/* Rules for the header */
#menu-icon {
/* 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 */
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%;
margin-top: $lineheight/2;
}
- &.deemphasize {
+ &.deleted {
background-color: #fee;
}
padding-top: $lineheight;
border-top: 1px solid $grey;
}
- &.deemphasize {
+ &.deleted {
background-color: #fee;
}
p {
display: inline !important;
}
-.content_map.settings_map {
- width: 50%;
- float: none;
-}
-
/* Rules for the oauth settings page */
.oauth_clients .buttons .oauth-edit {
-webkit-appearance: none;
}
- .column-1 {
- width: 100%;
- }
-
#menu-icon {
display: inline-block !important;
}
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 {
height: 300px !important;
}
- #userinformation .deemphasize {
- position: relative;
- right: auto; left: auto;
- margin-top: 10px;
- top: auto;
- }
-
&.site-about #content .attr h1 {
font-size: 28px;
}
module Api
class ChangesetsController < ApiController
- layout "site"
require "xml/libxml"
before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe]
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]
module Api
class TracesController < ApiController
- layout "site", :except => :georss
-
before_action :authorize_web
before_action :set_locale
before_action :authorize
module Api
class UsersController < ApiController
- layout "site", :except => [:api_details]
-
before_action :disable_terms_redirect, :only => [:details]
before_action :authorize, :only => [:details, :gpx_files]
class NotesController < ApplicationController
- layout "site", :only => [:mine]
+ layout "site"
before_action :check_api_readable
before_action :authorize_web
##
# 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
<% @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),
</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),
<% 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 %>
<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 %>
-<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 %>
-<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 %>
<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>
<% 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 %>
<% 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" %>
<% 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 %>
<%= 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) %>
<% 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) %>
<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") %>
<% 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 %>
<%= 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">
<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" %>
<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>
<%= 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>
</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" %>
<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" %>
: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'],
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}"
cycle_map: Cycle Map
transport_map: Transport Map
hot: Humanitarian
+ opnvkarte: ÖPNVKarte
layers:
header: Map Layers
notes: Map Notes
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
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 }
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
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)
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
}
});
+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',