annotate app/main/admin/policy_list.lua @ 1316:186a172c8b9e
Allow forced manual verification w/o sms check
author |
bsw |
date |
Wed Aug 01 17:46:20 2018 +0200 (2018-08-01) |
parents |
701a5cf6b067 |
children |
6929d3ced007 |
rev |
line source |
bsw@194
|
1 local show_not_in_use = param.get("show_not_in_use", atom.boolean) or false
|
bsw@194
|
2
|
bsw@194
|
3 local policies = Policy:build_selector{ active = not show_not_in_use }:exec()
|
bsw@194
|
4
|
bsw@194
|
5
|
bsw@1045
|
6 ui.titleAdmin(_"Policy list")
|
bsw@194
|
7
|
bsw@1045
|
8 ui.section( function()
|
bsw@1045
|
9 ui.sectionHead( function()
|
bsw@1045
|
10 ui.heading { level = 1, content = _"Policy list" }
|
bsw@1045
|
11 end )
|
bsw@1045
|
12
|
bsw@1045
|
13 ui.sectionRow( function()
|
bsw@194
|
14
|
bsw@1045
|
15 if show_not_in_use then
|
bsw@1045
|
16 ui.link{
|
bsw@1045
|
17 text = _"Show policies in use",
|
bsw@1045
|
18 module = "admin",
|
bsw@1045
|
19 view = "policy_list"
|
bsw@1045
|
20 }
|
bsw@194
|
21
|
bsw@1045
|
22 else
|
bsw@1045
|
23 ui.link{
|
bsw@1045
|
24 text = _"Create new policy",
|
bsw@1045
|
25 module = "admin",
|
bsw@1045
|
26 view = "policy_show"
|
bsw@1045
|
27 }
|
bsw@1045
|
28 slot.put(" · ")
|
bsw@1045
|
29 ui.link{
|
bsw@1045
|
30 text = _"Show policies not in use",
|
bsw@1045
|
31 module = "admin",
|
bsw@1045
|
32 view = "policy_list",
|
bsw@1045
|
33 params = { show_not_in_use = true }
|
bsw@1045
|
34 }
|
bsw@1045
|
35
|
bsw@1045
|
36 end
|
bsw@1045
|
37
|
bsw@1045
|
38 end )
|
bsw@1045
|
39
|
bsw@1045
|
40 ui.sectionRow( function()
|
bsw@1045
|
41
|
bsw@1045
|
42 ui.list{
|
bsw@1045
|
43 records = policies,
|
bsw@1045
|
44 columns = {
|
bsw@1045
|
45
|
bsw@1045
|
46 { content = function(record)
|
bsw@1045
|
47 ui.link{
|
bsw@1045
|
48 text = record.name,
|
bsw@1045
|
49 module = "admin",
|
bsw@1045
|
50 view = "policy_show",
|
bsw@1045
|
51 id = record.id
|
bsw@1045
|
52 }
|
bsw@1045
|
53 end
|
bsw@1045
|
54 }
|
bsw@1045
|
55
|
bsw@1045
|
56 }
|
bsw@194
|
57 }
|
bsw@194
|
58
|
bsw@1045
|
59 end )
|
bsw@1045
|
60 end ) |