liquid_feedback_frontend

annotate app/main/initiative/show_static.lua @ 271:d13b27a37ad5

Optical enhancements, some repositioning of ui elements
author bsw
date Tue Feb 07 22:30:48 2012 +0100 (2012-02-07)
parents 1f7b38584c0d
children 65a1f7a01e7b
rev   line source
bsw/jbe@19 1 local initiative = param.get("initiative", "table")
bsw/jbe@19 2
bsw/jbe@19 3 if not initiative then
bsw/jbe@19 4 initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
bsw/jbe@19 5 end
bsw/jbe@19 6
bsw@271 7 execute.view{
bsw@271 8 module = "issue",
bsw@271 9 view = "_show_head",
bsw@271 10 params = { issue = initiative.issue,
bsw@271 11 initiative = initiative }
bsw@271 12 }
bsw@271 13
bsw/jbe@19 14 slot.select("actions", function()
bsw/jbe@19 15 ui.link{
bsw/jbe@19 16 content = function()
poelzi@149 17 local count = Initiative:new_selector():add_where{ "issue_id = ?", initiative.issue.id}:count()-1
bsw/jbe@19 18 ui.image{ static = "icons/16/script.png" }
poelzi@149 19 if count and count > 0 then
poelzi@149 20 slot.put(_("Show alternative initiatives (#{count})", {count=count}))
poelzi@149 21 else
poelzi@149 22 slot.put(_"Show alternative initiatives")
poelzi@149 23 end
bsw/jbe@19 24 end,
bsw/jbe@19 25 module = "issue",
bsw/jbe@19 26 view = "show",
bsw/jbe@19 27 id = initiative.issue.id
bsw/jbe@19 28 }
bsw/jbe@19 29 end)
bsw/jbe@19 30
bsw/jbe@19 31 --slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(initiative.id) .. '.rss" />')
bsw/jbe@19 32
bsw@51 33 if app.session.member_id then
bsw@51 34 slot.select("actions", function()
bsw@51 35 if not initiative.issue.fully_frozen and not initiative.issue.closed then
bsw@51 36 ui.link{
bsw@51 37 image = { static = "icons/16/script_add.png" },
bsw@51 38 attr = { class = "action" },
bsw@51 39 text = _"Create alternative initiative",
bsw@51 40 module = "initiative",
bsw@51 41 view = "new",
bsw@51 42 params = { issue_id = initiative.issue.id }
bsw@51 43 }
bsw@51 44 end
bsw@51 45 end)
bsw@51 46 end
bsw/jbe@19 47
bsw@268 48 slot.put_into("sub_title", encode.html(_("i#{id} #{name}", { id = initiative.id, name = initiative.name }) ))
bsw/jbe@19 49
bsw/jbe@19 50 execute.view{
bsw/jbe@19 51 module = "initiative",
bsw/jbe@19 52 view = "show_partial",
bsw/jbe@19 53 params = {
bsw@23 54 initiative = initiative,
bsw@23 55 expanded = true
bsw/jbe@19 56 }
bsw@31 57 }

Impressum / About Us