fixes #1734
This commit is contained in:
@@ -30,6 +30,26 @@ module PostSets
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_artist?
|
||||||
|
tag_array.any? && ::Artist.name_matches(tag_string).exists?
|
||||||
|
end
|
||||||
|
|
||||||
|
def artist
|
||||||
|
::Artist.name_matches(tag_string).first
|
||||||
|
end
|
||||||
|
|
||||||
|
def pool_name
|
||||||
|
tag_string.match(/^pool:(\S+)$/).try(:[], 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
def has_pool?
|
||||||
|
tag_array.size == 1 && pool_name && pool
|
||||||
|
end
|
||||||
|
|
||||||
|
def pool
|
||||||
|
::Pool.find(::Pool.name_to_id(pool_name))
|
||||||
|
end
|
||||||
|
|
||||||
def has_deleted?
|
def has_deleted?
|
||||||
CurrentUser.is_gold? && tag_string !~ /status/ && ::Post.tag_match("#{tag_string} status:deleted").exists?
|
CurrentUser.is_gold? && tag_string !~ /status/ && ::Post.tag_match("#{tag_string} status:deleted").exists?
|
||||||
end
|
end
|
||||||
@@ -54,14 +74,6 @@ module PostSets
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_artist?
|
|
||||||
tag_array.any? && ::Artist.name_matches(tag_string).exists?
|
|
||||||
end
|
|
||||||
|
|
||||||
def artist
|
|
||||||
::Artist.name_matches(tag_string).first
|
|
||||||
end
|
|
||||||
|
|
||||||
def is_single_tag?
|
def is_single_tag?
|
||||||
tag_array.size == 1
|
tag_array.size == 1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
<li><%= link_to "Artist", artist_path(@post_set.artist), :id => "show-excerpt-link" %></li>
|
<li><%= link_to "Artist", artist_path(@post_set.artist), :id => "show-excerpt-link" %></li>
|
||||||
<% elsif @post_set.has_wiki? %>
|
<% elsif @post_set.has_wiki? %>
|
||||||
<li><%= link_to "Wiki", wiki_page_path(@post_set.wiki_page), :id => "show-excerpt-link" %></li>
|
<li><%= link_to "Wiki", wiki_page_path(@post_set.wiki_page), :id => "show-excerpt-link" %></li>
|
||||||
|
<% elsif @post_set.has_pool? %>
|
||||||
|
<li><%= link_to "Pool", pool_path(@post_set.pool), :id => "show-excerpt-link" %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<div id="excerpt" style="display: none;">
|
<div id="excerpt" style="display: none;">
|
||||||
<% if post_set.artist %>
|
<% if post_set.has_artist? %>
|
||||||
<% unless post_set.artist.notes.blank? %>
|
<% unless post_set.artist.notes.blank? %>
|
||||||
<div class="prose">
|
<div class="prose">
|
||||||
<%= format_text(post_set.artist.notes) %>
|
<%= format_text(post_set.artist.notes) %>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<p>Read the <%= link_to "full article", wiki_page_path(post_set.wiki_page.id) %>.</p>
|
<p>Read the <%= link_to "full article", wiki_page_path(post_set.wiki_page.id) %>.</p>
|
||||||
</div>
|
</div>
|
||||||
<% elsif post_set.wiki_page %>
|
<% elsif post_set.has_wiki? %>
|
||||||
<div class="prose">
|
<div class="prose">
|
||||||
<%= format_text(post_set.wiki_page.presenter.excerpt) %>
|
<%= format_text(post_set.wiki_page.presenter.excerpt) %>
|
||||||
|
|
||||||
@@ -51,6 +51,18 @@
|
|||||||
|
|
||||||
<p>Read the <%= link_to "full article", wiki_page_path(post_set.wiki_page.id) %>.</p>
|
<p>Read the <%= link_to "full article", wiki_page_path(post_set.wiki_page.id) %>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<% elsif post_set.has_pool? %>
|
||||||
|
<h4>
|
||||||
|
<%= post_set.pool.pretty_category %>:
|
||||||
|
<%= link_to post_set.pool.pretty_name, pool_path(post_set.pool), :class => "pool-category-#{post_set.pool.category}" %>
|
||||||
|
<% if post_set.pool.is_deleted? %>
|
||||||
|
<span class="inactive">(deleted)</span>
|
||||||
|
<% end %>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<div id="description" class="prose">
|
||||||
|
<%= format_text(post_set.pool.description) %>
|
||||||
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if post_set.tag_string.present? %>
|
<% if post_set.tag_string.present? %>
|
||||||
<p>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}) %>.</p>
|
<p>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}) %>.</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user