Skip to content

Commit

Permalink
Merge pull request #187 from VismaLietuva/change-how-current-likes-ar…
Browse files Browse the repository at this point in the history
…e-shown

Changed how likes are shown
  • Loading branch information
SauliusStankevicius authored Jan 13, 2022
2 parents 2904491 + 8577cf1 commit 2884c38
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,54 +1,4 @@
<span ng-if="positionedLikes.length === 1" ng-cloak translate-cloak>
<span class="like-list-emoji-container">
<span>{{likeTypes[0].emoji}}</span>
</span>

<span ng-if="!!user">
<a ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })"
translate="common.you"></a>
<span translate="wall.likeThis"></span>.
</span>
<span ng-if="!user">
<a ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })">
{{::positionedLikes[0].fullName}}</a>
<span translate="wall.likesThis"></span>
</span>
</span>

<span ng-if="positionedLikes.length === 2" ng-cloak translate-cloak>
<span class="like-list-emoji-container">
<span ng-repeat="like in likeTypes">
<a ace-message-like-list-popover
modal-likes="filteredLikesByType"
current-modal-like-tab="{{like.type}}"
ng-if="filteredLikesByType[like.type].length > 0"
likes="filteredLikesByType[like.type]"
others="false"
modal-likes-all="positionedLikes"
style="text-decoration: none"
popover-title="{{like.resource}}"
popover-emoji="{{like.emoji}}">{{like.emoji}}</a>

<span ng-if="filteredLikes[key].length <= 0">
{{like.emoji}}
</span>
</span>
</span>

<a ng-if="!!user"
ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })"
translate="common.you"></a>

<a ng-if="!user"
ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })">
{{::positionedLikes[0].fullName}}</a>
<span translate="common.and"></span>
<a ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[1].userId })">
{{::positionedLikes[1].fullName}}</a>
<span translate="wall.likeThis"></span>
</span>

<span ng-if="positionedLikes.length > 2" ng-cloak translate-cloak>
<span ng-if="positionedLikes.length > 0" ng-cloak translate-cloak>
<div class="like-list-emoji-container">
<span ng-repeat="like in likeTypes">
<a ace-message-like-list-popover
Expand All @@ -68,25 +18,37 @@
</span>
</div>

<a ng-if="!!user"
ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })"
translate="common.you"></a>
<span ng-if="!user">
<a ace-message-like-list-popover
popover-title="common.emojiAll"
likes="positionedLikes"
modal-likes="filteredLikesByType"
all-like-types="true"
modal-likes-all="positionedLikes"
others="true"
data-test-id="{{::likeType}}-like-others">
<span>{{positionedLikes.length}}</span>
</a>
</span>

<a ng-if="!user"
ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })">
{{::positionedLikes[0].fullName}}</a>
<span translate="common.and"></span>
<span ng-if="user">
<a ng-if="positionedLikes.length === 1" ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })">{{positionedLikes[0].fullName}}</a>
<a ng-if="positionedLikes.length > 1" ui-sref="Root.WithOrg.Client.Profiles.Details({ id: positionedLikes[0].userId })" translate="common.you"></a>

<a ace-message-like-list-popover
popover-title="common.emojiAll"
likes="positionedLikes"
modal-likes="filteredLikesByType"
all-like-types="true"
modal-likes-all="positionedLikes"
others="true"
data-test-id="{{::likeType}}-like-others">
<span translate="common.others" translate-values="{ likeCount: positionedLikes.length - 1 }"></span>
</a>
<span ng-if="positionedLikes.length > 1">
<span translate="common.and"></span>

<span translate="wall.likeThis"></span>
<a ace-message-like-list-popover
popover-title="common.emojiAll"
likes="positionedLikes"
modal-likes="filteredLikesByType"
all-like-types="true"
modal-likes-all="positionedLikes"
others="true"
data-test-id="{{::likeType}}-like-others">
<span ng-if="positionedLikes.length === 2" translate="common.other" translate-values="{ likeCount: positionedLikes.length - 1 }"></span>
<span ng-if="positionedLikes.length > 2" translate="common.others" translate-values="{ likeCount: positionedLikes.length - 1 }"></span>
</a>
</span>
</span>
</span>
1 change: 1 addition & 0 deletions src/webapp/src/client/resources/en_US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
"deletePopupTitle": "Delete confirmation",
"birthdayDateIsTooOld": "Smallest possible date is 1900-01-01",
"and": "and",
"other": "{{ likeCount }} other",
"others": "{{ likeCount }} others",
"you": "You",
"typeToFilterList": "Type to filter list...",
Expand Down
2 changes: 0 additions & 2 deletions src/webapp/src/client/resources/en_US/wall.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"commentMessageBody": "Comment body",
"postMessageBody": "Post body",
"emptyMessageError": "Message can not be empty.",
"likesThis": "likes this",
"likeThis": "like this",
"noEmptyComment": "Comment can't be empty",
"noEmptyPost": "Post can't be empty",
"tooLongComment": "The field Comment body can not be longer than 5000 characters",
Expand Down
5 changes: 3 additions & 2 deletions src/webapp/src/client/resources/lt_LT/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@
"deletePopupTitle": "Ištrynimo patvirtinimas",
"birthdayDateIsTooOld": "Mažiausia galima datos reikšmė yra 1900-01-01",
"and": "ir",
"others": "{{ likeCount }} žmonėms",
"you": "Tau",
"other": "{{ likeCount }} žmogus",
"others": "{{ likeCount }} žmonės",
"you": "Tu",
"typeToFilterList": "Rašykit, kad išfiltruoti sąrašą...",
"selectFile": "Pasirinkite failą",
"emailSignatureText": "Daugiau naujienų galite gauti, apsilankę mūsų",
Expand Down
2 changes: 0 additions & 2 deletions src/webapp/src/client/resources/lt_LT/wall.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"commentMessageBody": "Komentaro žinutė",
"postMessageBody": "Žinutė",
"emptyMessageError": "Žinutė negali būti tuščia",
"likesThis": "tai mėgsta",
"likeThis": "tai patinka",
"noEmptyComment": "Komentaras negali būti tuščias",
"noEmptyPost": "Pranešimas negali būti tuščias",
"tooLongComment": "Komentaro tekstas negali būti ilgesnis nei 5000 simbolių",
Expand Down

0 comments on commit 2884c38

Please sign in to comment.