liquid_feedback_frontend
view app/main/initiative/show_static.lua @ 172:165f4bd02cf3
don't show the first draft of a new initiative as a new draft event in the timeline
new draft should only show changes of drafts drafts of new initiatives as they are handled by the new initiative event
new draft should only show changes of drafts drafts of new initiatives as they are handled by the new initiative event
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Sun Oct 10 19:40:32 2010 +0200 (2010-10-10) |
parents | d87097d3b6ec |
children | 1f7b38584c0d |
line source
1 local initiative = param.get("initiative", "table")
3 if not initiative then
4 initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
5 end
7 slot.select("actions", function()
8 ui.link{
9 content = function()
10 local count = Initiative:new_selector():add_where{ "issue_id = ?", initiative.issue.id}:count()-1
11 ui.image{ static = "icons/16/script.png" }
12 if count and count > 0 then
13 slot.put(_("Show alternative initiatives (#{count})", {count=count}))
14 else
15 slot.put(_"Show alternative initiatives")
16 end
17 end,
18 module = "issue",
19 view = "show",
20 id = initiative.issue.id
21 }
22 end)
24 execute.view{
25 module = "issue",
26 view = "_show_head",
27 params = { issue = initiative.issue,
28 initiative = initiative }
29 }
31 --slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(initiative.id) .. '.rss" />')
33 if app.session.member_id then
34 slot.select("actions", function()
35 if not initiative.issue.fully_frozen and not initiative.issue.closed then
36 ui.link{
37 image = { static = "icons/16/script_add.png" },
38 attr = { class = "action" },
39 text = _"Create alternative initiative",
40 module = "initiative",
41 view = "new",
42 params = { issue_id = initiative.issue.id }
43 }
44 end
45 end)
46 end
48 slot.put_into("sub_title", encode.html(_("Initiative: '#{name}'", { name = initiative.name }) ))
50 execute.view{
51 module = "initiative",
52 view = "show_partial",
53 params = {
54 initiative = initiative,
55 expanded = true
56 }
57 }