webmcp

view demo-app/app/main/user/index.lua @ 11:d76a8857ba62

Added ui.partial and other functions, which allow partial content replacement using XMLHttpRequests; Image support for ui.link

Also includes following changes:
- Fix for rocketcgi library to accept POST data content-types, which contain additional charset information.
- Support arrays passed as params to encode.url (only for keys ending with "[]")
- Version information changed to "1.0.7"

Documentation for added functions is not yet complete.
author jbe/bsw
date Fri Feb 12 18:40:22 2010 +0100 (2010-02-12)
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