From cc615d5eee4ccb3baaf95658c0a8221c7a8a2dd5 Mon Sep 17 00:00:00 2001 From: jarnaldich Date: Tue, 1 Mar 2011 09:43:42 +0100 Subject: [PATCH] Comments integrated --- sputnik/actions/blog.lua | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sputnik/actions/blog.lua b/sputnik/actions/blog.lua index f381795..62bc282 100644 --- a/sputnik/actions/blog.lua +++ b/sputnik/actions/blog.lua @@ -13,7 +13,7 @@ local disqs_tpl = [=[ // The following are highly recommended additional parameters. Remove the slashes in front to use. var disqus_identifier = "$id"; - var disqus_url = "$id"; + var disqus_url = "http://rubberbytes.nfshost.com/$id"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; @@ -26,7 +26,7 @@ local disqs_tpl = [=[ ]=] -local template = [=[ +local blog_template = [=[ $most_recent

Comments

@@ -36,6 +36,14 @@ local template = [=[ $do_entries[[
  • $name
  • ]] ]=] + +local entry_template = [=[ + $entry_content + +

    Comments

    + $disqs +]=] + local function pages_in_order(sputnik) local pages = sputnik.saci:get_nodes_by_prefix'blog' @@ -58,8 +66,7 @@ function actions.show_blog(node, request, sputnik) most_recent = sputnik:activate_node(most_recent) node.title = most_recent.title:gsub('blog/','') - node.inner_html = cosmo.f(template) { - test = "Prova", + node.inner_html = cosmo.f(blog_template) { disqs = cosmo.f(disqs_tpl){ id = most_recent.id }, most_recent = most_recent.actions.show_content(most_recent, request, sputnik), do_entries = function() @@ -75,8 +82,13 @@ function actions.show_blog(node, request, sputnik) return node.wrappers.default(node, request, sputnik) end - function actions.show_blog_entry(node, request, sputnik) node.title = node.title:gsub('blog/', '') - return wiki.actions.show(node, request, sputnik) + node.inner_html = cosmo.f(entry_template) { + disqs = cosmo.f(disqs_tpl){ id = node.id }, + entry_content = node.actions.show_content(node, request, sputnik) + } + + return node.wrappers.default(node, request, sputnik) +-- return wiki.actions.show(node, request, sputnik) end \ No newline at end of file -- 2.11.4.GIT