wikis: add "tag history", "wiki history", "what links here" sidebar options.

This commit is contained in:
evazion
2019-10-26 02:59:46 -05:00
parent 3a544ba5e0
commit 438a7a5a70
2 changed files with 20 additions and 0 deletions

View File

@@ -76,6 +76,10 @@ class WikiPage < ApplicationRecord
q = q.tag_matches(params[:tag])
end
if params[:linked_to].present?
q = q.where(id: DtextLink.wiki_link.where(link_target: params[:linked_to]).select(:model_id))
end
if params[:hide_deleted].to_s.truthy?
q = q.where("is_deleted = false")
end
@@ -165,6 +169,10 @@ class WikiPage < ApplicationRecord
title.starts_with?(*META_WIKIS)
end
def is_meta_wiki?
WikiPage.is_meta_wiki?(title)
end
def wiki_page_changed?
saved_change_to_title? || saved_change_to_body? || saved_change_to_is_locked? || saved_change_to_is_deleted? || saved_change_to_other_names?
end