liquid_feedback_frontend
diff app/main/policy/list.lua @ 1045:701a5cf6b067
Imported LiquidFeedback Frontend 3.0 branch
author | bsw |
---|---|
date | Thu Jul 10 01:19:48 2014 +0200 (2014-07-10) |
parents | eb16d41929bd |
children |
line diff
1.1 --- a/app/main/policy/list.lua Thu Jul 10 01:02:43 2014 +0200 1.2 +++ b/app/main/policy/list.lua Thu Jul 10 01:19:48 2014 +0200 1.3 @@ -1,73 +1,3 @@ 1.4 ui.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.link{ 1.20 - module = "policy", view = "show", id = policy.id, 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 - if policy.polling then 1.40 - ui.field.text{ label = _"New" .. ":", value = _"without" } 1.41 - else 1.42 - ui.field.text{ label = _"New" .. ":", value = "≤ " .. policy.admission_time } 1.43 - end 1.44 - ui.field.text{ label = _"Discussion" .. ":", value = policy.discussion_time or _"variable" } 1.45 - ui.field.text{ label = _"Frozen" .. ":", value = policy.verification_time or _"variable" } 1.46 - ui.field.text{ label = _"Voting" .. ":", value = policy.voting_time or _"variable" } 1.47 - end 1.48 - }, 1.49 - { 1.50 - label_attr = { width = "200" }, 1.51 - label = _"Quorum", 1.52 - content = function(policy) 1.53 - if policy.polling then 1.54 - ui.field.text{ label = _"Issue quorum" .. ":", value = _"without" } 1.55 - else 1.56 - ui.field.text{ 1.57 - label = _"Issue quorum" .. ":", 1.58 - value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den) 1.59 - } 1.60 - end 1.61 - ui.field.text{ 1.62 - label = _"Initiative quorum" .. ":", 1.63 - value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den) 1.64 - } 1.65 - ui.field.text{ 1.66 - label = _"Direct majority" .. ":", 1.67 - value = (policy.direct_majority_strict and ">" or "≥" ) .. " " .. tostring(policy.direct_majority_num) .. "/" .. tostring(policy.direct_majority_den) 1.68 - } 1.69 - ui.field.text{ 1.70 - label = _"Indirect majority" .. ":", 1.71 - value = (policy.indirect_majority_strict and ">" or "≥" ) .. " " .. tostring(policy.indirect_majority_num) .. "/" .. tostring(policy.indirect_majority_den) 1.72 - } 1.73 - end 1.74 - }, 1.75 - } 1.76 -} 1.77 \ No newline at end of file 1.78 +execute.view { module = "policy", view = "_list" } 1.79 \ No newline at end of file