mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-02 06:01:24 -04:00
19 lines
602 B
Plaintext
19 lines
602 B
Plaintext
|
|
- if member_signed_in?
|
|
- if !post.members.include? current_member
|
|
- if can?(:new, Like)
|
|
= link_to 'Like', likes_path(post_id: post.id, format: :json),
|
|
method: :post, remote: true, class: 'post-like btn'
|
|
- else
|
|
- like = post.likes.find_by(member: current_member)
|
|
- if like && can?(:destroy, like)
|
|
= link_to 'Unlike', like_path(id: like.id, format: :json),
|
|
method: :delete, remote: true, class: 'post-like btn'
|
|
|
|
|
|
%span.badge.badge-info
|
|
.like-count
|
|
- unless post.likes.empty?
|
|
= like_icon
|
|
= pluralize(post.likes.count, "like")
|