liquid_feedback_frontend

view 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
author bsw/jbe
date Thu Apr 15 19:58:25 2010 +0200 (2010-04-15)
parents
children a34c8c5a4853
line source
1 slot.put_into("title", _"Policies")
3 util.help("policy.list", _"Policies")
4 local policies = Policy:new_selector()
5 :add_where("active")
6 :add_order_by("index")
7 :exec()
9 ui.list{
10 records = policies,
11 columns = {
12 {
13 label_attr = { width = "500" },
14 label = _"Policy",
15 content = function(policy)
16 ui.tag{
17 tag = "div",
18 attr = { style = "font-weight: bold" },
19 content = function()
20 slot.put(encode.html(policy.name))
21 if not policy.active then
22 slot.put(" (", _"disabled", ")")
23 end
24 end
25 }
26 ui.tag{
27 tag = "div",
28 content = policy.description
29 }
30 end
31 },
32 {
33 label_attr = { width = "200" },
34 label = _"Phases",
35 content = function(policy)
36 ui.field.text{ label = _"New" .. ":", value = "≤ " .. policy.admission_time }
37 ui.field.text{ label = _"Discussion" .. ":", value = policy.discussion_time }
38 ui.field.text{ label = _"Frozen" .. ":", value = policy.verification_time }
39 ui.field.text{ label = _"Voting" .. ":", value = policy.voting_time }
40 end
41 },
42 {
43 label_attr = { width = "200" },
44 label = _"Quorum",
45 content = function(policy)
46 ui.field.text{
47 label = _"Issue quorum" .. ":",
48 value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den)
49 }
50 ui.field.text{
51 label = _"Initiative quorum" .. ":",
52 value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den)
53 }
54 ui.field.text{
55 label = _"Majority" .. ":",
56 value = (policy.majority_strict and ">" or "≥" ) .. " " .. tostring(policy.majority_num) .. "/" .. tostring(policy.majority_den)
57 }
58 end
59 },
60 }
61 }

Impressum / About Us