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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user