views: fix alias and implication list partial when tag is blank.

Fixup for abacc8ebb.
This commit is contained in:
evazion
2020-01-12 13:54:29 -06:00
parent 796efccbf4
commit 8dc69bef4b

View File

@@ -1,19 +1,20 @@
<% if tag.antecedent_alias %> <% if tag.present? %>
<% if tag.antecedent_alias %>
<p class="fineprint"> <p class="fineprint">
This tag has been aliased to <%= link_to_wiki(tag.antecedent_alias.consequent_name) %> This tag has been aliased to <%= link_to_wiki(tag.antecedent_alias.consequent_name) %>
(<%= link_to_wiki "learn more", "help:tag_aliases" %>). (<%= link_to_wiki "learn more", "help:tag_aliases" %>).
</p> </p>
<% end %> <% end %>
<% if tag.consequent_aliases.present? %> <% if tag.consequent_aliases.present? %>
<p class="fineprint"> <p class="fineprint">
The following tags are aliased to this tag: The following tags are aliased to this tag:
<%= to_sentence(tag.consequent_aliases.map { |ta| link_to_wiki ta.antecedent_name }) %> <%= to_sentence(tag.consequent_aliases.map { |ta| link_to_wiki ta.antecedent_name }) %>
(<%= link_to_wiki "learn more", "help:tag_aliases" %>). (<%= link_to_wiki "learn more", "help:tag_aliases" %>).
</p> </p>
<% end %> <% end %>
<% TagImplication.automatic_tags_for([tag.name]).tap do |automatic_tags| %> <% TagImplication.automatic_tags_for([tag.name]).tap do |automatic_tags| %>
<% if automatic_tags.present? %> <% if automatic_tags.present? %>
<p class="fineprint"> <p class="fineprint">
This tag automatically adds This tag automatically adds
@@ -21,20 +22,21 @@
(<%= link_to_wiki "learn more", "help:autotags" %>). (<%= link_to_wiki "learn more", "help:autotags" %>).
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
<% if tag.antecedent_implications.present? %> <% if tag.antecedent_implications.present? %>
<p class="fineprint"> <p class="fineprint">
This tag implicates This tag implicates
<%= to_sentence(tag.antecedent_implications.map { |ti| link_to_wiki ti.consequent_name }) %> <%= to_sentence(tag.antecedent_implications.map { |ti| link_to_wiki ti.consequent_name }) %>
(<%= link_to_wiki "learn more", "help:tag_implications" %>). (<%= link_to_wiki "learn more", "help:tag_implications" %>).
</p> </p>
<% end %> <% end %>
<% if tag.consequent_implications.present? %> <% if tag.consequent_implications.present? %>
<p class="fineprint"> <p class="fineprint">
The following tags implicate this tag: The following tags implicate this tag:
<%= to_sentence(tag.consequent_implications.map { |ti| link_to_wiki ti.antecedent_name }) %> <%= to_sentence(tag.consequent_implications.map { |ti| link_to_wiki ti.antecedent_name }) %>
(<%= link_to_wiki "learn more", "help:tag_implications" %>). (<%= link_to_wiki "learn more", "help:tag_implications" %>).
</p> </p>
<% end %>
<% end %> <% end %>