| 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@900
 | 
     9     if policy.polling then
 | 
| 
bsw@900
 | 
    10       ui.field.text{ label = _"New" .. ":", value = _"without" }
 | 
| 
bsw@900
 | 
    11     else
 | 
| 
bsw@900
 | 
    12       ui.field.text{ label = _"New" .. ":", value = "≤ " .. policy.admission_time }
 | 
| 
bsw@900
 | 
    13     end
 | 
| 
bsw@902
 | 
    14     ui.field.text{ label = _"Discussion" .. ":", value = policy.discussion_time or _"variable" }
 | 
| 
bsw@902
 | 
    15     ui.field.text{ label = _"Frozen" .. ":", value = policy.verification_time or _"variable" }
 | 
| 
bsw@902
 | 
    16     ui.field.text{ label = _"Voting" .. ":", value = policy.voting_time or _"variable" }
 | 
| 
bsw@902
 | 
    17     
 | 
| 
bsw@900
 | 
    18     if policy.polling then
 | 
| 
bsw@900
 | 
    19       ui.field.text{ label = _"Issue quorum" .. ":", value = _"without" }
 | 
| 
bsw@900
 | 
    20     else
 | 
| 
bsw@900
 | 
    21       ui.field.text{
 | 
| 
bsw@900
 | 
    22         label = _"Issue quorum",
 | 
| 
bsw@900
 | 
    23         value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den)
 | 
| 
bsw@900
 | 
    24       }
 | 
| 
bsw@900
 | 
    25     end
 | 
| 
bsw/jbe@52
 | 
    26     ui.field.text{
 | 
| 
bsw/jbe@52
 | 
    27       label = _"Initiative quorum",
 | 
| 
bsw/jbe@52
 | 
    28       value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den)
 | 
| 
bsw/jbe@52
 | 
    29     }
 | 
| 
bsw/jbe@52
 | 
    30     ui.field.text{
 | 
| 
bsw@286
 | 
    31       label = _"Direct majority",
 | 
| 
bsw@286
 | 
    32       value = 
 | 
| 
bsw@286
 | 
    33         (policy.direct_majority_strict and ">" or "≥" ) .. " "
 | 
| 
bsw@286
 | 
    34         .. tostring(policy.direct_majority_num) .. "/"
 | 
| 
bsw@286
 | 
    35         .. tostring(policy.direct_majority_den) 
 | 
| 
bsw@286
 | 
    36         .. (policy.direct_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.direct_majority_positive }) or "")
 | 
| 
bsw@286
 | 
    37         .. (policy.direct_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.direct_majority_non_negative }) or "")
 | 
| 
bsw/jbe@52
 | 
    38     }
 | 
| 
bsw/jbe@52
 | 
    39 
 | 
| 
bsw@286
 | 
    40     ui.field.text{
 | 
| 
bsw@286
 | 
    41       label = _"Indirect majority",
 | 
| 
bsw@286
 | 
    42       value = 
 | 
| 
bsw@286
 | 
    43         (policy.indirect_majority_strict and ">" or "≥" ) .. " "
 | 
| 
bsw@286
 | 
    44         .. tostring(policy.indirect_majority_num) .. "/"
 | 
| 
bsw@286
 | 
    45         .. tostring(policy.indirect_majority_den) 
 | 
| 
bsw@286
 | 
    46         .. (policy.indirect_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.indirect_majority_positive }) or "")
 | 
| 
bsw@286
 | 
    47         .. (policy.indirect_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.indirect_majority_non_negative }) or "")
 | 
| 
bsw@286
 | 
    48     }
 | 
| 
bsw@286
 | 
    49 
 | 
| 
bsw@286
 | 
    50     local texts = {}
 | 
| 
bsw@286
 | 
    51     if policy.no_reverse_beat_path then
 | 
| 
bsw@286
 | 
    52       texts[#texts+1] = _"no reverse beat path to status quo (including ties)"
 | 
| 
bsw@286
 | 
    53     end
 | 
| 
bsw@286
 | 
    54     if policy.no_multistage_majority then
 | 
| 
bsw@286
 | 
    55       texts[#texts+1] = _"prohibit potentially instable results caused by multistage majorities"
 | 
| 
bsw@286
 | 
    56     end
 | 
| 
bsw@286
 | 
    57     ui.field.text{
 | 
| 
bsw@286
 | 
    58       label = _"Options",
 | 
| 
bsw@286
 | 
    59       value = table.concat(texts, ", ")
 | 
| 
bsw@286
 | 
    60     }
 | 
| 
bsw@900
 | 
    61     if policy.description and #policy.description > 0 then
 | 
| 
bsw@900
 | 
    62       ui.container{
 | 
| 
bsw@900
 | 
    63         attr = { class = "suggestion_content wiki" },
 | 
| 
bsw@900
 | 
    64         content = function()
 | 
| 
bsw@900
 | 
    65           ui.tag{
 | 
| 
bsw@900
 | 
    66             tag = "p",
 | 
| 
bsw@900
 | 
    67             content = policy.description
 | 
| 
bsw@900
 | 
    68           }
 | 
| 
bsw@900
 | 
    69         end
 | 
| 
bsw@900
 | 
    70       }
 | 
| 
bsw@900
 | 
    71     end
 | 
| 
bsw/jbe@52
 | 
    72 
 | 
| 
bsw/jbe@52
 | 
    73   end
 | 
| 
bsw/jbe@52
 | 
    74 }
 |