liquid_feedback_frontend

annotate 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
rev   line source
bsw/jbe@4 1 local issue = param.get("issue", "table")
bsw/jbe@4 2
bsw@51 3 local direct_voter
bsw@51 4
bsw@51 5 if app.session.member_id then
bsw@51 6 direct_voter = DirectVoter:by_pk(issue.id, app.session.member.id)
bsw@51 7 end
bsw/jbe@19 8
bsw/jbe@4 9 slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(issue.id) .. '.rss" />')
bsw/jbe@4 10
bsw/jbe@4 11 slot.select("path", function()
bsw/jbe@19 12 end)
bsw/jbe@19 13
bsw/jbe@19 14 slot.select("title", function()
bsw/jbe@4 15 ui.link{
bsw/jbe@19 16 content = issue.area.name,
bsw/jbe@4 17 module = "area",
bsw/jbe@4 18 view = "show",
bsw/jbe@4 19 id = issue.area.id
bsw/jbe@4 20 }
bsw/jbe@19 21 slot.put(" &middot; ")
bsw/jbe@5 22 ui.link{
bsw/jbe@19 23 content = _("Issue ##{id}", { id = issue.id }),
bsw/jbe@5 24 module = "issue",
bsw/jbe@5 25 view = "show",
bsw/jbe@5 26 id = issue.id
bsw/jbe@5 27 }
bsw/jbe@19 28 slot.put(" &middot; ")
bsw/jbe@19 29 ui.tag{
bsw/jbe@19 30 tag = "span",
bsw/jbe@19 31 content = issue.state_name,
bsw/jbe@19 32 }
bsw/jbe@5 33 end)
bsw/jbe@5 34
bsw/jbe@4 35
bsw/jbe@4 36 slot.select("actions", function()
bsw/jbe@5 37
bsw@51 38 if app.session.member_id then
bsw@51 39
bsw@51 40 if issue.state == 'voting' then
bsw@51 41 local text
bsw@51 42 if not direct_voter then
bsw@51 43 text = _"Vote now"
bsw@51 44 else
bsw@51 45 text = _"Change vote"
bsw@51 46 end
bsw@51 47 ui.link{
bsw@51 48 content = function()
bsw@51 49 ui.image{ static = "icons/16/email_open.png" }
bsw@51 50 slot.put(text)
bsw@51 51 end,
bsw@51 52 module = "vote",
bsw@51 53 view = "list",
bsw@51 54 params = { issue_id = issue.id }
bsw@51 55 }
bsw/jbe@19 56 end
bsw/jbe@5 57
bsw/jbe@5 58 execute.view{
bsw@51 59 module = "interest",
bsw/jbe@5 60 view = "_show_box",
bsw@51 61 params = { issue = issue }
bsw/jbe@5 62 }
bsw@7 63
bsw@51 64 if not issue.closed then
bsw@51 65 execute.view{
bsw@51 66 module = "delegation",
bsw@51 67 view = "_show_box",
bsw@51 68 params = { issue_id = issue.id }
bsw@51 69 }
bsw@51 70 end
bsw@51 71
bsw@51 72 execute.view{
bsw@51 73 module = "issue",
bsw@51 74 view = "_show_vote_later_box",
bsw@51 75 params = { issue = issue }
bsw@51 76 }
bsw@51 77
bsw@51 78 end
bsw/jbe@4 79
bsw@10 80 if config.issue_discussion_url_func then
bsw@10 81 local url = config.issue_discussion_url_func(issue)
bsw@10 82 ui.link{
bsw@10 83 attr = { target = "_blank" },
bsw@10 84 external = url,
bsw@10 85 content = function()
bsw@10 86 ui.image{ static = "icons/16/comments.png" }
bsw@10 87 slot.put(_"Discussion on issue")
bsw@10 88 end,
bsw@10 89 }
bsw@10 90 end
bsw/jbe@4 91 end)
bsw/jbe@4 92
bsw/jbe@4 93
bsw/jbe@4 94 execute.view{
bsw/jbe@4 95 module = "issue",
bsw/jbe@4 96 view = "_show_box",
bsw/jbe@4 97 params = { issue = issue }
bsw/jbe@4 98 }
bsw/jbe@4 99
bsw/jbe@4 100 -- ui.twitter("http://example.com/t" .. tostring(issue.id))
bsw/jbe@6 101
bsw/jbe@6 102
bsw/jbe@19 103 if issue.state == 'voting' and not direct_voter then
bsw/jbe@6 104 ui.container{
bsw/jbe@6 105 attr = { class = "voting_active_info" },
bsw/jbe@6 106 content = function()
bsw/jbe@6 107 slot.put(_"Voting for this issue is currently running!")
bsw/jbe@6 108 slot.put(" ")
bsw@51 109 if app.session.member_id then
bsw@51 110 ui.link{
bsw@51 111 content = function()
bsw@51 112 slot.put(_"Vote now")
bsw@51 113 end,
bsw@51 114 module = "vote",
bsw@51 115 view = "list",
bsw@51 116 params = { issue_id = issue.id }
bsw@51 117 }
bsw@51 118 end
bsw/jbe@6 119 end
bsw/jbe@6 120 }
bsw/jbe@6 121 slot.put("<br />")
bsw/jbe@6 122 end
bsw/jbe@6 123

Impressum / About Us