liquid_feedback_frontend

diff app/main/issue/show.rss.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/issue/show.rss.lua	Wed Nov 18 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +slot.set_layout("rss")
     1.5 +
     1.6 +local function rss_channel(channel)
     1.7 +  for key, val in pairs(channel) do
     1.8 +    slot.put("<", key, ">", encode.html(val), "</", key, ">")
     1.9 +  end
    1.10 +end
    1.11 +
    1.12 +local function rss_item(item)
    1.13 +  slot.put("<item>")
    1.14 +  for key, val in pairs(item) do
    1.15 +    slot.put("<", key, ">", encode.html(val), "</", key, ">")
    1.16 +  end
    1.17 +  slot.put("</item>")
    1.18 +end
    1.19 +
    1.20 +
    1.21 +local issue = Issue:by_id(param.get_id())
    1.22 +
    1.23 +rss_channel{
    1.24 +  title = issue.area.name .. " :: Issue #" .. tostring(issue.id),
    1.25 +  language = "de",
    1.26 +  pubDate = "Tue, 8 Jul 2008 2:43:19"
    1.27 +}
    1.28 +
    1.29 +for i, initiative in ipairs(issue.initiatives) do
    1.30 +  rss_item{
    1.31 +    title = initiative.name,
    1.32 +    description = initiative.current_draft.content,
    1.33 +    link = "http://localhost/lf/initiative/show/" .. tostring(initiative.id) .. ".html",
    1.34 +    author = initiative.current_draft.author.name,
    1.35 +    guid = "guid",
    1.36 +    pubDate = "Tue, 8 Jul 2008 2:43:19"
    1.37 +  }
    1.38 +end
    1.39 \ No newline at end of file

Impressum / About Us