From 90cd029f6f89c332c666c009fea8a482af0a397f Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 23 Mar 2017 03:54:42 -0500 Subject: [PATCH] wiki excerpts: show alias/implication lists even for tags without a wiki. --- app/logical/post_sets/post.rb | 5 +++++ app/views/posts/partials/index/_excerpt.html.erb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 071e95f62..5e2247a43 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -37,6 +37,11 @@ module PostSets end end + def tag + return nil if !is_single_tag? + @tag ||= Tag.find_by(name: Tag.normalize_name(tag_string)) + end + def has_artist? is_single_tag? && artist.present? && artist.visible? end diff --git a/app/views/posts/partials/index/_excerpt.html.erb b/app/views/posts/partials/index/_excerpt.html.erb index a12807bee..3acf78220 100644 --- a/app/views/posts/partials/index/_excerpt.html.erb +++ b/app/views/posts/partials/index/_excerpt.html.erb @@ -82,6 +82,8 @@ <% else %> <% if post_set.tag_string.present? %>

There is currently no wiki page for the tag "<%= post_set.tag_string %>". You can <%= link_to "create one", new_wiki_page_path(:wiki_page => {:title => post_set.tag_string}) %>.

+ + <%= alias_and_implication_list(post_set.tag) %> <% end %> <% end %>