Patch #3806

Updated by Toshi MARUYAMA over 4 years ago

I just wrote the simple template engine:
You must create a project with id "templates".
Next, when you'll create the new wiki page, if page with such name can be found in templates/wiki, it will be used as template.

I using it to write SLA for projects.

The changes is in the
lib/redmine/wiki_formatting/textile/helper.rb
(one function)
<pre><code class="ruby"> &lt;pre&gt;
def initial_page_content(page)
@wtempl = Project.find("templates")
pname = "#{@page.pretty_title}"
@templ = @wtempl.wiki.find_or_new_page(pname)
if @templ.new_record?
then
"h1. #{@page.pretty_title}"
else
@templ.content.text
end
end
</code></pre> &lt;/pre&gt;

Back