bsw/jbe@52: local policy = Policy:by_id(param.get_id()) bsw/jbe@52: bsw/jbe@52: slot.put_into("title", encode.html(_("Policy '#{name}'", { name = policy.name }))) bsw/jbe@52: bsw/jbe@52: ui.form{ bsw/jbe@52: attr = { class = "vertical" }, bsw/jbe@52: record = policy, bsw/jbe@52: content = function() bsw/jbe@52: ui.field.text{ label = _"Name", value = policy.name } bsw/jbe@52: bsw/jbe@52: ui.field.text{ label = _"New", value = "≤ " .. policy.admission_time } bsw/jbe@52: ui.field.text{ label = _"Discussion", value = policy.discussion_time } bsw/jbe@52: ui.field.text{ label = _"Frozen", value = policy.verification_time } bsw/jbe@52: ui.field.text{ label = _"Voting", value = policy.voting_time } bsw/jbe@52: bsw/jbe@52: ui.field.text{ bsw/jbe@52: label = _"Issue quorum", bsw/jbe@52: value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den) bsw/jbe@52: } bsw/jbe@52: ui.field.text{ bsw/jbe@52: label = _"Initiative quorum", bsw/jbe@52: value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den) bsw/jbe@52: } bsw/jbe@52: ui.field.text{ bsw@286: label = _"Direct majority", bsw@286: value = bsw@286: (policy.direct_majority_strict and ">" or "≥" ) .. " " bsw@286: .. tostring(policy.direct_majority_num) .. "/" bsw@286: .. tostring(policy.direct_majority_den) bsw@286: .. (policy.direct_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.direct_majority_positive }) or "") bsw@286: .. (policy.direct_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.direct_majority_non_negative }) or "") bsw/jbe@52: } bsw/jbe@52: bsw@286: ui.field.text{ bsw@286: label = _"Indirect majority", bsw@286: value = bsw@286: (policy.indirect_majority_strict and ">" or "≥" ) .. " " bsw@286: .. tostring(policy.indirect_majority_num) .. "/" bsw@286: .. tostring(policy.indirect_majority_den) bsw@286: .. (policy.indirect_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.indirect_majority_positive }) or "") bsw@286: .. (policy.indirect_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.indirect_majority_non_negative }) or "") bsw@286: } bsw@286: bsw@286: local texts = {} bsw@286: if policy.no_reverse_beat_path then bsw@286: texts[#texts+1] = _"no reverse beat path to status quo (including ties)" bsw@286: end bsw@286: if policy.no_multistage_majority then bsw@286: texts[#texts+1] = _"prohibit potentially instable results caused by multistage majorities" bsw@286: end bsw@286: ui.field.text{ bsw@286: label = _"Options", bsw@286: value = table.concat(texts, ", ") bsw@286: } bsw/jbe@52: ui.container{ bsw/jbe@52: attr = { class = "suggestion_content wiki" }, bsw/jbe@52: content = function() bsw/jbe@52: ui.tag{ bsw/jbe@52: tag = "p", bsw/jbe@52: content = policy.description bsw/jbe@52: } bsw/jbe@52: end bsw/jbe@52: } bsw/jbe@52: bsw/jbe@52: end bsw/jbe@52: }