-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
- if user_signed_in? && current_user.voted_for?(votable) | ||
= link_to '#', class: "mr-1" do | ||
%i.far.fa-heart | ||
= votable.votes_for.size | ||
- else | ||
- path = user_signed_in? ? vote_article_path(votable) : '#' | ||
= link_to path, method: :put, remote: true, class: "#{dom_id(votable)}_vote_btn text-muted text-nowrap mr-1" do | ||
%i.far.fa-heart | ||
= votable.votes_for.size | ||
%div{ class: "#{dom_id(votable)}_vote_btn d-flex align-items-end" } | ||
- if user_signed_in? && current_user.voted_for?(votable) | ||
- path = votable.user_id == current_user.id ? '#' : vote_article_path(votable) | ||
= link_to path, method: :put, remote: true, class: "mr-1" do | ||
%i.far.fa-heart | ||
= votable.votes_for.size | ||
- else | ||
- path = user_signed_in? ? vote_article_path(votable) : '#' | ||
= link_to path, method: :put, remote: true, class: "text-muted text-nowrap mr-1" do | ||
%i.far.fa-heart | ||
= votable.votes_for.size | ||
|
||
%small.text-muted.ml-1 | ||
%span.font-weight-bold>= link_to votable.user.name, votable.user, class: 'text-dark' | ||
님 추천 | ||
- if votable.votes_for.size > 1 | ||
· | ||
= votable.votes_for.reject{|vote| vote.voter_id == votable.user_id }.collect {|vote| vote.voter.name }.join(', ') | ||
님 공감 | ||
%small.text-muted.ml-1 | ||
%span.font-weight-bold>= link_to votable.user.name, votable.user, class: 'text-dark' | ||
님 추천 | ||
- if votable.votes_for.size > 1 | ||
· | ||
= votable.votes_for.reject{|vote| vote.voter_id == votable.user_id }.collect {|vote| vote.voter.name }.join(', ') | ||
님 공감 |