Only show heart icon when avatars are shown for comment likes

This commit is contained in:
Benjamin Neff 2022-11-12 04:11:52 +01:00
parent ad6c9dd55f
commit 71d071be60
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
5 changed files with 17 additions and 11 deletions

View file

@ -85,6 +85,10 @@
.media {
margin: 0 0 2px;
&:not(.display-avatars) .entypo-heart {
display: none;
}
}
.expand-likes {

View file

@ -166,11 +166,15 @@
font-size: 12px;
line-height: 16px;
.bd,
.entypo-heart {
display: inline-block;
}
.bd { display: inline-block; }
img { display: inline; }
}
.display-avatars .entypo-heart {
display: inline-block;
font-size: 16px;
line-height: 18px;
margin-right: 5px;
vertical-align: top;
}
}

View file

@ -1,6 +1,6 @@
{{#if likesCount}}
<div class="comment">
<div class="media">
<div class="media{{#if displayAvatars}} display-avatars{{/if}}">
<i class="entypo-heart"></i>
<div class="bd">
@ -8,9 +8,7 @@
<a href="#" class="expand-likes gray">
{{t "stream.likes" count=likesCount}}
</a>
{{else}}
{{#each likes}}
{{#linkToAuthor author}}
{{{personImage this 'small' 'micro'}}}

View file

@ -91,7 +91,7 @@ Feature: commenting
When "alice@alice.alice" has commented "That's cool" on "Look at this dog"
And I am on "alice@alice.alice"'s page
And I like the comment "That's cool"
Then I should see a heart within comment "That's cool"
Then I should see a like within comment "That's cool"
When I expand likes within comment "That's cool"
Then I should see a micro avatar within comment "That's cool"

View file

@ -51,10 +51,10 @@ Then /^I like the comment "([^"]*)"$/ do |comment_text|
find(id: comment_guid).click_link("Like")
end
Then /^I should see a heart within comment "([^"]*)"$/ do |comment_text|
Then /^I should see a like within comment "([^"]*)"$/ do |comment_text|
comment_guid = Comment.find_by(text: comment_text).guid
block = find(id: comment_guid)
expect(block).to have_css(".entypo-heart")
expect(block).to have_css(".expand-likes")
end
When /^I expand likes within comment "([^"]*)"$/ do |comment_text|