From cb68450ac7b7a8dec6d0d721b9a7314bf1c7e95f Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 17 Nov 2021 18:07:24 +0000 Subject: [PATCH] Simplify margins when showing diary entries --- app/assets/stylesheets/common.scss | 13 ------------- app/views/diary_entries/_diary_entry.html.erb | 2 +- test/controllers/diary_entries_controller_test.rb | 4 ++-- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 01062bd61..1562b3fca 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1079,23 +1079,10 @@ tr.turn:hover { padding-bottom: $lineheight/2; border-top: 1px solid $grey; - &:first-of-type { - margin-top: $lineheight/2; - } - &.deleted { background-color: #fee; } - .post_heading { - margin-bottom: $lineheight; - - h2 { - margin-top: 0; - margin-bottom: $lineheight/2; - } - } - img.user_thumbnail { float: left; } diff --git a/app/views/diary_entries/_diary_entry.html.erb b/app/views/diary_entries/_diary_entry.html.erb index 2b3dad055..68b0a265a 100644 --- a/app/views/diary_entries/_diary_entry.html.erb +++ b/app/views/diary_entries/_diary_entry.html.erb @@ -1,5 +1,5 @@
-
+
<% if @user %>

<%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %>

<% else %> diff --git a/test/controllers/diary_entries_controller_test.rb b/test/controllers/diary_entries_controller_test.rb index 33e483652..b1e9b72f2 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -319,7 +319,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_select "h1", :text => /#{entry.user.display_name}'s Diary/, :count => 1 end assert_select "div#content", :count => 1 do - assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 + assert_select "h2", :text => /#{new_title}/, :count => 1 # This next line won't work if the text has been run through the htmlize function # due to formatting that could be introduced assert_select "p", :text => /#{new_body}/, :count => 1 @@ -339,7 +339,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_select "h1", :text => /#{entry.user.display_name}'s Diary/, :count => 1 end assert_select "div#content", :count => 1 do - assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 + assert_select "h2", :text => /#{new_title}/, :count => 1 # This next line won't work if the text has been run through the htmlize function # due to formatting that could be introduced assert_select "p", :text => /#{new_body}/, :count => 1 -- 2.39.5