fixes #725
This commit is contained in:
@@ -21,6 +21,14 @@ class WikiPagePresenter
|
|||||||
@antecedent_tag_alias ||= TagAlias.where("status = 'active' and antecedent_name = ?", wiki_page.title).first
|
@antecedent_tag_alias ||= TagAlias.where("status = 'active' and antecedent_name = ?", wiki_page.title).first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def consequent_tag_implications
|
||||||
|
@consequent_tag_implications ||= TagImplication.where("status = 'active' and consequent_name = ?", wiki_page.title).all
|
||||||
|
end
|
||||||
|
|
||||||
|
def antecedent_tag_implication
|
||||||
|
@antecedent_tag_implication ||= TagImplication.where("status = 'active' and antecedent_name = ?", wiki_page.title).first
|
||||||
|
end
|
||||||
|
|
||||||
# Produce a formatted page that shows the difference between two versions of a page.
|
# Produce a formatted page that shows the difference between two versions of a page.
|
||||||
def diff(other_version)
|
def diff(other_version)
|
||||||
pattern = Regexp.new('(?:<.+?>)|(?:[0-9_A-Za-z\x80-\xff]+[\x09\x20]?)|(?:[ \t]+)|(?:\r?\n)|(?:.+?)')
|
pattern = Regexp.new('(?:<.+?>)|(?:[0-9_A-Za-z\x80-\xff]+[\x09\x20]?)|(?:[ \t]+)|(?:\r?\n)|(?:.+?)')
|
||||||
|
|||||||
@@ -22,6 +22,14 @@
|
|||||||
<% if @wiki_page.presenter.consequent_tag_aliases.any? %>
|
<% if @wiki_page.presenter.consequent_tag_aliases.any? %>
|
||||||
<p class="hint">The following tags are aliased to this tag: <%= raw @wiki_page.presenter.consequent_tag_aliases.map {|x| link_to(x.antecedent_name, posts_path(:tags => x.antecedent_name))}.join(", ") %>.</p>
|
<p class="hint">The following tags are aliased to this tag: <%= raw @wiki_page.presenter.consequent_tag_aliases.map {|x| link_to(x.antecedent_name, posts_path(:tags => x.antecedent_name))}.join(", ") %>.</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if @wiki_page.presenter.antecedent_tag_implication %>
|
||||||
|
<p class="hint">This tag has been implicated to <%= link_to @wiki_page.presenter.antecedent_tag_implication.consequent_name, posts_path(:tags => @wiki_page.presenter.antecedent_tag_implication.consequent_name) %>.</p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if @wiki_page.presenter.consequent_tag_implications.any? %>
|
||||||
|
<p class="hint">The following tags are implicated to this tag: <%= raw @wiki_page.presenter.consequent_tag_implications.map {|x| link_to(x.antecedent_name, posts_path(:tags => x.antecedent_name))}.join(", ") %>.</p>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="wiki-page-posts">
|
<div id="wiki-page-posts">
|
||||||
|
|||||||
Reference in New Issue
Block a user