liquid_feedback_frontend
annotate app/main/unit/list.lua @ 262:7ef1e03e4057
Added unit chooser and unit support to area list
| author | bsw | 
|---|---|
| date | Tue Feb 07 17:54:00 2012 +0100 (2012-02-07) | 
| parents | |
| children | 7196685f9dd7 | 
| rev | line source | 
|---|---|
| bsw@262 | 1 local units = Unit:get_flattened_tree{ active = true } | 
| bsw@262 | 2 | 
| bsw@262 | 3 slot.put_into("title", encode.html(config.app_title)) | 
| bsw@262 | 4 | 
| bsw@262 | 5 if not app.session.member_id and config.motd_public then | 
| bsw@262 | 6 local help_text = config.motd_public | 
| bsw@262 | 7 ui.container{ | 
| bsw@262 | 8 attr = { class = "wiki motd" }, | 
| bsw@262 | 9 content = function() | 
| bsw@262 | 10 slot.put(format.wiki_text(help_text)) | 
| bsw@262 | 11 end | 
| bsw@262 | 12 } | 
| bsw@262 | 13 end | 
| bsw@262 | 14 | 
| bsw@262 | 15 util.help("unit.list", _"Unit list") | 
| bsw@262 | 16 | 
| bsw@262 | 17 ui.list{ | 
| bsw@262 | 18 records = units, | 
| bsw@262 | 19 columns = { | 
| bsw@262 | 20 { | 
| bsw@262 | 21 label = "name", | 
| bsw@262 | 22 content = function(unit) | 
| bsw@262 | 23 ui.link{ text = unit.name, module = "area", view = "list", params = { unit_id = unit.id } } | 
| bsw@262 | 24 end | 
| bsw@262 | 25 } | 
| bsw@262 | 26 } | 
| bsw@262 | 27 } |