liquid_feedback_frontend
diff app/main/policy/list.lua @ 52:88ac7798b562
Several bugfixes (getpic.c, accepted but canceled issues, ...); Listing of available policies
- Bugfixes in fastpath/getpic.c (related to crashes since alpha5)
- Respect Content-Types of images in database
(needs database update, as Content-Type was incorrectly stored by previous versions)
- Typo fixed in help messages
- RSS-Feed (currently only after manual authentication while session is valid)
- Listing of available policies
- German translation fixed: "gebe" -> "gib" (Imperativ)
- Bugfixes related to issues which had been accepted but canceled afterwards
- Prohibit creation of initiatives in disabled areas or with disabled policies
- Bugfixes in fastpath/getpic.c (related to crashes since alpha5)
- Respect Content-Types of images in database
(needs database update, as Content-Type was incorrectly stored by previous versions)
- Typo fixed in help messages
- RSS-Feed (currently only after manual authentication while session is valid)
- Listing of available policies
- German translation fixed: "gebe" -> "gib" (Imperativ)
- Bugfixes related to issues which had been accepted but canceled afterwards
- Prohibit creation of initiatives in disabled areas or with disabled policies
author | bsw/jbe |
---|---|
date | Thu Apr 15 19:58:25 2010 +0200 (2010-04-15) |
parents | |
children | a34c8c5a4853 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/policy/list.lua Thu Apr 15 19:58:25 2010 +0200 1.3 @@ -0,0 +1,61 @@ 1.4 +slot.put_into("title", _"Policies") 1.5 + 1.6 +util.help("policy.list", _"Policies") 1.7 +local policies = Policy:new_selector() 1.8 + :add_where("active") 1.9 + :add_order_by("index") 1.10 + :exec() 1.11 + 1.12 +ui.list{ 1.13 + records = policies, 1.14 + columns = { 1.15 + { 1.16 + label_attr = { width = "500" }, 1.17 + label = _"Policy", 1.18 + content = function(policy) 1.19 + ui.tag{ 1.20 + tag = "div", 1.21 + attr = { style = "font-weight: bold" }, 1.22 + content = function() 1.23 + slot.put(encode.html(policy.name)) 1.24 + if not policy.active then 1.25 + slot.put(" (", _"disabled", ")") 1.26 + end 1.27 + end 1.28 + } 1.29 + ui.tag{ 1.30 + tag = "div", 1.31 + content = policy.description 1.32 + } 1.33 + end 1.34 + }, 1.35 + { 1.36 + label_attr = { width = "200" }, 1.37 + label = _"Phases", 1.38 + content = function(policy) 1.39 + ui.field.text{ label = _"New" .. ":", value = "≤ " .. policy.admission_time } 1.40 + ui.field.text{ label = _"Discussion" .. ":", value = policy.discussion_time } 1.41 + ui.field.text{ label = _"Frozen" .. ":", value = policy.verification_time } 1.42 + ui.field.text{ label = _"Voting" .. ":", value = policy.voting_time } 1.43 + end 1.44 + }, 1.45 + { 1.46 + label_attr = { width = "200" }, 1.47 + label = _"Quorum", 1.48 + content = function(policy) 1.49 + ui.field.text{ 1.50 + label = _"Issue quorum" .. ":", 1.51 + value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den) 1.52 + } 1.53 + ui.field.text{ 1.54 + label = _"Initiative quorum" .. ":", 1.55 + value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den) 1.56 + } 1.57 + ui.field.text{ 1.58 + label = _"Majority" .. ":", 1.59 + value = (policy.majority_strict and ">" or "≥" ) .. " " .. tostring(policy.majority_num) .. "/" .. tostring(policy.majority_den) 1.60 + } 1.61 + end 1.62 + }, 1.63 + } 1.64 +} 1.65 \ No newline at end of file