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@900: if policy.polling then bsw@900: ui.field.text{ label = _"New" .. ":", value = _"without" } bsw@900: else bsw@900: ui.field.text{ label = _"New" .. ":", value = "≤ " .. policy.admission_time } bsw@900: end bsw@902: ui.field.text{ label = _"Discussion" .. ":", value = policy.discussion_time or _"variable" } bsw@902: ui.field.text{ label = _"Frozen" .. ":", value = policy.verification_time or _"variable" } bsw@902: ui.field.text{ label = _"Voting" .. ":", value = policy.voting_time or _"variable" } bsw@902: bsw@900: if policy.polling then bsw@900: ui.field.text{ label = _"Issue quorum" .. ":", value = _"without" } bsw@900: else bsw@900: ui.field.text{ bsw@900: label = _"Issue quorum", bsw@900: value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den) bsw@900: } bsw@900: end 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@900: if policy.description and #policy.description > 0 then bsw@900: ui.container{ bsw@900: attr = { class = "suggestion_content wiki" }, bsw@900: content = function() bsw@900: ui.tag{ bsw@900: tag = "p", bsw@900: content = policy.description bsw@900: } bsw@900: end bsw@900: } bsw@900: end bsw/jbe@52: bsw/jbe@52: end bsw/jbe@52: }