webmcp

view demo-app/app/main/user/index.lua @ 567:5e3ebe9fd0ce

Added tag v2.2.1 for changeset 3b71fdb3a00d
author jbe
date Wed Apr 28 13:07:52 2021 +0200 (7 months ago)
parents 9fdfb27f8e67
children
line source
1 slot.put_into("title", encode.html(_"Users"))
3 slot.select("actions", function()
4 ui.link{
5 content = _"Create new user",
6 module = "user",
7 view = "show"
8 }
9 end)
12 local selector = User:new_selector():add_order_by('"ident", "id"')
14 slot.select("main", function()
15 ui.paginate{
16 selector = selector,
17 content = function()
18 ui.list{
19 records = selector:exec(),
20 columns = {
21 {
22 field_attr = { style = "float: right;" },
23 label = _"Id",
24 name = "id"
25 },
26 {
27 label = _"Ident",
28 name = "ident"
29 },
30 {
31 label = _"Name",
32 name = "name"
33 },
34 {
35 label = _"w",
36 name = "write_priv"
37 },
38 {
39 label = _"Admin",
40 name = "admin"
41 },
42 {
43 content = function(record)
44 ui.link{
45 content = _"Show",
46 module = "user",
47 view = "show",
48 id = record.id
49 }
50 end
51 },
52 }
53 }
54 end
55 }
56 end)

Impressum / About Us