From 22d627e844f0ea11330b0c6513dd9f9da6fbd129 Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 9 Apr 2013 22:45:59 -0400 Subject: [PATCH] fixes #1061 --- app/presenters/post_presenter.rb | 22 ++++++++++++++++++++++ app/views/posts/show.html.erb | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 30bf50f38..1face44c5 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -89,6 +89,28 @@ class PostPresenter < Presenter string.join("\n") end + def humanized_categorized_tag_string + string = [] + + if @post.copyright_tags.any? + string << @post.copyright_tags + end + + if @post.character_tags.any? + string << @post.character_tags + end + + if @post.artist_tags.any? + string << @post.artist_tags + end + + if @post.general_tags.any? + string << @post.general_tags + end + + string.slice(0, 25).join(", ").tr("_", " ") + end + def image_html(template) return template.content_tag("p", "The artist requested removal of this image") if @post.is_banned? && !CurrentUser.user.is_privileged? return template.content_tag("p", template.link_to("You need a privileged account to see this image.", template.upgrade_information_users_path)) if !Danbooru.config.can_user_see_post?(CurrentUser.user, @post) diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index ce84e3a7e..83f4f07f4 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -95,7 +95,7 @@ <% content_for(:page_title) do %> - <%= @post.presenter.humanized_essential_tag_string %> - <%= Danbooru.config.app_name %> + <%= @post.presenter.humanized_categorized_tag_string %> - <%= Danbooru.config.app_name %> <% end %> <% content_for(:html_header) do %>