favorites: remove is_favorited attribute from post API.
* Remove the data-is-favorited attribute from post thumbnails. * Remove the is_favorited attribute from the /posts.json API. * Remove the fav_string attribute from the /posts.json API (only visible to moderators). * Change `Post#favorited_by?` to not use the fav_string. Further addresses #4652 by eliminating the last places where fav_string was used.
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
<% end -%>
|
||||
|
||||
<% if policy(Favorite).create? %>
|
||||
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
|
||||
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.favorited_by?(CurrentUser.user)}") do %>
|
||||
<%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
|
||||
<%= button_tag tag.i(class: "far fa-heart"), class: "ui-button ui-widget ui-corner-all", "data-disable-with": tag.i(class: "fas fa-spinner fa-spin") %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user