From: Tom Hughes Date: Thu, 17 Nov 2022 17:49:17 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/3803' X-Git-Tag: live~1591 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/c0278a01da05d8af7c4aec9eeab37a47f1d3110f?hp=1559d880485d7d6e9ccc73095be160384d88a828 Merge remote-tracking branch 'upstream/pull/3803' --- diff --git a/CONFIGURE.md b/CONFIGURE.md index fdaea0e83..3c46e6130 100644 --- a/CONFIGURE.md +++ b/CONFIGURE.md @@ -4,7 +4,7 @@ After [installing](INSTALL.md) this software, you may need to carry out some of ## Application configuration -Many settings are available in `config/settings.yml`. You can customize your installation of The Rails Port by overriding these values using `config/settings.local.yml` +Many settings are available in `config/settings.yml`. You can customize your installation of `openstreetmap-website` by overriding these values using `config/settings.local.yml` ## Populating the database @@ -122,9 +122,9 @@ If you have more problems, please ask on the [rails-dev@openstreetmap.org mailin If your installation stops working for some reason: -* Sometimes gem dependencies change. To update go to your rails_port directory and run ''bundle install'' as root. +* Sometimes gem dependencies change. To update go to your `openstreetmap-website` directory and run ''bundle install'' as root. -* The OSM database schema is changed periodically and you need to keep up with these improvements. Go to your rails_port directory and run: +* The OSM database schema is changed periodically and you need to keep up with these improvements. Go to your `openstreetmap-website` directory and run: ``` bundle exec rake db:migrate @@ -132,7 +132,7 @@ bundle exec rake db:migrate ## Testing on the osm dev server -For example, after developing a patch for the rails_port, you might want to demonstrate it to others or ask for comments and testing. To do this one can [set up an instance of the rails_port on the dev server in ones user directory](https://wiki.openstreetmap.org/wiki/Using_the_dev_server#Rails_Applications). +For example, after developing a patch for `openstreetmap-website`, you might want to demonstrate it to others or ask for comments and testing. To do this you can [set up an instance of openstreetmap-website on the dev server in your user directory](https://wiki.openstreetmap.org/wiki/Using_the_dev_server#Rails_Applications). # Contributing @@ -140,7 +140,7 @@ For information on contributing changes to the codes, see [CONTRIBUTING.md](CONT # Production Deployment -If you want to deploy The Rails Port for production use, you'll need to make a few changes. +If you want to deploy `openstreetmap-website` for production use, you'll need to make a few changes. * It's not recommended to use `rails server` in production. Our recommended approach is to use [Phusion Passenger](https://www.phusionpassenger.com/). Instructions are available for [setting it up with most web servers](https://www.phusionpassenger.com/documentation_and_support#documentation). * Passenger will, by design, use the Production environment and therefore the production database - make sure it contains the appropriate data and user accounts. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ee4e0173..9e878a30c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ bundle exec erblint . ## Testing Having a good suite of tests is very important to the stability and -maintainability of any code base. The tests in the Rails port code are +maintainability of any code base. The tests in the `openstreetmap-website` code are by no means complete, but they are extensive, and must continue to be so with any new functionality which is written. Tests are also useful in giving others confidence in the code you've written, and can diff --git a/DOCKER.md b/DOCKER.md index 870e3e26e..d0b16db07 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -1,6 +1,6 @@ # Using Docker and Docker Compose for Development and Testing -These instructions are designed for setting up The Rails Port for development and testing using [Docker](https://www.docker.com/). This will allow you to install the OpenStreetMap application and all its dependencies in Docker images and then run them in containers, almost with a single command. You will need to install Docker and Docker Compose on your development machine: +These instructions are designed for setting up `openstreetmap-website` for development and testing using [Docker](https://www.docker.com/). This will allow you to install the OpenStreetMap application and all its dependencies in Docker images and then run them in containers, almost with a single command. You will need to install Docker and Docker Compose on your development machine: - [Install Docker](https://docs.docker.com/install/) - [Install Docker Compose](https://docs.docker.com/compose/install/) diff --git a/Gemfile b/Gemfile index 020cc9166..81ba4a9a3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" # Require rails -gem "rails", "7.0.4" +gem "rails", "~> 7.0.0" # Require json for multi_json gem "json" diff --git a/Gemfile.lock b/Gemfile.lock index 68a973c47..586f2000d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -573,7 +573,7 @@ DEPENDENCIES r2 (~> 0.2.7) rack-cors rack-uri_sanitizer - rails (= 7.0.4) + rails (~> 7.0.0) rails-controller-testing rails-i18n (~> 7.0.0) rinku (>= 2.0.6) diff --git a/INSTALL.md b/INSTALL.md index f3b4b8550..b14a2d32b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,6 +1,6 @@ # Installation -These instructions are designed for setting up The Rails Port for development and testing. +These instructions are designed for setting up `openstreetmap-website` for development and testing. If you want to deploy the software for your own project, then see the notes at the end. You can install the software directly on your machine, which is the traditional and probably best-supported approach. However, there @@ -150,7 +150,7 @@ touch config/settings.local.yml ## Storage setup -The Rails port needs to be configured with an object storage facility - for +`openstreetmap-website` needs to be configured with an object storage facility - for development and testing purposes you can use the example configuration: ``` @@ -159,7 +159,7 @@ cp config/example.storage.yml config/storage.yml ## Database setup -The Rails Port uses three databases - one for development, one for testing, and one for production. The database-specific configuration +`openstreetmap-website` uses three databases - one for development, one for testing, and one for production. The database-specific configuration options are stored in `config/database.yml`, which we need to create from the example template. ``` diff --git a/README.md b/README.md index 8eb26bf27..3e4792b5e 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,21 @@ -# "The Rails Port" +# openstreetmap-website [![Lint](https://github.com/openstreetmap/openstreetmap-website/workflows/Lint/badge.svg?branch=master&event=push)](https://github.com/openstreetmap/openstreetmap-website/actions?query=workflow%3ALint%20branch%3Amaster%20event%3Apush) [![Tests](https://github.com/openstreetmap/openstreetmap-website/workflows/Tests/badge.svg?branch=master&event=push)](https://github.com/openstreetmap/openstreetmap-website/actions?query=workflow%3ATests%20branch%3Amaster%20event%3Apush) [![Coverage Status](https://coveralls.io/repos/openstreetmap/openstreetmap-website/badge.svg?branch=master)](https://coveralls.io/r/openstreetmap/openstreetmap-website?branch=master) -This is The Rails Port, the [Ruby on Rails](http://rubyonrails.org/) +This is `openstreetmap-website`, the [Ruby on Rails](http://rubyonrails.org/) application that powers the [OpenStreetMap](https://www.openstreetmap.org) website and API. -The software is also known as "openstreetmap-website". This repository consists of: * The web site, including user accounts, diary entries, user-to-user messaging. -* The XML-based editing [API](https://wiki.openstreetmap.org/wiki/API_v0.6). -* The integrated version of the [iD](https://wiki.openstreetmap.org/wiki/ID) editors. +* The XML- and JSON-based editing [API](https://wiki.openstreetmap.org/wiki/API_v0.6). +* The integrated version of the [iD](https://wiki.openstreetmap.org/wiki/ID) editor. * The Browse pages - a web front-end to the OpenStreetMap data. * The GPX uploads, browsing and API. -A fully-functional Rails Port installation depends on other services, including map tile +A fully-functional `openstreetmap-website` installation depends on other services, including map tile servers and geocoding services, that are provided by other software. The default installation uses publicly-available services to help with development and testing. @@ -27,7 +26,7 @@ a copy of which can be found in the [LICENSE](LICENSE) file. # Installation -The Rails Port is a Ruby on Rails application that uses PostgreSQL as its database, and has a large +`openstreetmap-website` is a Ruby on Rails application that uses PostgreSQL as its database, and has a large number of dependencies for installation. For full details please see [INSTALL.md](INSTALL.md). # Development diff --git a/app/assets/images/searching.gif b/app/assets/images/searching.gif deleted file mode 100644 index b1451fd7d..000000000 Binary files a/app/assets/images/searching.gif and /dev/null differ diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index 02b48f6a0..e8d912685 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -20,7 +20,7 @@ OSM.History = function (map) { unHighlightChangeset(e.layer.id); }) .on("click", function (e) { - clickChangeset(e.layer.id, e); + clickChangeset(e.layer.id, e.originalEvent); }); group.getLayerId = function (layer) { diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index 352f5d48c..89f14caee 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -35,8 +35,6 @@ OSM = { OPEN_NOTE_MARKER: <%= image_path("open_note_marker.png").to_json %>, CLOSED_NOTE_MARKER: <%= image_path("closed_note_marker.png").to_json %>, - SEARCHING: <%= image_path("searching.gif").to_json %>, - apiUrl: function (object) { var apiType = object.type === "note" ? "notes" : object.type; var url = "/api/" + OSM.API_VERSION + "/" + apiType + "/" + object.id; diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 8e4410fce..14da8f300 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -123,7 +123,7 @@ $(document).ready(function () { $("input[name=legale]").change(function () { var url = $(this).data("url"); - $("#contributorTerms").html(""); + $("#contributorTerms").html("
" + I18n.t("browse.start_rjs.loading") + "
"); $("#contributorTerms").load(url); }); diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 27458c6ef..5a197d9b1 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -681,21 +681,6 @@ body.small-nav { } } -#sidebar { - #sidebar_loader, - .search_more { - width: 100%; - margin: $lineheight auto; - } - - .loader { - text-align: center; - margin: auto; - width: 40px; - display: block; - } -} - /* Temporary label size override until we remove site-wide font customisation */ form { @@ -753,7 +738,6 @@ header .search_forms, .search_more .loader { display: none; - width: 100%; } } @@ -1336,14 +1320,6 @@ tr.turn:hover { .directions_form { background-color: $lightgrey; - - .loader_copy { - display: none; - - img { - vertical-align: middle; - } - } } /* Rules for user images */ diff --git a/app/views/browse/query.html.erb b/app/views/browse/query.html.erb index 53eca9747..25b0cac14 100644 --- a/app/views/browse/query.html.erb +++ b/app/views/browse/query.html.erb @@ -8,7 +8,11 @@

<%= t(".nearby") %>

- <%= image_tag "searching.gif", :class => "loader" %> +
+
+ <%= t("browse.start_rjs.loading") %> +
+
    @@ -16,7 +20,11 @@

    <%= t(".enclosing") %>

    - <%= image_tag "searching.gif", :class => "loader" %> +
    +
    + <%= t("browse.start_rjs.loading") %> +
    +
      diff --git a/app/views/changesets/history.html.erb b/app/views/changesets/history.html.erb index 339d60e98..a9970e652 100644 --- a/app/views/changesets/history.html.erb +++ b/app/views/changesets/history.html.erb @@ -14,5 +14,9 @@ <%= render "sidebar_header", :title => @heading %>
      - <%= image_tag "searching.gif", :class => "loader" %> +
      +
      + <%= t("browse.start_rjs.loading") %> +
      +
      diff --git a/app/views/changesets/index.html.erb b/app/views/changesets/index.html.erb index 3ead2abda..43f194522 100644 --- a/app/views/changesets/index.html.erb +++ b/app/views/changesets/index.html.erb @@ -5,7 +5,11 @@ <% if @changesets.size == 20 -%>
      <%= link_to t(".load_more"), url_for(@params.merge(:max_id => @changesets.last.id - 1)), :class => "btn btn-primary" %> -
      <%= image_tag "searching.gif" %>
      +
      +
      + <%= t("browse.start_rjs.loading") %> +
      +
      <% end -%> <% elsif params[:bbox] %> diff --git a/app/views/geocoder/results.html.erb b/app/views/geocoder/results.html.erb index e05aa29ad..fc2138318 100644 --- a/app/views/geocoder/results.html.erb +++ b/app/views/geocoder/results.html.erb @@ -11,9 +11,13 @@ <% end %> <% if @more_params %> -
      +
      <%= link_to t(".more_results"), url_for(@more_params), :class => "btn btn-primary" %> -
      <%= image_tag "searching.gif" %>
      +
      +
      + <%= t("browse.start_rjs.loading") %> +
      +
      <% end %> <% end %> diff --git a/app/views/geocoder/search.html.erb b/app/views/geocoder/search.html.erb index 8502227de..ceb099421 100644 --- a/app/views/geocoder/search.html.erb +++ b/app/views/geocoder/search.html.erb @@ -5,6 +5,10 @@ <% @sources.each do |source| %>

      <%= t(".title.#{source}_html") %>

      "> - <%= image_tag "searching.gif", :class => "loader" %> +
      +
      + <%= t("browse.start_rjs.loading") %> +
      +
      <% end %> diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index e7cae0471..31386b1ab 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -51,6 +51,12 @@
      -
      <%= image_tag "searching.gif" %>
      +
      +
      +
      + <%= t("browse.start_rjs.loading") %> +
      +
      +
      diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb index 816f90c70..b3c85d918 100644 --- a/app/views/layouts/map.html.erb +++ b/app/views/layouts/map.html.erb @@ -30,8 +30,10 @@
      -