liquid_feedback_frontend

view app/main/initiative/_show_voting.lua @ 286:c587d8762e62

Registration process updated for Core 2.0, lockable member fields, notification settings
author bsw
date Sat Feb 25 11:51:37 2012 +0100 (2012-02-25)
parents 256d9be75916
children 8b6bc2958126
line source
1 local initiative = param.get("initiative", "table")
3 if initiative.revoked then
4 slot.put(_"Not voted (revoked from initiator)")
5 elseif initiative.admitted == false then
6 slot.put(_"Not voted (not admitted)")
7 else
9 execute.view{
10 module = "initiative",
11 view = "_battles",
12 params = { initiative = initiative }
13 }
15 slot.put("<br />")
17 ui.container{
18 attr = { class = "heading" },
19 content = _"Member voting"
20 }
22 execute.view{
23 module = "member",
24 view = "_list",
25 params = {
26 initiative = initiative,
27 for_votes = true,
28 members_selector = initiative.issue:get_reference_selector("direct_voters")
29 :left_join("vote", nil, { "vote.initiative_id = ? AND vote.member_id = member.id", initiative.id })
30 :add_field("direct_voter.weight as voter_weight")
31 :add_field("coalesce(vote.grade, 0) as grade")
32 :join("initiative", nil, "initiative.id = vote.initiative_id")
33 :join("issue", nil, "issue.id = initiative.issue_id")
34 }
35 }
37 slot.put("<br />")
39 ui.container{
40 attr = { class = "heading" },
41 content = _"Voting details"
42 }
44 ui.form{
45 attr = { class = "vertical" },
46 content = function()
48 ui.field.boolean{ label = _"Direct majority", value = initiative.direct_majority }
49 ui.field.boolean{ label = _"Indirect majority", value = initiative.indirect_majority }
50 ui.field.text{ label = _"Schulze rank", value = tostring(initiative.schulze_rank) .. " (" .. _("Status quo: #{rank}", { rank = initiative.issue.status_quo_schulze_rank }) .. ")" }
51 local texts = {}
52 if initiative.reverse_beat_path then
53 texts[#texts+1] = _"reverse beat path to status quo (including ties)"
54 end
55 if initiative.multistage_majority then
56 texts[#texts+1] = _"possibly instable result caused by multistage majority"
57 end
58 if #texts == 0 then
59 texts[#texts+1] = _"none"
60 end
61 ui.field.text{
62 label = _"Other failures",
63 value = table.concat(texts, ", ")
64 }
65 ui.field.boolean{ label = _"Eligible as winner", value = initiative.eligible }
66 end
67 }
70 end

Impressum / About Us