webmcp

view demo-app/app/main/medium/index.lua @ 23:3a6fe8663b26

Code cleanup and documentation added; Year in copyright notice changed to 2009-2010

Details:
- Changed quoting style in auth.openid.xrds_document{...}
- Fixed documentation for auth.openid.initiate{...}
- Added documentation for mondelefant
- Code-cleanup in mondelefant:
-- removed unneccessary lines "rows = PQntuples(res); cols = PQnfields(res);"
-- avoided extra copy of first argument (self) in mondelefant_conn_query
-- no rawget in meta-method "__index" of database result lists and objects
-- removed unreachable "return 0;" in meta-method "__newindex" of database result lists and objects
- Year in copyright notice changed to 2009-2010
- Version string changed to "1.1.1"
author jbe
date Fri Jun 04 19:00:34 2010 +0200 (2010-06-04)
parents 9fdfb27f8e67
children
line source
1 slot.put_into("title", encode.html(_"Media"))
3 slot.select("actions", function()
4 if app.session.user.write_priv then
5 ui.link{
6 content = _"Create new medium",
7 module = "medium",
8 view = "show"
9 }
10 end
11 end)
14 local selector = Medium:new_selector():add_order_by('"name", "id"')
16 slot.select("main", function()
17 ui.paginate{
18 selector = selector,
19 content = function()
20 ui.list{
21 records = selector:exec(),
22 columns = {
23 {
24 field_attr = { style = "float: right;" },
25 label = _"Id",
26 name = "id"
27 },
28 {
29 label = _"Name",
30 name = "name"
31 },
32 {
33 label = _"Copy protected",
34 name = "copyprotected"
35 },
36 {
37 content = function(record)
38 ui.link{
39 content = _"Show",
40 module = "medium",
41 view = "show",
42 id = record.id
43 }
44 end
45 },
46 }
47 }
48 end
49 }
50 end)

Impressum / About Us