enhance show or new wpages; move wpage preview code to helper

This commit is contained in:
Toks
2013-05-11 08:31:03 -04:00
parent 189544f66f
commit f972ee53c0
5 changed files with 25 additions and 14 deletions

View File

@@ -33,4 +33,17 @@ module WikiPagesHelper
html.html_safe
end
def wiki_page_post_previews(wiki_page)
html = '<div id="wiki-page-posts">'
if Post.fast_count(wiki_page.title) > 0
html << "<h2>Posts</h2>"
html << wiki_page.post_set.presenter.post_previews_html(self)
end
html << "</div>"
html.html_safe
end
end