From 2b84452222db25cfcfdc2a788ebea79d2ea517f7 Mon Sep 17 00:00:00 2001
From: Andy Allan
Date: Wed, 3 Nov 2021 17:27:33 +0000
Subject: [PATCH 1/5] Remove custom margins on sidebar headings
Margin-top in particular is best avoided. The removal of some top
margins required a few corresponding changes to add bottom margins
to other features, mostly done by converting bare text strings to
live within paragraphs.
---
app/assets/stylesheets/common.scss | 8 +++-----
app/views/browse/_common_details.html.erb | 4 ++--
app/views/browse/changeset.html.erb | 14 +++++++-------
test/integration/user_changeset_comments_test.rb | 2 +-
4 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index ccb0d7493..fdff4ebfc 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -370,8 +370,6 @@ body.compact-nav {
}
h3, h4 {
- margin-top: $lineheight;
- margin-bottom: $lineheight/2;
font-size: 1.25rem;
}
@@ -813,7 +811,6 @@ tr.turn:hover {
border-bottom: 1px solid $grey;
h4:first-child {
- margin-top: 0;
word-wrap: break-word;
}
}
@@ -858,6 +855,7 @@ tr.turn:hover {
border-collapse: separate;
border-spacing: 0;
width: 100%;
+ margin-bottom: $spacer;
th, td {
border-bottom: 1px solid $grey;
@@ -910,7 +908,7 @@ tr.turn:hover {
.subscribe-buttons {
float: left;
- margin: 18px 10px 10px;
+ margin: 0 10px;
min-width: 80px;
}
@@ -966,7 +964,7 @@ tr.turn:hover {
}
.export_area_inputs {
- margin-bottom: $lineheight/2;
+ margin-bottom: $spacer;
input[type="text"] {
width: 100px;
text-align: center;
diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb
index 356207754..5505ee4a9 100644
--- a/app/views/browse/_common_details.html.erb
+++ b/app/views/browse/_common_details.html.erb
@@ -11,7 +11,7 @@
<% end %>
-
+
<%= t "browse.#{common_details.visible? ? :edited : :deleted}_by_html",
:time => time_ago_in_words(common_details.timestamp, :scope => :"datetime.distance_in_words_ago"),
:user => changeset_user_link(common_details.changeset),
@@ -19,7 +19,7 @@
·
<%= t "browse.in_changeset" %>
#<%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %>
-
+
<% if @type == "node" and common_details.visible? %>
diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb
index 079915fcf..496589a08 100644
--- a/app/views/browse/changeset.html.erb
+++ b/app/views/browse/changeset.html.erb
@@ -6,7 +6,7 @@
<%= linkify(@changeset.tags["comment"].to_s.presence || t("browse.no_comment")) %>
-
<%= changeset_details(@changeset) %>
+
<%= changeset_details(@changeset) %>
<%= render :partial => "tag_details", :object => @changeset.tags.except("comment") %>
@@ -63,14 +63,14 @@
<% end %>
<% unless current_user %>
-
+
<%= link_to(t(".join_discussion"), login_path(:referer => request.fullpath)) %>
-
+
<% end %>
<% if current_user %>
<% unless @changeset.is_open? %>
-
<% else %>
-
- <%= t(".still_open") %>
-
+
+ <%= t(".still_open") %>
+
<% end %>
<% end %>
diff --git a/test/integration/user_changeset_comments_test.rb b/test/integration/user_changeset_comments_test.rb
index a9bd468ce..2b95094fe 100644
--- a/test/integration/user_changeset_comments_test.rb
+++ b/test/integration/user_changeset_comments_test.rb
@@ -12,7 +12,7 @@ class UserChangesetCommentsTest < ActionDispatch::IntegrationTest
assert_select "div#sidebar" do
assert_select "div#sidebar_content" do
assert_select "div" do
- assert_select "div.notice" do
+ assert_select "p.notice" do
assert_select "a[href='/login?referer=%2Fchangeset%2F#{changeset.id}']", :text => I18n.t("browse.changeset.join_discussion"), :count => 1
end
end
From 826a864e6c3e1f733b74d6d5aacf6b3253507a75 Mon Sep 17 00:00:00 2001
From: Andy Allan
Date: Wed, 3 Nov 2021 17:33:01 +0000
Subject: [PATCH 2/5] Remove the contact-activity class
The margin-top is better replaced with a bottom margin on the
preceding element, and the width is unnecessary in the grid layout.
---
app/assets/stylesheets/common.scss | 7 -------
app/views/dashboards/_contact.html.erb | 2 +-
app/views/dashboards/show.html.erb | 4 ++--
test/controllers/dashboards_controller_test.rb | 4 +++-
4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index fdff4ebfc..ac55dc821 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -1092,13 +1092,6 @@ tr.turn:hover {
}
}
-/* Rules for the user profile page */
-
-.contact-activity {
- margin-top: $lineheight;
- width: 100%;
-}
-
/* Rules for the user map */
.content_map .leaflet-popup-content {
diff --git a/app/views/dashboards/_contact.html.erb b/app/views/dashboards/_contact.html.erb
index 7614c0c4d..cf1866cc9 100644
--- a/app/views/dashboards/_contact.html.erb
+++ b/app/views/dashboards/_contact.html.erb
@@ -4,7 +4,7 @@
:icon => image_path(type == "friend" ? "marker-blue.png" : "marker-green.png"),
:description => render(:partial => "popup", :object => contact, :locals => { :type => type })
} %>
-<%= tag.div :class => "contact-activity clearfix row", :data => { :user => user_data } do %>
+<%= tag.div :class => "clearfix row", :data => { :user => user_data } do %>
<%= user_thumbnail contact, :class => "user_thumbnail_no_margins" %>
diff --git a/app/views/dashboards/show.html.erb b/app/views/dashboards/show.html.erb
index 9aa4abed4..0f04dafb9 100644
--- a/app/views/dashboards/show.html.erb
+++ b/app/views/dashboards/show.html.erb
@@ -32,7 +32,7 @@
<% if friends.empty? %>
<%= t ".no friends" %>
<% else %>
-