views: add embed_wiki helper.

Also remove options to configure names of wiki notice pages. These names
generally don't need to be changed and we already hardcode links to wiki
pages in other places anyway.
This commit is contained in:
evazion
2020-01-27 13:04:28 -06:00
parent af044c45db
commit 588280c8cc
8 changed files with 11 additions and 36 deletions

View File

@@ -163,6 +163,12 @@ module ApplicationHelper
html.html_safe
end
def embed_wiki(title, **options)
wiki = WikiPage.find_by(title: title)
text = format_text(wiki&.body)
tag.div(text, class: "prose", **options)
end
def dtext_field(object, name, options = {})
options[:name] ||= name.capitalize
options[:input_id] ||= "#{object}_#{name}"