rev |
line source |
bsw/jbe@52
|
1 local policy = Policy:by_id(param.get_id())
|
bsw/jbe@52
|
2
|
bsw/jbe@52
|
3 slot.put_into("title", encode.html(_("Policy '#{name}'", { name = policy.name })))
|
bsw/jbe@52
|
4
|
bsw/jbe@52
|
5 ui.form{
|
bsw/jbe@52
|
6 attr = { class = "vertical" },
|
bsw/jbe@52
|
7 record = policy,
|
bsw/jbe@52
|
8 content = function()
|
bsw/jbe@52
|
9 ui.field.text{ label = _"Name", value = policy.name }
|
bsw/jbe@52
|
10
|
bsw/jbe@52
|
11 ui.field.text{ label = _"New", value = "≤ " .. policy.admission_time }
|
bsw/jbe@52
|
12 ui.field.text{ label = _"Discussion", value = policy.discussion_time }
|
bsw/jbe@52
|
13 ui.field.text{ label = _"Frozen", value = policy.verification_time }
|
bsw/jbe@52
|
14 ui.field.text{ label = _"Voting", value = policy.voting_time }
|
bsw/jbe@52
|
15
|
bsw/jbe@52
|
16 ui.field.text{
|
bsw/jbe@52
|
17 label = _"Issue quorum",
|
bsw/jbe@52
|
18 value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den)
|
bsw/jbe@52
|
19 }
|
bsw/jbe@52
|
20 ui.field.text{
|
bsw/jbe@52
|
21 label = _"Initiative quorum",
|
bsw/jbe@52
|
22 value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den)
|
bsw/jbe@52
|
23 }
|
bsw/jbe@52
|
24 ui.field.text{
|
bsw@286
|
25 label = _"Direct majority",
|
bsw@286
|
26 value =
|
bsw@286
|
27 (policy.direct_majority_strict and ">" or "≥" ) .. " "
|
bsw@286
|
28 .. tostring(policy.direct_majority_num) .. "/"
|
bsw@286
|
29 .. tostring(policy.direct_majority_den)
|
bsw@286
|
30 .. (policy.direct_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.direct_majority_positive }) or "")
|
bsw@286
|
31 .. (policy.direct_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.direct_majority_non_negative }) or "")
|
bsw/jbe@52
|
32 }
|
bsw/jbe@52
|
33
|
bsw@286
|
34 ui.field.text{
|
bsw@286
|
35 label = _"Indirect majority",
|
bsw@286
|
36 value =
|
bsw@286
|
37 (policy.indirect_majority_strict and ">" or "≥" ) .. " "
|
bsw@286
|
38 .. tostring(policy.indirect_majority_num) .. "/"
|
bsw@286
|
39 .. tostring(policy.indirect_majority_den)
|
bsw@286
|
40 .. (policy.indirect_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.indirect_majority_positive }) or "")
|
bsw@286
|
41 .. (policy.indirect_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.indirect_majority_non_negative }) or "")
|
bsw@286
|
42 }
|
bsw@286
|
43
|
bsw@286
|
44 local texts = {}
|
bsw@286
|
45 if policy.no_reverse_beat_path then
|
bsw@286
|
46 texts[#texts+1] = _"no reverse beat path to status quo (including ties)"
|
bsw@286
|
47 end
|
bsw@286
|
48 if policy.no_multistage_majority then
|
bsw@286
|
49 texts[#texts+1] = _"prohibit potentially instable results caused by multistage majorities"
|
bsw@286
|
50 end
|
bsw@286
|
51 ui.field.text{
|
bsw@286
|
52 label = _"Options",
|
bsw@286
|
53 value = table.concat(texts, ", ")
|
bsw@286
|
54 }
|
bsw/jbe@52
|
55 ui.container{
|
bsw/jbe@52
|
56 attr = { class = "suggestion_content wiki" },
|
bsw/jbe@52
|
57 content = function()
|
bsw/jbe@52
|
58 ui.tag{
|
bsw/jbe@52
|
59 tag = "p",
|
bsw/jbe@52
|
60 content = policy.description
|
bsw/jbe@52
|
61 }
|
bsw/jbe@52
|
62 end
|
bsw/jbe@52
|
63 }
|
bsw/jbe@52
|
64
|
bsw/jbe@52
|
65 end
|
bsw/jbe@52
|
66 }
|