webmcp
annotate 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.
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 |
| rev | line source |
|---|---|
| jbe/bsw@0 | 1 slot.put_into("title", encode.html(_"Users")) |
| jbe/bsw@0 | 2 |
| jbe/bsw@0 | 3 slot.select("actions", function() |
| jbe/bsw@0 | 4 ui.link{ |
| jbe/bsw@0 | 5 content = _"Create new user", |
| jbe/bsw@0 | 6 module = "user", |
| jbe/bsw@0 | 7 view = "show" |
| jbe/bsw@0 | 8 } |
| jbe/bsw@0 | 9 end) |
| jbe/bsw@0 | 10 |
| jbe/bsw@0 | 11 |
| jbe/bsw@0 | 12 local selector = User:new_selector():add_order_by('"ident", "id"') |
| jbe/bsw@0 | 13 |
| jbe/bsw@0 | 14 slot.select("main", function() |
| jbe/bsw@0 | 15 ui.paginate{ |
| jbe/bsw@0 | 16 selector = selector, |
| jbe/bsw@0 | 17 content = function() |
| jbe/bsw@0 | 18 ui.list{ |
| jbe/bsw@0 | 19 records = selector:exec(), |
| jbe/bsw@0 | 20 columns = { |
| jbe/bsw@0 | 21 { |
| jbe/bsw@0 | 22 field_attr = { style = "float: right;" }, |
| jbe/bsw@0 | 23 label = _"Id", |
| jbe/bsw@0 | 24 name = "id" |
| jbe/bsw@0 | 25 }, |
| jbe/bsw@0 | 26 { |
| jbe/bsw@0 | 27 label = _"Ident", |
| jbe/bsw@0 | 28 name = "ident" |
| jbe/bsw@0 | 29 }, |
| jbe/bsw@0 | 30 { |
| jbe/bsw@0 | 31 label = _"Name", |
| jbe/bsw@0 | 32 name = "name" |
| jbe/bsw@0 | 33 }, |
| jbe/bsw@0 | 34 { |
| jbe/bsw@0 | 35 label = _"w", |
| jbe/bsw@0 | 36 name = "write_priv" |
| jbe/bsw@0 | 37 }, |
| jbe/bsw@0 | 38 { |
| jbe/bsw@0 | 39 label = _"Admin", |
| jbe/bsw@0 | 40 name = "admin" |
| jbe/bsw@0 | 41 }, |
| jbe/bsw@0 | 42 { |
| jbe/bsw@0 | 43 content = function(record) |
| jbe/bsw@0 | 44 ui.link{ |
| jbe/bsw@0 | 45 content = _"Show", |
| jbe/bsw@0 | 46 module = "user", |
| jbe/bsw@0 | 47 view = "show", |
| jbe/bsw@0 | 48 id = record.id |
| jbe/bsw@0 | 49 } |
| jbe/bsw@0 | 50 end |
| jbe/bsw@0 | 51 }, |
| jbe/bsw@0 | 52 } |
| jbe/bsw@0 | 53 } |
| jbe/bsw@0 | 54 end |
| jbe/bsw@0 | 55 } |
| jbe/bsw@0 | 56 end) |