annotate app/main/initiative/show_static.lua @ 117:b8dc98239f24
add custom script slot
author |
Daniel Poelzleithner <poelzi@poelzi.org> |
date |
Sun Sep 19 04:44:58 2010 +0200 (2010-09-19) |
parents |
bf885faf3452 |
children |
d87097d3b6ec |
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/jbe@19
|
7 slot.select("actions", function()
|
bsw/jbe@19
|
8 ui.link{
|
bsw/jbe@19
|
9 content = function()
|
bsw/jbe@19
|
10 ui.image{ static = "icons/16/script.png" }
|
bsw/jbe@19
|
11 slot.put(_"Show alternative initiatives")
|
bsw/jbe@19
|
12 end,
|
bsw/jbe@19
|
13 module = "issue",
|
bsw/jbe@19
|
14 view = "show",
|
bsw/jbe@19
|
15 id = initiative.issue.id
|
bsw/jbe@19
|
16 }
|
bsw/jbe@19
|
17 end)
|
bsw/jbe@19
|
18
|
bsw/jbe@19
|
19 execute.view{
|
bsw/jbe@19
|
20 module = "issue",
|
bsw/jbe@19
|
21 view = "_show_head",
|
poelzi@111
|
22 params = { issue = initiative.issue,
|
poelzi@111
|
23 initiative = initiative }
|
bsw/jbe@19
|
24 }
|
bsw/jbe@19
|
25
|
bsw/jbe@19
|
26 --slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(initiative.id) .. '.rss" />')
|
bsw/jbe@19
|
27
|
bsw@51
|
28 if app.session.member_id then
|
bsw@51
|
29 slot.select("actions", function()
|
bsw@51
|
30 if not initiative.issue.fully_frozen and not initiative.issue.closed then
|
bsw@51
|
31 ui.link{
|
bsw@51
|
32 image = { static = "icons/16/script_add.png" },
|
bsw@51
|
33 attr = { class = "action" },
|
bsw@51
|
34 text = _"Create alternative initiative",
|
bsw@51
|
35 module = "initiative",
|
bsw@51
|
36 view = "new",
|
bsw@51
|
37 params = { issue_id = initiative.issue.id }
|
bsw@51
|
38 }
|
bsw@51
|
39 end
|
bsw@51
|
40 end)
|
bsw@51
|
41 end
|
bsw/jbe@19
|
42
|
bsw@35
|
43 slot.put_into("sub_title", encode.html(_("Initiative: '#{name}'", { name = initiative.name }) ))
|
bsw/jbe@19
|
44
|
bsw/jbe@19
|
45 execute.view{
|
bsw/jbe@19
|
46 module = "initiative",
|
bsw/jbe@19
|
47 view = "show_partial",
|
bsw/jbe@19
|
48 params = {
|
bsw@23
|
49 initiative = initiative,
|
bsw@23
|
50 expanded = true
|
bsw/jbe@19
|
51 }
|
bsw@31
|
52 }
|