TagSetPresenter: refactor to pass options explicitly.
Refactor tag_list_html, split_tag_list_html, and inline_tag_list_html to take the `show_extra_links` and `current_query` options explicitly, rather than implicitly relying on CurrentUser or taking `params[:tags]` from the template.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<div class="row list-of-tags">
|
||||
<strong>Tags</strong>
|
||||
<%= post.presenter.inline_tag_list_html(self) %>
|
||||
<%= post.presenter.inline_tag_list_html %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<section id="tag-box">
|
||||
<h1>Tags</h1>
|
||||
<%= @favorite_set.presenter.tag_list_html(self) %>
|
||||
<%= @favorite_set.presenter.tag_list_html %>
|
||||
</section>
|
||||
|
||||
<section id="related-box">
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<% if post.has_active_pools? %>
|
||||
<li><strong>Pools</strong>: <%= render "pools/inline_list", pools: post.pools.undeleted %></li>
|
||||
<% end %>
|
||||
<li><strong>Tags</strong>: <%= post.presenter.inline_tag_list_html(self) %></li>
|
||||
<li><strong>Tags</strong>: <%= post.presenter.inline_tag_list_html %></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<section id="tag-box">
|
||||
<h1>Tags</h1>
|
||||
<%= @post_set.presenter.tag_list_html(self) %>
|
||||
<%= @post_set.presenter.tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
|
||||
</section>
|
||||
|
||||
<%= render "posts/partials/index/options" %>
|
||||
|
||||
@@ -46,5 +46,5 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= @post.presenter.inline_tag_list_html(self, humanize_tags: false) %>
|
||||
<%= @post.presenter.inline_tag_list_html(humanize_tags: false) %>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<%= render "posts/partials/index/blacklist" %>
|
||||
|
||||
<section id="tag-list">
|
||||
<%= @post.presenter.split_tag_list_html(self) %>
|
||||
<%= @post.presenter.split_tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
|
||||
</section>
|
||||
|
||||
<section id="post-information">
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
<span class="info">
|
||||
<strong>Tags</strong>
|
||||
<%= TagSetPresenter.new(upload.tag_string.split).inline_tag_list_html(self) %>
|
||||
<%= upload.presenter.inline_tag_list_html %>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user