From 0fb635e8bc992d6753c781a23c738342e91903f0 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sat, 6 Apr 2024 17:11:38 +0300 Subject: [PATCH] Replace border-grey css class with border-secondary-subtle No noticeable difference (#cccccc vs #cfcfcf) and no problems with dark mode. --- app/assets/stylesheets/common.scss | 6 ------ app/helpers/user_helper.rb | 6 +++--- app/views/browse/_tag.html.erb | 4 ++-- app/views/browse/_tag_details.html.erb | 2 +- app/views/dashboards/show.html.erb | 4 ++-- app/views/diary_entries/_diary_entry.html.erb | 2 +- app/views/diary_entries/_form.html.erb | 2 +- app/views/diary_entries/show.html.erb | 2 +- app/views/layouts/_header.html.erb | 2 +- app/views/messages/show.html.erb | 2 +- app/views/profiles/edit.html.erb | 2 +- app/views/site/export.html.erb | 2 +- app/views/users/terms.html.erb | 2 +- test/helpers/user_helper_test.rb | 12 ++++++------ 14 files changed, 22 insertions(+), 28 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 35c5ba845..fc774a3ee 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -66,12 +66,6 @@ time[title] { color: $blue; } -/* Rules for borders */ -/* These add additional colours to those provided by bootstrap */ -.border-grey { - border-color: $grey !important; -} - /* Rules for the header */ #menu-icon { diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index e1ab423a1..cf2d40da5 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -2,7 +2,7 @@ module UserHelper # User images def user_image(user, options = {}) - options[:class] ||= "user_image border border-grey" + options[:class] ||= "user_image border border-secondary-subtle" options[:alt] ||= "" if user.image_use_gravatar @@ -15,7 +15,7 @@ module UserHelper end def user_thumbnail(user, options = {}) - options[:class] ||= "user_thumbnail border border-grey" + options[:class] ||= "user_thumbnail border border-secondary-subtle" options[:alt] ||= "" if user.image_use_gravatar @@ -28,7 +28,7 @@ module UserHelper end def user_thumbnail_tiny(user, options = {}) - options[:class] ||= "user_thumbnail_tiny border border-grey" + options[:class] ||= "user_thumbnail_tiny border border-secondary-subtle" options[:alt] ||= "" if user.image_use_gravatar diff --git a/app/views/browse/_tag.html.erb b/app/views/browse/_tag.html.erb index c0cdb5f9a..578dc8b59 100644 --- a/app/views/browse/_tag.html.erb +++ b/app/views/browse/_tag.html.erb @@ -1,4 +1,4 @@ - <%= format_key(tag[0]) %> - <%= format_value(tag[0], tag[1]) %> + <%= format_key(tag[0]) %> + <%= format_value(tag[0], tag[1]) %> diff --git a/app/views/browse/_tag_details.html.erb b/app/views/browse/_tag_details.html.erb index cc08fe16a..2b4ec1bb0 100644 --- a/app/views/browse/_tag_details.html.erb +++ b/app/views/browse/_tag_details.html.erb @@ -1,6 +1,6 @@ <% unless tag_details.empty? %>

<%= t ".tags" %>

-
+
<%= render :partial => "browse/tag", :collection => tag_details.sort %>
diff --git a/app/views/dashboards/show.html.erb b/app/views/dashboards/show.html.erb index 744661dfd..d3e6dbcb3 100644 --- a/app/views/dashboards/show.html.erb +++ b/app/views/dashboards/show.html.erb @@ -6,7 +6,7 @@ <% if current_user and @user.id == current_user.id %>
<% if !@user.home_location? %> -
+

<%= t(".no_home_location_html", :edit_profile_link => link_to(t(".edit_your_profile"), edit_profile_path)) %>

<% else %> @@ -19,7 +19,7 @@ :icon => image_path("marker-red.png"), :description => render(:partial => "popup", :object => current_user, :locals => { :type => "your location" }) } %> - <%= tag.div "", :id => "map", :class => "content_map border border-grey rounded", :data => { :user => user_data } %> + <%= tag.div "", :id => "map", :class => "content_map border border-secondary-subtle rounded", :data => { :user => user_data } %> <% end %> <% friends = @user.friends %> diff --git a/app/views/diary_entries/_diary_entry.html.erb b/app/views/diary_entries/_diary_entry.html.erb index a25ef10db..9c7d7b2dc 100644 --- a/app/views/diary_entries/_diary_entry.html.erb +++ b/app/views/diary_entries/_diary_entry.html.erb @@ -1,4 +1,4 @@ -
+
<%= render :partial => "diary_entry_heading", :object => diary_entry, :as => "diary_entry" %>
diff --git a/app/views/diary_entries/_form.html.erb b/app/views/diary_entries/_form.html.erb index 0b38e3ea6..291e8e33b 100644 --- a/app/views/diary_entries/_form.html.erb +++ b/app/views/diary_entries/_form.html.erb @@ -5,7 +5,7 @@
<%= t ".location" -%> - <%= tag.div "", :id => "map", :class => "border border-grey rounded mb-3", :data => { :lat => @lat, :lon => @lon, :zoom => @zoom } %> + <%= tag.div "", :id => "map", :class => "border border-secondary-subtle rounded mb-3", :data => { :lat => @lat, :lon => @lon, :zoom => @zoom } %>
<%= f.text_field :latitude, :wrapper_class => "col-sm-4 d-flex flex-column", :class => "mt-auto", :id => "latitude" %> diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index 0aea2d442..6c0895380 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -13,7 +13,7 @@ <%= render @entry %>
-
+

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

<% if current_user %> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 97be3f7b8..0fafc3c7f 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -81,7 +81,7 @@ <% if current_user && current_user.id %>
<%= f.primary t(".save") %> diff --git a/app/views/site/export.html.erb b/app/views/site/export.html.erb index bb66c665a..3bc62883f 100644 --- a/app/views/site/export.html.erb +++ b/app/views/site/export.html.erb @@ -6,7 +6,7 @@ <%= hidden_field_tag "format", "osm", :autocomplete => "off" %>
-
+
<%= text_field_tag("maxlat", nil, :size => 10, :autocomplete => "off", :class => "export_bound form-control mx-auto") %>
<%= text_field_tag("minlon", nil, :size => 10, :autocomplete => "off", :class => "export_bound form-control my-2") %> diff --git a/app/views/users/terms.html.erb b/app/views/users/terms.html.erb index e2ece8f1a..340aaf04e 100644 --- a/app/views/users/terms.html.erb +++ b/app/views/users/terms.html.erb @@ -30,7 +30,7 @@ <% end %>
-
+
<%= render :partial => "terms" %>
diff --git a/test/helpers/user_helper_test.rb b/test/helpers/user_helper_test.rb index 0767dea56..e72887798 100644 --- a/test/helpers/user_helper_test.rb +++ b/test/helpers/user_helper_test.rb @@ -8,12 +8,12 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) image = user_image(user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_image(user, :class => "foo") assert_match %r{^$}, image image = user_image(gravatar_user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_image(gravatar_user, :class => "foo") assert_match %r{^$}, image @@ -24,13 +24,13 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) image = user_thumbnail(user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail(user, :class => "foo") assert_match %r{^$}, image image = user_thumbnail(gravatar_user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail(gravatar_user, :class => "foo") assert_match %r{^$}, image @@ -41,13 +41,13 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) image = user_thumbnail_tiny(user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail_tiny(user, :class => "foo") assert_match %r{^$}, image image = user_thumbnail_tiny(gravatar_user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail_tiny(gravatar_user, :class => "foo") assert_match %r{^$}, image -- 2.39.5