liquid_feedback_frontend
view app/main/admin/policy_list.lua @ 1482:7cdc537f991f
Show correct quorum in initiative not admitted info
| author | bsw | 
|---|---|
| date | Wed Oct 24 14:49:56 2018 +0200 (2018-10-24) | 
| parents | 6929d3ced007 | 
| children | 
 line source
     1 local show_not_in_use = param.get("show_not_in_use", atom.boolean) or false
     3 local policies = Policy:build_selector{ active = not show_not_in_use }:exec()
     6 ui.titleAdmin(_"Policy list")
     8 ui.grid{ content = function()
    10   ui.cell_main{ content = function()
    11     ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
    12       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    13         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Policy list" }
    14       end }
    15       ui.container{ attr = { class = "mdl-card__content" }, content = function()
    17         if show_not_in_use then
    18           ui.link{
    19             text = _"Show policies in use",
    20             module = "admin",
    21             view = "policy_list"
    22           }
    24         else
    25           ui.link{
    26             text = _"Create new policy",
    27             module = "admin",
    28             view = "policy_show"
    29           }
    30           slot.put(" · ")
    31           ui.link{
    32             text = _"Show policies not in use",
    33             module = "admin",
    34             view = "policy_list",
    35             params = { show_not_in_use = true }
    36           }
    38         end
    40         ui.list{
    41           records = policies,
    42           columns = {
    44             { content = function(record)
    45                 ui.link{
    46                   text = record.name,
    47                   module = "admin",
    48                   view = "policy_show",
    49                   id = record.id
    50                 }
    51               end
    52             }
    54           }
    55         }
    56       end }
    57     end }
    58   end }
    59 end }
