From 42d53000e692b85961780de7b1f13f7d03079a75 Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 10 Apr 2013 09:12:30 -0400 Subject: [PATCH] improves humanized_essential_tag_string --- app/presenters/post_presenter.rb | 6 +++--- app/views/posts/show.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 27a881064..d3796013b 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -55,8 +55,8 @@ class PostPresenter < Presenter end if @post.copyright_tags.any? - string << "from" - string << @post.copyright_tags.slice(0, 5).to_sentence + copytags = @post.copyright_tags.slice(0, 5).to_sentence + string << (@post.character_tags.any? ? "(#{copytags})" : copytags) end if @post.artist_tags.any? @@ -64,7 +64,7 @@ class PostPresenter < Presenter string << @post.artist_tags.to_sentence end - string.join(" ").tr("_", " ") + string.empty? ? "##{@post.id}" : string.join(" ").tr("_", " ") end def categorized_tag_string diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 83f4f07f4..ce84e3a7e 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_categorized_tag_string %> - <%= Danbooru.config.app_name %> + <%= @post.presenter.humanized_essential_tag_string %> - <%= Danbooru.config.app_name %> <% end %> <% content_for(:html_header) do %>