Closed Bug 1011295 Opened 11 years ago Closed 11 years ago

Makes view heart/like display in profile-2

Categories

(Webmaker Graveyard :: Profile, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: akirose, Assigned: Tanay, Mentored)

References

Details

Attachments

(1 file)

(per cassie at https://projects.invisionapp.com/d/main#/console/1049631/23348262/comments/12414827) - If a make has no likes, heart should be empty and not have a zero by it - If a user has liked it, it should be full. - If user has not liked it but other people have, the heart should be empty but there should be a count displayed next to it.
Hi Aki, from where are the images (heart) imported, makerstrap? Could you please give me a link?
Flags: needinfo?(aki)
Changes have to be made here: app/_less/views/makes.less and here: app/_partials/makes-list.html Would it be something like: <span class="make-likes" ng-if="make.likes.length">{{ make.likes.length }}</span> <span class="make-likes-empty" ng-if="{{ make.likes.length === 0 }}"></span> And in makes.less: .make-likes-empty { margin-right: 1rem; &::before { .fa-mixin(); color: @brand-primary; content: @fa-var-heart-0; font-weight: 300; margin-right: 0.5rem; &:hover { font-weight: 700; } } }
The complication here is that we need to check if the user has liked it. (In retrospect, can a user like their own makes?) If the user-liking-their-own-make-part isn’t an issue, I think actually something like this would work (but you should test to be sure) <span class="make-likes" ng-if="make.likes.length">{{ make.likes.length }}</span> <span class="make-likes-empty" ng-if="!make.likes.length"></span>
Flags: needinfo?(aki) → needinfo?(gavin)
Attachment #8467683 - Flags: review?(gavin)
I can't see anything following the Invision link. Can we put what was there on Redpen?
Flags: needinfo?(cassie)
I un-archived the Invision project so I could find the comment: http://snaps.akibraun.com/vphxl.png
Flags: needinfo?(cassie)
Assignee: nobody → tanay1337
Mentor: aki
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [profile2]
I think the previous pull request achieves half of what was required, as Aki said, "The complication here is that we need to check if the user has liked it. (In retrospect, can a user like their own makes?)". Dont know how to implement to check if a user had liked a make, other than this feature, other points stated in the bug have been taken care of.
Flags: needinfo?(aki)
Comment on attachment 8467683 [details] [review] https://github.com/mozilla/webmaker-profile-2/pull/67 Just a couple of small changes, left some notes on your pull request!
Attachment #8467683 - Flags: review?(gavin)
Attachment #8467683 - Flags: review?(aki)
Attachment #8467683 - Flags: review-
Flags: needinfo?(aki)
Status: NEW → ASSIGNED
Attachment #8467683 - Flags: review- → review?(aki)
Attachment #8467683 - Flags: review?(aki) → review+
Tanay: While this is a perfect interim solution, I think I answered my own question. We need to grab the user object and figure out the current user's likes, then match them up with the makes on the profile they are viewing at any given moment. From there, the flow should be… : While logged in to webmaker 1. I visit someone's profile other than my own, such as https://webmaker.org/user/keyboardkat 2. Any Make that I have not liked should have an empty heart, even if it has been liked by others -> caveat: the number "0" should never render 3. The heart should be a link, triggering the like/unlike method for myself 4. Upon clicking the heart to like, the number next to it should increment and the heart should fill -> to click a filled heart to unlike, the number next to it should decrement and the heart should toggle to open (@fa-var-heart-o)
Sorry, but I don't think that I would be able to complete the next phase of this bug, since I am not a JS programmer. Assigning it to you.
Assignee: tanay1337 → aki
Not sure if you still needinfo? Clearing this flag, but feel free to re-flag.
Flags: needinfo?(gavin)
Reassigning to default for now. Comment #10 has the general instructions for solving this bug, but I won't be able to get to it for a while.
Assignee: aki → nobody
Status: ASSIGNED → NEW
Blocks: 1052502
Assignee: nobody → tanay1337
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: