webmcp
view demo-app/app/main/user/index.lua @ 4:5e32ef998acf
Version 1.0.4
ui.link{...} with POST target can now be parameterized with BOTH content and text to allow HTML content for JavaScript browsers and a text-only version for accessiblity
Changes related to database selectors:
- Support for row-based locking
- New method :count(), caching and returning the number of rows, which WOULD have been returned by :exec()
- Bugfix: WHERE and HAVING expressions are now enclosed in parenthesis to avoid problems with operator precedence
ui.script{...} now supports external .js files
Changes in langtool.lua to cope with escaped new-line chars (\n)
ui.link{...} with POST target can now be parameterized with BOTH content and text to allow HTML content for JavaScript browsers and a text-only version for accessiblity
Changes related to database selectors:
- Support for row-based locking
- New method :count(), caching and returning the number of rows, which WOULD have been returned by :exec()
- Bugfix: WHERE and HAVING expressions are now enclosed in parenthesis to avoid problems with operator precedence
ui.script{...} now supports external .js files
Changes in langtool.lua to cope with escaped new-line chars (\n)
| author | jbe/bsw |
|---|---|
| date | Fri Dec 25 12:00:00 2009 +0100 (2009-12-25) |
| 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)
