From: Andy Allan Date: Wed, 11 May 2022 14:31:50 +0000 (+0100) Subject: Bootstrap 5: Remove use of form-row class X-Git-Tag: live~1116^2~14 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/2080696fe689c08faa238a73cda4366f71750423 Bootstrap 5: Remove use of form-row class This has been replaced by simple `row` class in v5. We can also use the gx-N classes here, which tighten up the horizontal gutter sizes for space-constrained forms. --- diff --git a/app/views/accounts/edit.html.erb b/app/views/accounts/edit.html.erb index 2017bee0a..cd53d294d 100644 --- a/app/views/accounts/edit.html.erb +++ b/app/views/accounts/edit.html.erb @@ -18,7 +18,7 @@
-
+
<%= 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" }) %>
diff --git a/app/views/diary_entries/_form.html.erb b/app/views/diary_entries/_form.html.erb index f72abc19e..7c6c12e6a 100644 --- a/app/views/diary_entries/_form.html.erb +++ b/app/views/diary_entries/_form.html.erb @@ -7,7 +7,7 @@ <%= tag.div "", :id => "map", :class => "border border-grey rounded", :data => { :lat => @lat, :lon => @lon, :zoom => @zoom } %> -
+
<%= f.text_field :latitude, :wrapper_class => "col-sm-4", :id => "latitude" %> <%= f.text_field :longitude, :wrapper_class => "col-sm-4", :id => "longitude" %>
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 4f9d3dbd6..9222aafff 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -5,7 +5,7 @@

<%= t ".search_guidance" %>

<%= form_tag(issues_path, :method => :get) do %> -
+
<%= select_tag :status, options_for_select(Issue.aasm.states.map(&:name).map { |state| [t(".states.#{state}"), state] }, params[:status]), diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index 57b7b7638..38a926760 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -1,6 +1,6 @@
-
+
@@ -21,7 +21,7 @@
-
+
<%= image_tag "marker-green.png", :class => "routing_marker mx-auto d-block", :data => { :type => "from" }, :draggable => "true" %>
@@ -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" %>
-
+
<%= image_tag "marker-red.png", :class => "routing_marker mx-auto d-block", :data => { :type => "to" }, :draggable => "true" %>
@@ -37,7 +37,7 @@ <%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
-
+
@@ -45,7 +45,7 @@ <%= submit_tag t("site.search.submit_text"), :class => "routing_go btn btn-sm btn-primary", :data => { :disable_with => false } %>
-
+
diff --git a/app/views/profiles/edit.html.erb b/app/views/profiles/edit.html.erb index c57f98a04..a6fa35220 100644 --- a/app/views/profiles/edit.html.erb +++ b/app/views/profiles/edit.html.erb @@ -11,7 +11,7 @@
<%= f.label t(".image") %> -
+
<%= user_image current_user %>
@@ -44,7 +44,7 @@ <%= t ".home location" -%>
class="nohome"<% end %>>

<%= t ".no home location" %>

-
+
<%= 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" %>
diff --git a/app/views/shared/_richtext_field.html.erb b/app/views/shared/_richtext_field.html.erb index cfe6f9827..22b3db542 100644 --- a/app/views/shared/_richtext_field.html.erb +++ b/app/views/shared/_richtext_field.html.erb @@ -1,4 +1,4 @@ -
+
<%= builder.text_area(attribute, options.merge(:wrapper => false, "data-preview-url" => preview_url(:type => type))) %>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index a94d4a812..201597f4e 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -27,7 +27,7 @@
-
+
<%= 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) %>
diff --git a/test/controllers/profiles_controller_test.rb b/test/controllers/profiles_controller_test.rb index 38e73a03f..737779455 100644 --- a/test/controllers/profiles_controller_test.rb +++ b/test/controllers/profiles_controller_test.rb @@ -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.form-group > 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.form-group > div > div.col-sm-10 > div.form-group > 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.form-group > div > div.col-sm-10 > div.form-check > input[name=avatar_action][checked]", false + assert_select "form > fieldset.form-group > div > div.col-sm-10 > div.form-group > div.form-check > input[name=avatar_action][checked]", false end end