liquid_feedback_frontend
view app/main/admin/policy_list.lua @ 336:4cdf615ff358
Correctly interpret initiative.winner when showing approved information in initiative view (fix)
| author | bsw | 
|---|---|
| date | Tue Feb 28 18:47:00 2012 +0100 (2012-02-28) | 
| parents | c0292c3a70d8 | 
| children | b5684668ac4b | 
 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 slot.put_into("title", _"Policy list")
     9 slot.select("actions", function()
    11   if show_not_in_use then
    12     ui.link{
    13       attr = { class = { "admin_only" } },
    14       text = _"Show policies in use",
    15       module = "admin",
    16       view = "policy_list"
    17     }
    19   else
    20     ui.link{
    21       attr = { class = { "admin_only" } },
    22       text = _"Create new policy",
    23       module = "admin",
    24       view = "policy_show"
    25     }
    26     ui.link{
    27       attr = { class = { "admin_only" } },
    28       text = _"Show policies not in use",
    29       module = "admin",
    30       view = "policy_list",
    31       params = { show_not_in_use = true }
    32     }
    34   end
    36 end)
    39 ui.list{
    40   records = policies,
    41   columns = {
    43     { label = _"Policy", name = "name" },
    45     { content = function(record)
    46         ui.link{
    47           attr = { class = { "action admin_only" } },
    48           text = _"Edit",
    49           module = "admin",
    50           view = "policy_show",
    51           id = record.id
    52         }
    53       end
    54     }
    56   }
    57 }
