tag_set_presenter: refactor inline_tag_list_html.

* Sort tags by category in inline tag lists (on /comments page, /uploads page, and modqueue).
* Move tags css to common/erb/tags.scss.erb.
This commit is contained in:
evazion
2018-04-25 19:57:43 -05:00
parent 442964b0eb
commit f2998585e9
5 changed files with 30 additions and 37 deletions

View File

@@ -41,14 +41,9 @@ class TagSetPresenter < Presenter
end
# compact (horizontal) list, as seen in the /comments index.
def inline_tag_list_html(template)
@tags.map do |tag_name|
<<-EOS
<span class="category-#{categories[tag_name]}">
#{template.link_to(tag_name.tr("_", " "), template.posts_path(tags: tag_name))}
</span>
EOS
end.join.html_safe
def inline_tag_list_html(template, classes: "inline-tag-list", **options)
html = split_tag_list_html(template, category_list: TagCategory.categorized_list, headers: false, name_only: true, humanize_tags: true, **options)
template.tag.span(html, class: classes)
end
private