posts: refactor post previews to use ViewComponent.
Refactor the post preview html to use the ViewComponent framework. This lets us encapsulate all the HTML, CSS, and helper methods for a UI component in a single place. See https://viewcomponent.org.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<% if @post.valid? %>
|
||||
var $post = $("#post_<%= @post.id %>");
|
||||
var $new_post = $("<%= j PostPresenter.preview(@post, show_deleted: true) %>");
|
||||
var $new_post = $("<%= j post_preview(@post, show_deleted: true) %>");
|
||||
Danbooru.Blacklist.apply_post($new_post.get(0));
|
||||
$("#post_<%= @post.id %>").replaceWith($new_post);
|
||||
<% if params[:mode] == "quick-edit" %>
|
||||
|
||||
Reference in New Issue
Block a user