webmcp
diff demo-app/app/main/user/index.lua @ 0:9fdfb27f8e67
Version 1.0.0
author | jbe/bsw |
---|---|
date | Sun Oct 25 12:00:00 2009 +0100 (2009-10-25) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/demo-app/app/main/user/index.lua Sun Oct 25 12:00:00 2009 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +slot.put_into("title", encode.html(_"Users")) 1.5 + 1.6 +slot.select("actions", function() 1.7 + ui.link{ 1.8 + content = _"Create new user", 1.9 + module = "user", 1.10 + view = "show" 1.11 + } 1.12 +end) 1.13 + 1.14 + 1.15 +local selector = User:new_selector():add_order_by('"ident", "id"') 1.16 + 1.17 +slot.select("main", function() 1.18 + ui.paginate{ 1.19 + selector = selector, 1.20 + content = function() 1.21 + ui.list{ 1.22 + records = selector:exec(), 1.23 + columns = { 1.24 + { 1.25 + field_attr = { style = "float: right;" }, 1.26 + label = _"Id", 1.27 + name = "id" 1.28 + }, 1.29 + { 1.30 + label = _"Ident", 1.31 + name = "ident" 1.32 + }, 1.33 + { 1.34 + label = _"Name", 1.35 + name = "name" 1.36 + }, 1.37 + { 1.38 + label = _"w", 1.39 + name = "write_priv" 1.40 + }, 1.41 + { 1.42 + label = _"Admin", 1.43 + name = "admin" 1.44 + }, 1.45 + { 1.46 + content = function(record) 1.47 + ui.link{ 1.48 + content = _"Show", 1.49 + module = "user", 1.50 + view = "show", 1.51 + id = record.id 1.52 + } 1.53 + end 1.54 + }, 1.55 + } 1.56 + } 1.57 + end 1.58 + } 1.59 +end) 1.60 \ No newline at end of file