liquid_feedback_frontend

diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/unit/list.lua	Tue Feb 07 17:54:00 2012 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +local units = Unit:get_flattened_tree{ active = true }
     1.5 +
     1.6 +slot.put_into("title", encode.html(config.app_title))
     1.7 +
     1.8 +if not app.session.member_id and config.motd_public then
     1.9 +  local help_text = config.motd_public
    1.10 +  ui.container{
    1.11 +    attr = { class = "wiki motd" },
    1.12 +    content = function()
    1.13 +      slot.put(format.wiki_text(help_text))
    1.14 +    end
    1.15 +  }
    1.16 +end
    1.17 +
    1.18 +util.help("unit.list", _"Unit list")
    1.19 +
    1.20 +ui.list{
    1.21 +  records = units,
    1.22 +  columns = {
    1.23 +    {
    1.24 +      label = "name",
    1.25 +      content = function(unit)
    1.26 +        ui.link{ text = unit.name, module = "area", view = "list", params = { unit_id = unit.id } }
    1.27 +      end 
    1.28 +    }
    1.29 +  }
    1.30 +}
    1.31 \ No newline at end of file

Impressum / About Us