]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/3612'
authorTom Hughes <tom@compton.nu>
Thu, 21 Jul 2022 18:20:26 +0000 (19:20 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 21 Jul 2022 18:20:26 +0000 (19:20 +0100)
33 files changed:
Gemfile
Gemfile.lock
app/assets/javascripts/leaflet.share.js
app/assets/stylesheets/common.scss
app/assets/stylesheets/parameters.scss
app/views/accounts/edit.html.erb
app/views/browse/changeset.html.erb
app/views/browse/new_note.html.erb
app/views/browse/note.html.erb
app/views/dashboards/_popup.html.erb
app/views/diary_entries/_form.html.erb
app/views/issues/index.html.erb
app/views/layouts/_header.html.erb
app/views/layouts/_search.html.erb
app/views/oauth2_authorizations/new.html.erb
app/views/oauth2_authorized_applications/_application.html.erb
app/views/oauth_clients/_form.html.erb
app/views/profiles/edit.html.erb
app/views/sessions/new.html.erb
app/views/shared/_richtext_field.html.erb
app/views/site/export.html.erb
app/views/site/help.html.erb
app/views/traces/index.html.erb
app/views/user_blocks/edit.html.erb
app/views/user_blocks/new.html.erb
app/views/user_blocks/revoke.html.erb
app/views/users/new.html.erb
app/views/users/terms.html.erb
test/controllers/accounts_controller_test.rb
test/controllers/preferences_controller_test.rb
test/controllers/profiles_controller_test.rb
test/controllers/users_controller_test.rb
test/integration/user_creation_test.rb

diff --git a/Gemfile b/Gemfile
index eee7dc69d2ff936f1df4f12abec2e09258602b6d..9f4f745ff77b0840706f6fa6ea9d46195550ee7f 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -40,8 +40,8 @@ gem "argon2"
 gem "actionpack-page_caching", ">= 1.2.0"
 gem "activerecord-import"
 gem "active_record_union"
-gem "bootstrap", "~> 4.5.0"
-gem "bootstrap_form", "~> 4.0"
+gem "bootstrap", "~> 5.1.0"
+gem "bootstrap_form", "~> 5.0"
 gem "cancancan"
 gem "composite_primary_keys", "~> 14.0.0"
 gem "config"
index b167a40538c12c6a4aa3dbca2cb5f04525778df7..8de7861560a22e4725806922723249c088101183 100644 (file)
@@ -117,11 +117,11 @@ GEM
       debug_inspector (>= 0.0.1)
     bootsnap (1.12.0)
       msgpack (~> 1.2)
-    bootstrap (4.5.3)
+    bootstrap (5.1.3)
       autoprefixer-rails (>= 9.1.0)
-      popper_js (>= 1.14.3, < 2)
+      popper_js (>= 2.9.3, < 3)
       sassc-rails (>= 2.0.0)
-    bootstrap_form (4.5.0)
+    bootstrap_form (5.1.0)
       actionpack (>= 5.2)
       activemodel (>= 5.2)
     brakeman (5.2.3)
@@ -356,7 +356,7 @@ GEM
     parser (3.1.2.0)
       ast (~> 2.4.1)
     pg (1.4.1)
-    popper_js (1.16.0)
+    popper_js (2.9.3)
     progress (3.6.0)
     public_suffix (4.0.7)
     puma (5.6.4)
@@ -521,8 +521,8 @@ DEPENDENCIES
   better_errors
   binding_of_caller
   bootsnap (>= 1.4.2)
-  bootstrap (~> 4.5.0)
-  bootstrap_form (~> 4.0)
+  bootstrap (~> 5.1.0)
+  bootstrap_form (~> 5.0)
   brakeman
   browser
   bzip2-ffi
index 79cb959732211750a7b517a07f44b9e4e77c14ad..db983939016de802ee8cbf61d21e42ed9281eb52 100644 (file)
@@ -47,7 +47,7 @@ L.OSM.share = function (options) {
       .appendTo($linkSection);
 
     $("<div>")
-      .attr("class", "form-check form-group")
+      .attr("class", "form-check mb-3")
       .appendTo($form)
       .append(
         $("<label>")
@@ -159,7 +159,7 @@ L.OSM.share = function (options) {
       .appendTo($imageSection);
 
     $("<div>")
-      .attr("class", "form-group form-check")
+      .attr("class", "mb-3 form-check")
       .appendTo($form)
       .append(
         $("<label>")
index d6331781286322da32ce55b1833783fa63f54f19..8ab10773b8c4c0530212c7d8e1b932cfdfbc079b 100644 (file)
@@ -62,17 +62,6 @@ small, aside {
 .icon.note.grey   { /* no-r2 */ background-position: -240px -20px; }
 .icon.query       { /* no-r2 */ background-position: -260px 0; }
 
-/* Rules for links */
-
-a {
-  color: #24d;
-  text-decoration: none;
-  outline: 0;
-  &:hover {
-    text-decoration: underline;
-  }
-}
-
 /* Utility for de-emphasizing content */
 
 .text-muted a {
@@ -202,7 +191,7 @@ nav.secondary {
 
   .login-menu {
     .btn-outline-secondary {
-      @include button-outline-variant($darkgrey);
+      @include button-outline-variant($darkgrey, $white, null, null, $white);
     }
   }
 
@@ -686,6 +675,28 @@ form {
   }
 }
 
+/* Stop bootstrap 5 from floating legends when they don't need to be */
+legend {
+  float: none;
+}
+
+/* Override the text colour for primary and secondary buttons, to match our
+   bootstrap 4 colours. Note this has accessibility issues, which is why
+   bootstrap 5 calculates black as the appropriate colour, and we should
+   reconsider our colours at some point with that in mind. */
+
+.btn-primary {
+  @include button-variant($primary, $primary, $white, null, null, $white, null, null, $white, null, null, $white);
+}
+
+.btn-secondary {
+  @include button-variant($secondary, $secondary, $white, null, null, $white, null, null, $white, null, null, $white);
+}
+
+.btn-outline-secondary {
+  @include button-outline-variant($secondary, $white, null, null, $white);
+}
+
 /* Rules for the search and direction forms */
 
 header .search_forms,
@@ -1436,13 +1447,6 @@ dl.dl-inline {
   }
 }
 
-/* Customise the background colour of striped tables */
-
-.table-striped > tbody > tr:nth-child(2n+1) > td,
-.table-striped > tbody > tr:nth-child(2n+1) > th {
-   background-color: $offwhite;
-}
-
 /* Rules for OpenID logo */
 
 .openid_logo {
index 6cbbf1a27afb3000b991fe6691a626248f2142fc..4b5daf4d01d8cd91bd6adf56fd778265e8bcec5e 100644 (file)
@@ -17,3 +17,12 @@ $sidebarWidth: 350px;
 $keyline: 1px solid $lightgrey;
 $list-highlight: #FFFFC0;
 $border: 1px solid $grey;
+
+$link-color: #24d;
+$link-hover-color: #24d;
+$link-decoration: none;
+$link-hover-decoration: underline;
+
+$table-striped-bg: $offwhite;
+
+$enable-negative-margins: true;
index 2017bee0a459cfd7e51b7e88de2d34a287ee9340..7aad944d364d9b79fbbe1cfc5dc804ea0fb79d28 100644 (file)
   <%= f.password_field :pass_crypt, :value => "", :autocomplete => "new-password" %>
   <%= f.password_field :pass_crypt_confirmation, :value => "", :autocomplete => "new-password" %>
 
-  <fieldset class="form-group">
-    <label for="user_auth_provider"><%= t(".external auth") %></label>
-    <div class="form-row">
+  <fieldset class="mb-3">
+    <label for="user_auth_provider" class="form-label"><%= t(".external auth") %></label>
+    <div class="row">
       <%= f.select(:auth_provider, Auth.providers, :hide_label => true, :wrapper => { :class => "col-auto mb-0" }) %>
       <%= f.text_field(:auth_uid, :hide_label => true, :wrapper => { :class => "col mb-0" }) %>
     </div>
     <small class="form-text text-muted">(<a href="<%= t ".openid.link" %>" target="_new"><%= t ".openid.link text" %></a>)</small>
   </fieldset>
 
-  <div class="form-group">
-    <label><%= t ".public editing.heading" %></label>
+  <div class="mb-3">
+    <label class="form-label"><%= t ".public editing.heading" %></label>
     <span class="form-text text-muted">
       <% if current_user.data_public? %>
         <%= t ".public editing.enabled" %>
@@ -38,8 +38,8 @@
     </span>
   </div>
 
-  <div class="form-group">
-    <label><%= t ".contributor terms.heading" %></label>
+  <div class="mb-3">
+    <label class="form-label"><%= t ".contributor terms.heading" %></label>
     <span class="form-text text-muted">
       <% if current_user.terms_agreed? %>
         <%= t ".contributor terms.agreed" %>
index ca27862c8d58adab81b77b55dae2168327a1524f..0861ed30f6b61ae90d214fe99152b35e6fe39150 100644 (file)
@@ -75,7 +75,7 @@
   <% if current_user %>
     <% unless @changeset.open? %>
       <form action="#" class="mb-3">
-        <div class="form-group">
+        <div class="mb-3">
           <textarea class="form-control" name="text" cols="40" rows="5"></textarea>
         </div>
         <div>
index 1db7609b371ee96c6485a3afe0d4cdaf0531ff0f..657ad9039acc37297723764cb623baaeef35eb8c 100644 (file)
@@ -7,7 +7,7 @@
   <form action="#">
     <input type="hidden" name="lon" autocomplete="off">
     <input type="hidden" name="lat" autocomplete="off">
-    <div class="form-group">
+    <div class="mb-3">
       <textarea class="form-control" name="text" cols="40" rows="10" maxlength="2000" placeholder="<%= t("javascripts.notes.new.advice") %>"></textarea>
     </div>
     <div class="buttons clearfix">
index 97787b178bf583accde69bad56333b14ae387dee..af859651e327f1dd63205154f8812427406d4019 100644 (file)
@@ -48,7 +48,7 @@
   <% if @note.status == "open" %>
     <% if current_user -%>
       <form action="#">
-        <div class="form-group">
+        <div class="mb-3">
           <textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
         </div>
         <div class="btn-wrapper">
index ef86f042d9fbe0575639fbcd48ac34e8ec2dce0e..c4f8b627a153d7ab4fc854518e2d67e64cbea2cd 100644 (file)
@@ -1,4 +1,4 @@
-<div class="user_popup row no-gutters mx-1">
+<div class="user_popup row g-0 mx-1">
   <div class="col-auto mx-1">
     <%= user_thumbnail popup %>
   </div>
index f72abc19e32c472a77e8e23d51f6184e5788cdb0..7c6c12e6a815390ba3ca1f275b7d9a50d7b53460 100644 (file)
@@ -7,7 +7,7 @@
 
   <%= tag.div "", :id => "map", :class => "border border-grey rounded", :data => { :lat => @lat, :lon => @lon, :zoom => @zoom } %>
 
-  <div class="form-row">
+  <div class="row">
     <%= f.text_field :latitude, :wrapper_class => "col-sm-4", :id => "latitude" %>
     <%= f.text_field :longitude, :wrapper_class => "col-sm-4", :id => "longitude" %>
     <div class="col-sm-4">
index 4f9d3dbd6d7d91919899509df89d82d9d79b7904..0b933653863896a987be963e86540a18c260077b 100644 (file)
@@ -5,36 +5,36 @@
 <p><%= t ".search_guidance" %></p>
 
 <%= form_tag(issues_path, :method => :get) do %>
-  <div class="form-row">
-    <div class="form-group col-md-auto">
+  <div class="row gx-1">
+    <div class="mb-3 col-md-auto">
       <%= select_tag :status,
                      options_for_select(Issue.aasm.states.map(&:name).map { |state| [t(".states.#{state}"), state] }, params[:status]),
                      :include_blank => t(".select_status"),
                      :data => { :behavior => "category_dropdown" },
-                     :class => "form-control custom-select" %>
+                     :class => "form-select" %>
     </div>
-    <div class="form-group col-md-auto">
+    <div class="mb-3 col-md-auto">
       <%= select_tag :issue_type,
                      options_for_select(@issue_types, params[:issue_type]),
                      :include_blank => t(".select_type"),
                      :data => { :behavior => "category_dropdown" },
-                     :class => "form-control custom-select" %>
+                     :class => "form-select" %>
     </div>
-    <div class="form-group col-md">
+    <div class="mb-3 col-md">
       <%= text_field_tag :search_by_user,
                          params[:search_by_user],
                          :placeholder => t(".reported_user"),
                          :autocomplete => "on",
                          :class => "form-control" %>
     </div>
-    <div class="form-group col-md-auto">
+    <div class="mb-3 col-md-auto">
       <%= select_tag :last_updated_by,
                      options_for_select(@users.all.collect { |f| [f.display_name, f.id] } << [t(".not_updated"), "nil"], params[:last_updated_by]),
                      :include_blank => t(".select_last_updated_by"),
                      :data => { :behavior => "category_dropdown" },
-                     :class => "form-control custom-select" %>
+                     :class => "form-select" %>
     </div>
-    <div class="form-group col-md-auto">
+    <div class="mb-3 col-md-auto">
       <%= submit_tag t(".search"), :name => nil, :class => "btn btn-primary" %>
     </div>
   </div>
index 1c1ae0ebe04047e6dee1fc42a591afc4ee5dc2d2..27314cfc74ff65bfe11122e70d9028d516d65774 100644 (file)
@@ -18,7 +18,7 @@
                     :class => "btn btn-outline-primary geolink editlink",
                     :id => "editanchor",
                     :data => { :editor => preferred_editor } %>
-        <a class='btn btn-outline-primary dropdown-toggle dropdown-toggle-split' data-toggle='dropdown' href='#'></a>
+        <a class='btn btn-outline-primary dropdown-toggle dropdown-toggle-split' data-bs-toggle='dropdown' href='#'></a>
         <ul class='dropdown-menu'>
           <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
             <li>
@@ -60,7 +60,7 @@
         <%= link_to t("layouts.about"), about_path, :class => "nav-link" %>
       </li>
       <li id="compact-secondary-nav" class="dropdown nav-item">
-        <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#"><%= t "layouts.more" %></a>
+        <a class="dropdown-toggle nav-link" data-bs-toggle="dropdown" href="#"><%= t "layouts.more" %></a>
         <ul class="dropdown-menu">
           <% if Settings.status != "database_offline" && can?(:index, Issue) %>
             <li class="<%= current_page_class(issues_path) %>">
@@ -80,8 +80,8 @@
     </ul>
     <% if current_user && current_user.id %>
       <div class='d-inline-flex dropdown user-menu logged-in clearfix'>
-        <a class='dropdown-toggle btn btn-outline-secondary pl-2 py-1 flex-grow-1' data-toggle='dropdown' href="#">
-          <%= user_thumbnail_tiny(current_user, :width => 25, :height => 25, :class => "user_thumbnail_tiny rounded-sm") %>
+        <a class='dropdown-toggle btn btn-outline-secondary px-2 py-1 flex-grow-1' data-bs-toggle='dropdown' href="#">
+          <%= user_thumbnail_tiny(current_user, :width => 25, :height => 25, :class => "user_thumbnail_tiny rounded-1") %>
           <%= render :partial => "layouts/inbox" %>
           <span class="user-button">
             <span class='username'>
@@ -89,7 +89,7 @@
             </span>
           </span>
         </a>
-        <div class='dropdown-menu dropdown-menu-right'>
+        <div class='dropdown-menu dropdown-menu-end'>
           <%= link_to t("users.show.my_dashboard"), dashboard_path, :class => "dropdown-item" %>
           <%= link_to inbox_messages_path, :class => "dropdown-item" do %>
             <%= t("users.show.my messages") %>
index 57b7b763867dcb2bab4389ebcf5bfe1e0668d638..c2501b95bf34762c1701c2fb3bea2422fe152237 100644 (file)
@@ -1,6 +1,6 @@
 <div class="search_forms">
   <form method="GET" action="<%= search_path %>" class="search_form px-1 py-2">
-    <div class="form-row mx-0">
+    <div class="row gx-2 mx-0">
       <div class="col">
         <div class="input-group flex-nowrap">
           <div class='query_wrapper position-relative flex-grow-1'>
@@ -21,7 +21,7 @@
   <form method="GET" action="<%= directions_path %>" class="directions_form pb-3">
     <div class="clearfix px-3 py-3"><span class="icon close"></span></div>
 
-    <div class="form-row m-1">
+    <div class="row gx-2 m-1">
       <div class="col-1">
         <%= image_tag "marker-green.png", :class => "routing_marker mx-auto d-block", :data => { :type => "from" }, :draggable => "true" %>
       </div>
@@ -29,7 +29,7 @@
         <%= text_field_tag "route_from", params[:from], :placeholder => t("site.search.from"), :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
       </div>
     </div>
-    <div class="form-row m-1">
+    <div class="row gx-2 m-1">
       <div class="col-1">
         <%= image_tag "marker-red.png", :class => "routing_marker mx-auto d-block", :data => { :type => "to" }, :draggable => "true" %>
       </div>
         <%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
       </div>
     </div>
-    <div class="form-row m-1">
+    <div class="row gx-2 m-1">
       <div class="col offset-1">
-        <select class="routing_engines form-control form-control-sm" name="routing_engines"></select>
+        <select class="routing_engines form-select form-select-sm" name="routing_engines"></select>
       </div>
       <div class="col-auto">
         <%= submit_tag t("site.search.submit_text"), :class => "routing_go btn btn-sm btn-primary", :data => { :disable_with => false } %>
       </div>
     </div>
-    <div class="form-row m-1">
+    <div class="row gx-2 m-1">
       <div class="col offset-1">
         <a class="reverse_directions"><%= t("site.search.reverse_directions_text") %></a>
       </div>
index 3b943a043c503f886cc7280160e840725f213b8a..971e0e20ad8b7979d85f5c5383036ebd0e989f7b 100644 (file)
@@ -10,7 +10,7 @@
   <% end -%>
 </ul>
 
-<div class="row justify-content-start no-gutters mx-n1">
+<div class="row justify-content-start g-0 mx-n1">
   <div class="col-auto mx-1">
     <%= bootstrap_form_tag :action => :create do |f| %>
       <%= f.hidden_field :client_id, :value => @pre_auth.client.uid %>
index 3781c1df3f264c3607c73b86b3d185cfbe7e615b..f27a6f82e2c5657d75a4c19ee0a08dc5c8810e3b 100644 (file)
@@ -9,7 +9,7 @@
       <% end -%>
     </ul>
   </td>
-  <td class="align-middle text-right">
+  <td class="align-middle text-end">
     <%= link_to t(".revoke"), oauth_authorized_application_path(application), { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_revoke") } } %>
   </td>
 </tr>
index 4554504121c3872874df01f8a37ac580146297bc..e13f4110f60287a479ae2e8e4edb04bbfd5af385 100644 (file)
@@ -2,7 +2,7 @@
 <%= f.text_field :url %>
 <%= f.text_field :callback_url %>
 <%= f.text_field :support_url %>
-<div class='form-group'>
+<div class='mb-3'>
   <p><%= t ".requests" %></p>
   <% ClientApplication.all_permissions.each do |perm| %>
     <%= f.check_box perm %>
index c57f98a044d534a44bd87399ccd116288466ce71..2af64b84fae10f462db46b194ea0ac7652c3c83d 100644 (file)
@@ -9,9 +9,9 @@
 <%= bootstrap_form_for current_user, :url => { :action => :update }, :html => { :multipart => true, :autocomplete => :off } do |f| %>
   <%= f.richtext_field :description, :cols => 80, :rows => 20 %>
 
-  <fieldset class="form-group">
+  <fieldset class="mb-3">
     <%= f.label t(".image") %>
-    <div class="form-row">
+    <div class="row">
       <div class="col-sm-2">
         <%= user_image current_user %>
       </div>
@@ -44,7 +44,7 @@
     <legend><%= t ".home location" -%></legend>
     <div id="homerow" <% unless current_user.home_lat and current_user.home_lon %> class="nohome"<% end %>>
       <p class="message text-muted"><%= t ".no home location" %></p>
-      <div class="form-row">
+      <div class="row">
         <%= f.text_field :home_lat, :wrapper_class => "col-sm-4", :id => "home_lat" %>
         <%= f.text_field :home_lon, :wrapper_class => "col-sm-4", :id => "home_lon" %>
       </div>
index 18f536206007ab965724be7ec2cefc7d038c7bb7..bb43aefd55b1ff8b92ee708c4db2bf5d747fdfd9 100644 (file)
@@ -24,8 +24,8 @@
   <hr>
 
   <div id="loginForm">
-    <div class="form-group">
-      <label><%= t ".with external" %></label>
+    <div class="mb-3">
+      <label class="form-label"><%= t ".with external" %></label>
 
       <ul class='list-unstyled' id="login_auth_buttons">
         <li><%= link_to image_tag("openid.png", :alt => t(".auth_providers.openid.title")), "#", :id => "openid_open_url", :title => t(".auth_providers.openid.title") %></li>
@@ -47,8 +47,8 @@
       </ul>
 
       <%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>
-        <div id='login_openid_url' class="form-group">
-          <label for='openid_url'><%= t ".openid_html", :logo => openid_logo %></label>
+        <div id='login_openid_url' class="mb-3">
+          <label for='openid_url' class="form-label"><%= t ".openid_html", :logo => openid_logo %></label>
           <%= hidden_field_tag("referer", params[:referer], :autocomplete => "off") %>
           <%= text_field_tag("openid_url", "", :tabindex => 3, :autocomplete => "on", :class => "openid_url form-control") %>
           <span class="form-text text-muted">(<a href="<%= t "accounts.edit.openid.link" %>" target="_new"><%= t "accounts.edit.openid.link text" %></a>)</span>
index cfe6f982788b3249f32bf027e540bad3ea0e4b23..22b3db54228fbd1d03e2eb5d43c138acb65dba87 100644 (file)
@@ -1,4 +1,4 @@
-<div id="<%= id %>_container" class="form-row richtext_container">
+<div id="<%= id %>_container" class="row richtext_container">
   <div id="<%= id %>_content" class="col-sm-8 mb-3 mb-sm-0 richtext_content">
     <%= builder.text_area(attribute, options.merge(:wrapper => false, "data-preview-url" => preview_url(:type => type))) %>
     <div id="<%= id %>_preview" class="richtext_preview richtext text-break"></div>
index b3a3bd0e9596ece4dc5ff3336d340ddf255b1662..6dd54f3153eba51b602c9da40193cc96249efe30 100644 (file)
@@ -27,7 +27,7 @@
   </div>
 
   <div id="export_commit">
-    <div class="form-group d-flex">
+    <div class="mb-3 d-flex">
       <%= submit_tag t(".export_button"), :class => "btn btn-primary mx-auto" %>
     </div>
   </div>
index c82893e9d2e6246f19e61a52ea2733741539fc48..640c5977322e9f0a27f37106d097e162d6e6f717 100644 (file)
@@ -7,10 +7,10 @@
 <% sites = %w[beginners_guide help mailing_lists forums irc switch2osm welcomemat wiki] %>
 <% sites.prepend("welcome") if current_user %>
 
-<% sites.in_groups_of(3, false) do |group| %>
-  <div class="card-deck mb-4">
-    <% group.each do |site| %>
-      <div class='<%= site %> help-item card'>
+<div class="row row-cols-sm-3 g-4 mb-3">
+  <% sites.each do |site| %>
+    <div class="col">
+      <div class='<%= site %> help-item card h-100'>
         <div class='card-body'>
           <h6 class='card-title'>
             <a href='<%= t ".#{site}.url" %>'>
@@ -27,6 +27,6 @@
           </small>
         </div>
       </div>
-    <% end %>
-  </div>
-<% end %>
+    </div>
+  <% end %>
+</div>
index 693de7e1ab71946f1ab6a2ab83bb98fc8cc0bd54..b930491c6ded650cd8617d3d6119ed21a83de8f1 100644 (file)
@@ -1,12 +1,18 @@
 <% content_for :heading_class, "pb-0" %>
 <% content_for :heading do %>
   <h1><%= @title %></h1>
-  <p>
-    <%= t(".description") %>
-    <% if params[:tag] %>
-      <%= link_to t(".remove_tag_filter", :tag => params[:tag]), { :controller => "traces", :action => "index", :display_name => nil, :tag => nil, :page => nil }, { :class => "border-left ml-2 pl-2" } %>
-    <% end %>
-  </p>
+  <nav class="secondary-actions mb-3">
+    <ul>
+      <li>
+        <%= t(".description") %>
+      </li>
+      <% if params[:tag] %>
+        <li>
+          <%= link_to t(".remove_tag_filter", :tag => params[:tag]), { :controller => "traces", :action => "index", :display_name => nil, :tag => nil, :page => nil } %>
+        </li>
+      <% end %>
+    </ul>
+  </nav>
   <ul class="nav nav-tabs flex-column flex-sm-row">
     <% if @target_user.blank? %>
       <!-- public traces -->
@@ -43,7 +49,7 @@
 
     <li class="nav-item flex-sm-grow-1"></li>
     <li class="nav-item">
-      <div class="px-3 py-1">
+      <div class="px-3 py-2 py-sm-0">
         <%= link_to({ :action => :georss, :display_name => @target_user&.display_name, :tag => params[:tag] }, { :class => "btn btn-secondary btn-sm" }) do %>
           <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="white" viewBox="0 0 16 16">
             <path d="M5.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm-3-8.5a1 1 0 0 1 1-1c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1-1-1zm0 4a1 1 0 0 1 1-1 6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1-1-1z" />
index 8c89c80f3eb41d12356df4f90dff91ea19e6e843..db7c5e057f360d5c80ceab91cdbfee6e4fe86589 100644 (file)
   <%= f.richtext_field :reason, :cols => 80, :rows => 20, :format => @user_block.reason_format %>
 
   <%= f.form_group do %>
-    <%= label_tag "user_block_period", t(".period") %><br />
-    <%= select_tag("user_block_period", options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] }, params[:user_block_period])) %>
+    <%= label_tag "user_block_period", t(".period"), :class => "form-label" %>
+    <%= select_tag("user_block_period",
+                   options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] }, params[:user_block_period]),
+                   :class => "form-select") %>
   <% end %>
 
   <%= f.form_group :needs_view do %>
index 4dc7fd63c8e0a50dc12ff4657d29c6fbd078dfcc..c390134ba3db8482127f0c0a34a085a147e39aeb 100644 (file)
@@ -9,8 +9,10 @@
   <%= f.richtext_field :reason, :cols => 80, :rows => 20 %>
 
   <%= f.form_group do %>
-    <%= label_tag "user_block_period", t(".period") %><br />
-    <%= select_tag("user_block_period", options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] }, params[:user_block_period])) %>
+    <%= label_tag "user_block_period", t(".period"), :class => "form-label" %>
+    <%= select_tag("user_block_period",
+                   options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] }, params[:user_block_period]),
+                   :class => "form-select") %>
   <% end %>
 
   <%= f.form_group :needs_view do %>
index 9ece75bb5f5839ca972c55d14d7adaa301a79b31..9a86177fc7dedcb030f3bb94f29f7186600a185e 100644 (file)
@@ -16,7 +16,7 @@
   </p>
 
   <%= bootstrap_form_for :revoke, :url => { :action => "revoke" } do |f| %>
-    <div class="form-group">
+    <div class="mb-3">
       <div class="form-check">
         <%= check_box_tag "confirm", "yes", false, { :class => "form-check-input" } %>
         <%= label_tag "confirm", t(".confirm"), { :class => "form-check-label" } %>
index a94d4a812afdd8b0ed28e1bc87b69b67d41e8cfc..081c4a99f856fd20322d76c5b3613699309e5e55 100644 (file)
@@ -25,9 +25,9 @@
 
       <%= f.text_field :display_name, :help => t(".display name description"), :tabindex => 3 %>
 
-      <fieldset class="form-group" id="auth_field">
-        <label for="user_auth_provider"><%= t(".external auth") %></label>
-        <div class="form-row">
+      <fieldset class="mb-3" id="auth_field">
+        <label for="user_auth_provider" class="form-label"><%= t(".external auth") %></label>
+        <div class="row">
           <%= f.select(:auth_provider, Auth.providers, :default => "", :hide_label => true, :wrapper => { :class => "col-auto mb-0" }, :tabindex => 4) %>
           <%= f.text_field(:auth_uid, :hide_label => true, :wrapper => { :class => "col mb-0" }, :tabindex => 5) %>
         </div>
index 58bddaca5fcee2ff82796486908db0bb8e14b1c7..f161667029dbad3b7cd8d8602d8aa518919020b1 100644 (file)
     <%= t ".heading_ct" %>
   </h4>
   <p class="text-muted"><%= t ".contributor_terms_explain" %></p>
-  <label>
+  <label class="form-label">
     <%= t ".legale_select" %>
   </label>
-  <div class="form-group">
+  <div class="mb-3">
     <% [%w[france FR], %w[italy IT], %w[rest_of_world GB]].each do |name, legale| %>
       <div class="form-check form-check-inline">
         <%= radio_button_tag "legale", legale, @legale == legale, :data => { :url => url_for(:legale => legale) }, :class => "form-check-input" %>
@@ -41,7 +41,7 @@
             :translations => "https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations" %>
     </p>
   </div>
-  <div class="form-group">
+  <div class="mb-3">
     <div class="form-check">
       <%= check_box_tag "read_ct", "1", false, :class => "form-check-input" %>
       <label for="read_ct" class="form-check-label">
@@ -55,7 +55,7 @@
   </h4>
   <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="form-group">
+  <div class="mb-3">
     <div class="form-check">
       <%= check_box_tag "read_tou", "1", false, :class => "form-check-input" %>
       <label for="read_tou" class="form-check-label">
 
   <%= hidden_field_tag("referer", h(params[:referer])) unless params[:referer].nil? %>
 
-  <div class="form-group">
+  <div class="mb-3">
     <%= submit_tag("Continue", :name => "continue", :id => "continue", :disabled => true, :class => "btn btn-primary") %>
     <%= submit_tag("Cancel", :name => "decline", :id => "decline", :class => "btn btn-outline-secondary") %>
   </div>
 
-  <div class="form-group">
+  <div class="mb-3">
     <div class="form-check">
       <%= check_box("user", "consider_pd", :class => "form-check-input") %>
     <label for="user_consider_pd" class="form-check-label">
index 173bcf22c568819bc098a488aa688f0bf5948413..1e39a7329e6c3a7b9fccac22696e223edc3effeb 100644 (file)
@@ -61,7 +61,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_template :edit
     assert_select ".notice", false
-    assert_select "form#accountForm > div.form-group > input.is-invalid#user_display_name"
+    assert_select "form#accountForm > div > input.is-invalid#user_display_name"
 
     # Changing name to one that exists should fail, regardless of case
     new_attributes = user.attributes.dup.merge(:display_name => create(:user).display_name.upcase)
@@ -69,7 +69,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_template :edit
     assert_select ".notice", false
-    assert_select "form#accountForm > div.form-group > input.is-invalid#user_display_name"
+    assert_select "form#accountForm > div > input.is-invalid#user_display_name"
 
     # Changing name to one that doesn't exist should work
     new_attributes = user.attributes.dup.merge(:display_name => "new tester")
@@ -80,7 +80,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_template :edit
     assert_select ".notice", /^User information updated successfully/
-    assert_select "form#accountForm > div.form-group > input#user_display_name[value=?]", "new tester"
+    assert_select "form#accountForm > div > input#user_display_name[value=?]", "new tester"
 
     # Record the change of name
     user.display_name = "new tester"
@@ -95,7 +95,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_template :edit
     assert_select ".notice", false
-    assert_select "form#accountForm > div.form-group > input.is-invalid#user_new_email"
+    assert_select "form#accountForm > div > input.is-invalid#user_new_email"
 
     # Changing email to one that exists should fail, regardless of case
     user.new_email = create(:user).email.upcase
@@ -107,7 +107,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_template :edit
     assert_select ".notice", false
-    assert_select "form#accountForm > div.form-group > input.is-invalid#user_new_email"
+    assert_select "form#accountForm > div > input.is-invalid#user_new_email"
 
     # Changing email to one that doesn't exist should work
     user.new_email = "new_tester@example.com"
@@ -122,7 +122,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_template :edit
     assert_select ".notice", /^User information updated successfully/
-    assert_select "form#accountForm > div.form-group > input#user_new_email[value=?]", user.new_email
+    assert_select "form#accountForm > div > input#user_new_email[value=?]", user.new_email
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal user.new_email, email.to.first
index 8c529e62a009f3ecb44af280282a5181a876c487..6bc609e6abca77dc4cdebe680e0da53d12171df0 100644 (file)
@@ -31,7 +31,7 @@ class PreferencesControllerTest < ActionDispatch::IntegrationTest
     assert_template :edit
     assert_select ".notice", false
     assert_select ".error", true
-    assert_select "form > div.form-group > select#user_preferred_editor > option[selected]", false
+    assert_select "form > div > select#user_preferred_editor > option[selected]", false
 
     # Changing to a valid editor should work
     user.preferred_editor = "id"
index 38e73a03f7a86655b0d4055aa79f6256b7926f26..824ecb5e33339e2bbd4d3a7c53c2e6069dfd3a7d 100644 (file)
@@ -39,7 +39,7 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest
     assert_template :show
     assert_select ".notice", /^Profile updated./
     get edit_profile_path
-    assert_select "form > fieldset.form-group > div.form-row > div.col-sm-10 > div.form-check > input[name=avatar_action][checked][value=?]", "keep"
+    assert_select "form > fieldset > div > div.col-sm-10 > div.form-check > input[name=avatar_action][checked][value=?]", "keep"
 
     # Changing to a gravatar image should work
     put profile_path, :params => { :avatar_action => "gravatar", :user => { :description => user.description } }
@@ -50,7 +50,7 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest
     assert_template :show
     assert_select ".notice", /^Profile updated./
     get edit_profile_path
-    assert_select "form > fieldset.form-group > div.form-row > div.col-sm-10 > div.form-group > div.form-check > input[name=avatar_action][checked][value=?]", "gravatar"
+    assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked][value=?]", "gravatar"
 
     # Removing the image should work
     put profile_path, :params => { :avatar_action => "delete", :user => { :description => user.description } }
@@ -61,7 +61,7 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest
     assert_template :show
     assert_select ".notice", /^Profile updated./
     get edit_profile_path
-    assert_select "form > fieldset.form-group > div.form-row > div.col-sm-10 > div.form-check > input[name=avatar_action][checked]", false
-    assert_select "form > fieldset.form-group > div.form-row > div.col-sm-10 > div.form-group > div.form-check > input[name=avatar_action][checked]", false
+    assert_select "form > fieldset > div > div.col-sm-10 > div > input[name=avatar_action][checked]", false
+    assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked]", false
   end
 end
index 7a487780d20059e41e14f5b45200db7af9095a0a..634b279a5857ec134a59502cbdef1a37c64a3f86 100644 (file)
@@ -151,7 +151,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
 
     assert_response :success
     assert_template "new"
-    assert_select "form > div.form-group > input.is-invalid#user_email"
+    assert_select "form > div > input.is-invalid#user_email"
   end
 
   def test_save_duplicate_email
@@ -180,7 +180,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
 
     assert_response :success
     assert_template "new"
-    assert_select "form > div.form-group > input.is-invalid#user_email"
+    assert_select "form > div > input.is-invalid#user_email"
   end
 
   def test_save_duplicate_email_uppercase
@@ -209,7 +209,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
 
     assert_response :success
     assert_template "new"
-    assert_select "form > div.form-group > input.is-invalid#user_email"
+    assert_select "form > div > input.is-invalid#user_email"
   end
 
   def test_save_duplicate_name
@@ -238,7 +238,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
 
     assert_response :success
     assert_template "new"
-    assert_select "form > div.form-group > input.is-invalid#user_display_name"
+    assert_select "form > div > input.is-invalid#user_display_name"
   end
 
   def test_save_duplicate_name_uppercase
@@ -267,7 +267,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
 
     assert_response :success
     assert_template "new"
-    assert_select "form > div.form-group > input.is-invalid#user_display_name"
+    assert_select "form > div > input.is-invalid#user_display_name"
   end
 
   def test_save_blocked_domain
index 9343487f6d6c5f7c78d18f4ae276f35923e6ed36..7163e1b72974e19233da1e2811427fbd2d71e488 100644 (file)
@@ -51,7 +51,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         assert_template "users/new"
         assert_equal locale.to_s, response.headers["Content-Language"]
         assert_select "form"
-        assert_select "form > div.form-group > input.is-invalid#user_email"
+        assert_select "form > div > input.is-invalid#user_email"
         assert_no_missing_translations
       end
     end
@@ -77,7 +77,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         end
         assert_response :success
         assert_template "users/new"
-        assert_select "form > div.form-group > input.is-invalid#user_display_name"
+        assert_select "form > div > input.is-invalid#user_display_name"
         assert_no_missing_translations
       end
     end