liquid_feedback_frontend
view app/main/issue/_show_head.lua @ 51:0849be391140
Public read access; Read-only API for initiatives; Prepared integration of OpenID
author | bsw |
---|---|
date | Sun Apr 04 22:05:11 2010 +0200 (2010-04-04) |
parents | 00d1004545f1 |
children | 88ac7798b562 |
line source
1 local issue = param.get("issue", "table")
3 local direct_voter
5 if app.session.member_id then
6 direct_voter = DirectVoter:by_pk(issue.id, app.session.member.id)
7 end
9 slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(issue.id) .. '.rss" />')
11 slot.select("path", function()
12 end)
14 slot.select("title", function()
15 ui.link{
16 content = issue.area.name,
17 module = "area",
18 view = "show",
19 id = issue.area.id
20 }
21 slot.put(" · ")
22 ui.link{
23 content = _("Issue ##{id}", { id = issue.id }),
24 module = "issue",
25 view = "show",
26 id = issue.id
27 }
28 slot.put(" · ")
29 ui.tag{
30 tag = "span",
31 content = issue.state_name,
32 }
33 end)
36 slot.select("actions", function()
38 if app.session.member_id then
40 if issue.state == 'voting' then
41 local text
42 if not direct_voter then
43 text = _"Vote now"
44 else
45 text = _"Change vote"
46 end
47 ui.link{
48 content = function()
49 ui.image{ static = "icons/16/email_open.png" }
50 slot.put(text)
51 end,
52 module = "vote",
53 view = "list",
54 params = { issue_id = issue.id }
55 }
56 end
58 execute.view{
59 module = "interest",
60 view = "_show_box",
61 params = { issue = issue }
62 }
64 if not issue.closed then
65 execute.view{
66 module = "delegation",
67 view = "_show_box",
68 params = { issue_id = issue.id }
69 }
70 end
72 execute.view{
73 module = "issue",
74 view = "_show_vote_later_box",
75 params = { issue = issue }
76 }
78 end
80 if config.issue_discussion_url_func then
81 local url = config.issue_discussion_url_func(issue)
82 ui.link{
83 attr = { target = "_blank" },
84 external = url,
85 content = function()
86 ui.image{ static = "icons/16/comments.png" }
87 slot.put(_"Discussion on issue")
88 end,
89 }
90 end
91 end)
94 execute.view{
95 module = "issue",
96 view = "_show_box",
97 params = { issue = issue }
98 }
100 -- ui.twitter("http://example.com/t" .. tostring(issue.id))
103 if issue.state == 'voting' and not direct_voter then
104 ui.container{
105 attr = { class = "voting_active_info" },
106 content = function()
107 slot.put(_"Voting for this issue is currently running!")
108 slot.put(" ")
109 if app.session.member_id then
110 ui.link{
111 content = function()
112 slot.put(_"Vote now")
113 end,
114 module = "vote",
115 view = "list",
116 params = { issue_id = issue.id }
117 }
118 end
119 end
120 }
121 slot.put("<br />")
122 end