liquid_feedback_frontend
annotate env/ui/order.lua @ 5:afd9f769c7ae
Version beta1
Final voting with Schulze-Method is now possible
Many bug fixes and code cleanup
Registration with invite codes
More sort and filter options
Seperated display of "supporters" and "potential supporters"
Optical changes
Flood limit / initiative contigent is now checked by frontend
Neccessary changes to access core beta11
Final voting with Schulze-Method is now possible
Many bug fixes and code cleanup
Registration with invite codes
More sort and filter options
Seperated display of "supporters" and "potential supporters"
Optical changes
Flood limit / initiative contigent is now checked by frontend
Neccessary changes to access core beta11
author | bsw/jbe |
---|---|
date | Fri Dec 25 12:00:00 2009 +0100 (2009-12-25) |
parents | 3bfb2fcf7ab9 |
children |
rev | line source |
---|---|
bsw/jbe@0 | 1 function ui.order(args) |
bsw/jbe@0 | 2 local name = args.name or "order" |
bsw/jbe@0 | 3 local current_order = atom.string:load(cgi.params[name]) or args.options[1].name |
bsw/jbe@0 | 4 local id = param.get_id_cgi() |
bsw/jbe@0 | 5 local params = param.get_all_cgi() |
bsw/jbe@0 | 6 ui.container{ |
bsw/jbe@0 | 7 attr = { class = "ui_order" }, |
bsw/jbe@0 | 8 content = function() |
bsw/jbe@0 | 9 ui.container{ |
bsw/jbe@0 | 10 attr = { class = "ui_order_head" }, |
bsw/jbe@0 | 11 content = function() |
bsw/jbe@0 | 12 slot.put(_"Order by") |
bsw/jbe@0 | 13 slot.put(": ") |
bsw/jbe@0 | 14 for i, option in ipairs(args.options) do |
bsw/jbe@0 | 15 params[name] = option.name |
bsw/jbe@0 | 16 local attr = {} |
bsw/jbe@0 | 17 if current_order == option.name then |
bsw/jbe@0 | 18 attr.class = "active" |
bsw/jbe@5 | 19 if option.selector_modifier then |
bsw/jbe@5 | 20 option.selector_modifier(args.selector) |
bsw/jbe@5 | 21 else |
bsw/jbe@5 | 22 args.selector:add_order_by(option.order_by) |
bsw/jbe@5 | 23 end |
bsw/jbe@0 | 24 end |
bsw/jbe@0 | 25 ui.link{ |
bsw/jbe@0 | 26 attr = attr, |
bsw/jbe@0 | 27 module = request.get_module(), |
bsw/jbe@0 | 28 view = request.get_view(), |
bsw/jbe@0 | 29 id = id, |
bsw/jbe@0 | 30 params = params, |
bsw/jbe@0 | 31 content = option.label |
bsw/jbe@0 | 32 } |
bsw/jbe@0 | 33 end |
bsw/jbe@0 | 34 end |
bsw/jbe@0 | 35 } |
bsw/jbe@0 | 36 ui.container{ |
bsw/jbe@0 | 37 attr = { class = "ui_order_content" }, |
bsw/jbe@0 | 38 content = function() |
bsw/jbe@0 | 39 args.content() |
bsw/jbe@0 | 40 end |
bsw/jbe@0 | 41 } |
bsw/jbe@0 | 42 end |
bsw/jbe@0 | 43 } |
bsw/jbe@0 | 44 end |