rename similar posts to recommended posts, refactor menu on posts/show
This commit is contained in:
7
app/views/posts/partials/index/_recommended.html.erb
Normal file
7
app/views/posts/partials/index/_recommended.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="recommended-posts">
|
||||
<p><em>You might also like:</em></p>
|
||||
|
||||
<section class="user-disable-cropped-<%= Danbooru.config.enable_image_cropping && CurrentUser.user.disable_cropped_thumbnails? %>">
|
||||
<%= PostSets::Recommended.new(post).presenter.post_previews_html(self) %>
|
||||
</section>
|
||||
</div>
|
||||
@@ -1,7 +0,0 @@
|
||||
<div class="similar-posts">
|
||||
<p><em>You might also like:</em></p>
|
||||
|
||||
<section>
|
||||
<%= PostSets::Similar.new(post).presenter.post_previews_html(self) %>
|
||||
</section>
|
||||
</div>
|
||||
@@ -87,8 +87,8 @@
|
||||
<% end %>
|
||||
|
||||
<menu id="post-sections">
|
||||
<% if RecommenderService.available?(@post) %>
|
||||
<li><a href="#similar">Similar</a></li>
|
||||
<% if RecommenderService.enabled? %>
|
||||
<li><a href="#recommended">Recommended</a></li>
|
||||
<% end %>
|
||||
|
||||
<li><a href="#comments">Comments</a></li>
|
||||
@@ -100,11 +100,13 @@
|
||||
<li><a href="#share">Share</a></li>
|
||||
</menu>
|
||||
|
||||
<% if RecommenderService.available?(@post) %>
|
||||
<section id="similar">
|
||||
<%= render "posts/partials/index/similar", post: @post %>
|
||||
</section>
|
||||
<% end %>
|
||||
<section id="recommended" data-available="<%= RecommenderService.available?(@post) %>">
|
||||
<% if RecommenderService.available?(@post) %>
|
||||
<%= render "posts/partials/index/recommended", post: @post %>
|
||||
<% else %>
|
||||
<p><em>Not enough data available</em></p>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<section id="comments">
|
||||
<% if !CurrentUser.user.is_builder? %>
|
||||
|
||||
Reference in New Issue
Block a user