From: Tom Hughes Date: Thu, 9 Jan 2020 11:03:34 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/2500' X-Git-Tag: live~2805 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/bd7c279604469e0ef22ed8148603befa469d9c2b?hp=bff3676d9346323cee491243315404fd09879272 Merge remote-tracking branch 'upstream/pull/2500' --- diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 5c6e58170..514d6dbb2 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -214,17 +214,15 @@ OSM.Query = function (map) { if (interestingFeature(element)) { var $li = $("
  • ") - .addClass("query-result") + .addClass("query-result list-group-item") .data("geometry", featureGeometry(element)) - .appendTo($ul); - var $p = $("

    ") .text(featurePrefix(element) + " ") - .appendTo($li); + .appendTo($ul); $("") .attr("href", "/" + element.type + "/" + element.id) .text(featureName(element)) - .appendTo($p); + .appendTo($li); } } diff --git a/app/assets/stylesheets/_bootstrap-custom.scss b/app/assets/stylesheets/_bootstrap-custom.scss index 96d37415f..e502f7db6 100644 --- a/app/assets/stylesheets/_bootstrap-custom.scss +++ b/app/assets/stylesheets/_bootstrap-custom.scss @@ -13,7 +13,7 @@ @import "bootstrap/type"; // @import "bootstrap/images"; // @import "bootstrap/code"; -// @import "bootstrap/grid"; +@import "bootstrap/grid"; // @import "bootstrap/tables"; // @import "bootstrap/forms"; // @import "bootstrap/buttons"; @@ -32,7 +32,7 @@ @import "bootstrap/alert"; // @import "bootstrap/progress"; // @import "bootstrap/media"; -// @import "bootstrap/list-group"; +@import "bootstrap/list-group"; // @import "bootstrap/close"; // @import "bootstrap/toasts"; // @import "bootstrap/modal"; diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 3d013339d..d7984436a 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -58,36 +58,6 @@ strong { clear: both; } -/* Basic grid */ - -.col0 { float:left; width:04.1666%; } -.col1 { float:left; width:08.3333%; } -.col2 { float:left; width:16.6666%; } -.col3 { float:left; width:25.0000%; } -.col4 { float:left; width:33.3333%; } -.col5 { float:left; width:41.6666%; } -.col6 { float:left; width:50.0000%; } -.col7 { float:left; width:58.3333%; } -.col8 { float:left; width:66.6666%; } -.col9 { float:left; width:75.0000%; } -.col10 { float:left; width:83.3333%; } -.col11 { float:left; width:91.6666%; } -.col12 { width:100%; } - -.margin0 { margin-left:04.1666%; } -.margin1 { margin-left:08.3333%; } -.margin2 { margin-left:16.6666%; } -.margin3 { margin-left:25.0000%; } -.margin4 { margin-left:33.3333%; } -.margin5 { margin-left:41.6666%; } -.margin6 { margin-left:50.0000%; } -.margin7 { margin-left:58.3333%; } -.margin8 { margin-left:66.6666%; } -.margin9 { margin-left:75.0000%; } -.margin10 { margin-left:83.3333%; } -.margin11 { margin-left:91.6666%; } -.margin12 { margin-left:100.0000%; } - .fillL { background-color: white; } /* Default rules for the body of every page */ @@ -1108,21 +1078,12 @@ tr.turn:hover { #sidebar .changesets { li { - padding: 15px 20px; - border-bottom: 1px solid $grey; cursor: pointer; &.selected { background: $list-highlight; } /* color is derived from changeset bbox fillColor in history.js */ } - h4 { - margin: 0; - a { - color: #000; - } - } - .comments { float: right; color: $darkgrey; @@ -1191,7 +1152,6 @@ tr.turn:hover { background-color: #F6F6F6; border: 1px solid $grey; border-radius: 3px; - font-size: 12px; table-layout: fixed; border-collapse: separate; @@ -1223,8 +1183,8 @@ tr.turn:hover { .colour-preview-box { float: right; - width: 12px; - height: 12px; + width: 14px; + height: 14px; margin: 4px 0px; border: 1px solid rgba(0, 0, 0, .1); // add color via inline css on element: background-color: ; @@ -1277,17 +1237,14 @@ tr.turn:hover { .query-results { display: none; + padding-bottom: $lineheight/2; h3 { - padding: $lineheight $lineheight $lineheight/2; - margin: 0; + padding: 0 $lineheight; } ul { li { - padding: 15px 20px; - border-bottom: 1px solid $grey; - &.query-result { cursor: pointer; } @@ -1404,19 +1361,6 @@ tr.turn:hover { /* Overrides for pages that use new layout conventions */ -.users-new, -.users-create, -.users-terms { - .content-body .content-inner { - padding: 0; - - .message { - margin-top: 80px; - padding: 20px; - } - } -} - .users-new, .users-create, .users-terms, @@ -2094,13 +2038,6 @@ abbr.geo { border-bottom: none; } -/* Rules for RSS buttons */ - -.rsssmall { - position: relative; - top: 3px; -} - /* General styles for action lists / subnavs / pager navs */ ul.secondary-actions { @@ -2627,11 +2564,6 @@ input.richtext_title[type="text"] { text-decoration: none; } - .note-box { - margin-top: 20px; - background-color: $offwhite; - } - .icon.note { background-color: #333; border-radius: 4px; @@ -2645,53 +2577,12 @@ input.richtext_title[type="text"] { background-size: cover; background-attachment: fixed; - .caption { - max-width: 200px; - font: 13px/20px Helvetica, Arial, sans-serif; - position: fixed; - text-align: right; - right: 20px; - bottom: 60px; - text-shadow: #000 0px 1px 5px; - color: $lightgrey; - opacity: 0.8; - display: none; - } - - .caption a { - color: white; - white-space: nowrap; - text-decoration: none; - } - - a.next { - display: block; - position: fixed; - right: 10px; - bottom: 10px; - width: 40px; - height: 40px; - border-radius: 5px; - text-indent: -9999px; - overflow: hidden; - background: image-url('about/sprite.png') -120px 0px no-repeat; - background-color: #000; - background-color: rgba(0, 0, 0, 0.5); - } .content-inner { position: relative; color: #333; min-width: 320px; max-width: 640px; - - .section { - margin-bottom: 30px; - } - - .section:last-child { - margin-bottom: 0; - } } .text { @@ -2751,10 +2642,6 @@ input.richtext_title[type="text"] { } } - h2 { - margin-bottom: 10px; - } - .icon { width: 30px; height: 30px; diff --git a/app/assets/stylesheets/small.scss b/app/assets/stylesheets/small.scss index 12e21c7d8..f6126391a 100644 --- a/app/assets/stylesheets/small.scss +++ b/app/assets/stylesheets/small.scss @@ -182,19 +182,6 @@ body.small { top: auto; } - /* Rules for the sign-up page */ - - &.user-new, - &.user-create { - .col6 { - width: 100%; - } - - .aside { - display: none; - } - } - &.site-about #content .attr h1 { font-size: 28px; } diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a61a10d94..514b3f8ee 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -269,7 +269,7 @@ class UsersController < ApplicationController def logout @title = t "users.logout.title" - if params[:session] == session.id + if request.post? if session[:token] token = UserToken.find_by(:token => session[:token]) token&.destroy diff --git a/app/models/user_block.rb b/app/models/user_block.rb index 60f680ac3..9150bae79 100644 --- a/app/models/user_block.rb +++ b/app/models/user_block.rb @@ -78,7 +78,7 @@ class UserBlock < ApplicationRecord # block. this should be caught and dealt with in the controller, # but i've also included it here just in case. def moderator_permissions - errors.add(:base, I18n.t("user_block.model.non_moderator_update")) if creator_id_changed? && !creator.moderator? - errors.add(:base, I18n.t("user_block.model.non_moderator_revoke")) unless revoker_id.nil? || revoker.moderator? + errors.add(:base, I18n.t("user_blocks.model.non_moderator_update")) if creator_id_changed? && !creator.moderator? + errors.add(:base, I18n.t("user_blocks.model.non_moderator_revoke")) if revoker_id_changed? && !revoker_id.nil? && !revoker.moderator? end end diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 9ad35b2a7..148cb5a88 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -6,7 +6,7 @@

    -

    <%= linkify(h(@changeset.tags["comment"].to_s.presence || t("browse.no_comment"))) %>

    +
    <%= linkify(h(@changeset.tags["comment"].to_s.presence || t("browse.no_comment"))) %>
    <%= changeset_details(@changeset) %>
    <%= render :partial => "tag_details", :object => @changeset.tags.except("comment") %> diff --git a/app/views/browse/query.html.erb b/app/views/browse/query.html.erb index ea40a00db..ad6fdddb5 100644 --- a/app/views/browse/query.html.erb +++ b/app/views/browse/query.html.erb @@ -12,11 +12,15 @@

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

    <%= image_tag "searching.gif", :class => "loader" %> -
      +
      +
        +

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

        <%= image_tag "searching.gif", :class => "loader" %> -
          +
          +
            +
            diff --git a/app/views/changesets/_changeset.html.erb b/app/views/changesets/_changeset.html.erb index 56726e2d9..f1173671e 100644 --- a/app/views/changesets/_changeset.html.erb +++ b/app/views/changesets/_changeset.html.erb @@ -10,12 +10,12 @@ } end %> -<%= content_tag "li", :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data } do %> -

            - +<%= content_tag "li", :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data }, :class => "list-group-item" do %> +
            + <%= changeset.tags["comment"].to_s.presence || t("browse.no_comment") %> -
            +

            <%= changeset.comments.length %> diff --git a/app/views/changesets/index.html.erb b/app/views/changesets/index.html.erb index 1e3daa081..527a0a232 100644 --- a/app/views/changesets/index.html.erb +++ b/app/views/changesets/index.html.erb @@ -1,5 +1,5 @@ <% if @changesets.present? %> -
              +
                <%= render @changesets %>
              <% if @changesets.size == 20 -%> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 6df8f02da..3963c211e 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -102,7 +102,7 @@ <%= yield :greeting %>
            1. - <%= link_to t("layouts.logout"), logout_path(:session => session.id, :referer => request.fullpath), :class => "geolink" %> + <%= link_to t("layouts.logout"), logout_path(:referer => request.fullpath), :method => "post", :class => "geolink" %>
            diff --git a/app/views/site/about.html.erb b/app/views/site/about.html.erb index e62af1659..717059fa2 100644 --- a/app/views/site/about.html.erb +++ b/app/views/site/about.html.erb @@ -28,7 +28,8 @@
            diff --git a/app/views/site/fixthemap.html.erb b/app/views/site/fixthemap.html.erb index 4bb478c7e..3c82e2374 100644 --- a/app/views/site/fixthemap.html.erb +++ b/app/views/site/fixthemap.html.erb @@ -7,31 +7,30 @@ <% end %>

            <%= t "layouts.intro_header" %>

            -

            <%= t "layouts.intro_text" %>

            <%= t ".how_to_help.title" %>

            -
            -
            -

            <%= t ".how_to_help.join_the_community.title" %>

            - <%= t ".how_to_help.join_the_community.explanation_html" %> -
            - +
            +
            +
            +
            <%= t ".how_to_help.join_the_community.title" %>
            +

            <%= t ".how_to_help.join_the_community.explanation_html" %>

            +

            + +

            +
            +
            +
            <%= t "site.welcome.add_a_note.title" %>
            +

            <%= t "site.welcome.add_a_note.paragraph_1_html" %>

            +

            <%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %>

            -
            -
            -

            <%= t "site.welcome.add_a_note.title" %>

            -

            <%= t "site.welcome.add_a_note.paragraph_1_html" %>

            -

            <%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %>

            <%= t ".other_concerns.title" %>

            <%= t ".other_concerns.explanation_html" %>

            -
            -

            <%= t "site.welcome.questions.title" %>

            - -

            <%= t "site.welcome.questions.paragraph_1_html", :help_url => help_path %>

            -
            +

            <%= t "site.welcome.questions.title" %>

            + +

            <%= t "site.welcome.questions.paragraph_1_html", :help_url => help_path %>

            diff --git a/app/views/site/welcome.html.erb b/app/views/site/welcome.html.erb index dc6a519df..4617935e7 100644 --- a/app/views/site/welcome.html.erb +++ b/app/views/site/welcome.html.erb @@ -10,15 +10,15 @@

            <%= t ".whats_on_the_map.title" %>

            -
            -
            -
            +
            +
            +

            <%= t ".whats_on_the_map.on_html" %>

            -
            -
            +
            +

            <%= t ".whats_on_the_map.off_html" %>

            @@ -29,7 +29,7 @@

            <%= t ".basic_terms.paragraph_1_html" %>

            -
            +

            <%= t ".basic_terms.editor_html" %>

            @@ -48,26 +48,24 @@
            -
            +

            <%= t ".rules.title" %>

            <%= t ".rules.paragraph_1_html" %>

            -
            +

            <%= t ".questions.title" %>

            <%= t ".questions.paragraph_1_html", :help_url => help_path %>

            -
            -
            -

            <%= t ".add_a_note.title" %>

            -

            <%= t ".add_a_note.paragraph_1_html" %>

            -

            <%= t ".add_a_note.paragraph_2_html", :map_url => root_path %>

            -
            +
            +

            <%= t ".add_a_note.title" %>

            +

            <%= t ".add_a_note.paragraph_1_html" %>

            +

            <%= t ".add_a_note.paragraph_2_html", :map_url => root_path %>

            diff --git a/app/views/users/logout.html.erb b/app/views/users/logout.html.erb index 273c7e1b9..5d8e2de49 100644 --- a/app/views/users/logout.html.erb +++ b/app/views/users/logout.html.erb @@ -4,6 +4,5 @@ <%= form_tag :action => "logout" do %> <%= hidden_field_tag("referer", h(params[:referer])) %> - <%= hidden_field_tag("session", session.id) %> <%= submit_tag t(".logout_button") %> <% end %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index f4ff16408..5acaa4e95 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -8,75 +8,79 @@
            <% end %> -<%= form_for current_user, :url => { :action => "create" }, :html => { :class => "standard-form fillL col6 inner22" } do |f| %> - <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %> +
            +
            +

            <%= t ".about.header" %>

            + <%= t ".about.html" %> +
            -
            -
            - - <%= f.email_field(:email, :tabindex => 1) %> - <%= f.error_message_on(:email) %> -
            -
            - - <%= f.email_field(:email_confirmation, :tabindex => 2) %> - <%= f.error_message_on(:email_confirmation) %> -
            - <%= t(".not_displayed_publicly_html") %> -
            +
            + <%= form_for current_user, :url => { :action => "create" }, :html => { :class => "standard-form" } do |f| %> + <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %> -
            -
            - - <%= f.text_field(:display_name, :tabindex => 3) %> - <%= f.error_message_on(:display_name) %> -
            - <%= t ".display name description" %> -
            +
            +
            + + <%= f.email_field(:email, :tabindex => 1) %> + <%= f.error_message_on(:email) %> +
            +
            + + <%= f.email_field(:email_confirmation, :tabindex => 2) %> + <%= f.error_message_on(:email_confirmation) %> +
            + <%= t(".not_displayed_publicly_html") %> +
            -
            -
            - - <%= f.select(:auth_provider, Auth::PROVIDERS, :default => "", :tabindex => 4) %> - <%= f.text_field(:auth_uid, :tabindex => 5) %> - <%= f.error_message_on(:auth_uid) %> -
            - <%= t ".auth no password" %> -
            +
            +
            + + <%= f.text_field(:display_name, :tabindex => 3) %> + <%= f.error_message_on(:display_name) %> +
            + <%= t ".display name description" %> +
            -
            -
            - - <%= f.password_field(:pass_crypt, :tabindex => 6) %> - <%= f.error_message_on(:pass_crypt) %> -
            -
            - - <%= f.password_field(:pass_crypt_confirmation, :tabindex => 7) %> - <%= f.error_message_on(:pass_crypt_confirmation) %> -
            -
            +
            +
            + + <%= f.select(:auth_provider, Auth::PROVIDERS, :default => "", :tabindex => 4) %> + <%= f.text_field(:auth_uid, :tabindex => 5) %> + <%= f.error_message_on(:auth_uid) %> +
            + <%= t ".auth no password" %> +
            -
            - <%= link_to t(".use external auth"), "#", :id => "auth_enable" %> -
            +
            +
            + + <%= f.password_field(:pass_crypt, :tabindex => 6) %> + <%= f.error_message_on(:pass_crypt) %> +
            +
            + + <%= f.password_field(:pass_crypt_confirmation, :tabindex => 7) %> + <%= f.error_message_on(:pass_crypt_confirmation) %> +
            +
            - <%= submit_tag t(".continue"), :tabindex => 8 %> -<% end %> +
            + <%= link_to t(".use external auth"), "#", :id => "auth_enable" %> +
            -
            -

            <%= t ".about.header" %>

            - <%= t ".about.html" %> + <%= submit_tag t(".continue"), :tabindex => 8 %> + <% end %> +
            diff --git a/app/views/users/terms.html.erb b/app/views/users/terms.html.erb index 97c1c7bf7..243ce2863 100644 --- a/app/views/users/terms.html.erb +++ b/app/views/users/terms.html.erb @@ -7,13 +7,13 @@
            <% end %> -<%= form_tag({ :action => "save" }, { :class => " inner22 standard-form fillL" }) do %> +<%= form_tag({ :action => "save" }, { :class => "standard-form fillL" }) do %>

            <%= t ".read and accept with tou" %>

            -