bsw/jbe@0: slot.set_layout("rss") bsw/jbe@0: bsw/jbe@0: local function rss_channel(channel) bsw/jbe@0: for key, val in pairs(channel) do bsw/jbe@0: slot.put("<", key, ">", val, "") bsw/jbe@0: end bsw/jbe@0: end bsw/jbe@0: bsw/jbe@0: local function rss_item(item) bsw/jbe@0: slot.put("") bsw/jbe@0: for key, val in pairs(item) do bsw/jbe@0: slot.put("<", key, ">", val, "") bsw/jbe@0: end bsw/jbe@0: slot.put("") bsw/jbe@0: end bsw/jbe@0: bsw/jbe@0: local initiative = Initiative:by_id(param.get_id()) bsw/jbe@0: bsw/jbe@0: rss_channel{ bsw/jbe@0: title = initiative.name, bsw/jbe@0: description = initiative.current_draft.content, bsw/jbe@0: language = "de", bsw/jbe@0: } bsw/jbe@0: bsw/jbe@0: for i, suggestion in ipairs(initiative.suggestions) do bsw@75: bsw/jbe@0: local text = suggestion.name bsw/jbe@0: bsw/jbe@0: text = text .. " (" bsw/jbe@0: text = text .. tostring(suggestion.plus2_unfulfilled_count + suggestion.plus2_unfulfilled_count) .. "++ " bsw/jbe@0: text = text .. tostring(suggestion.plus1_unfulfilled_count + suggestion.plus1_unfulfilled_count) .. "+ " bsw/jbe@0: text = text .. tostring(suggestion.minus1_unfulfilled_count + suggestion.minus1_unfulfilled_count) .. "- " bsw/jbe@0: text = text .. tostring(suggestion.minus2_unfulfilled_count + suggestion.minus2_unfulfilled_count) .. "--" bsw/jbe@0: bsw/jbe@0: text = text .. ")" bsw/jbe@0: bsw/jbe@0: rss_item{ bsw/jbe@0: title = text, bsw/jbe@0: description = suggestion.content, bsw@75: link = request.get_base_url() .. "/lf/suggestion/show/" .. tostring(suggestion.id) .. ".html", bsw/jbe@0: } bsw/jbe@0: bsw/jbe@0: end