liquid_feedback_frontend
annotate env/ui/tabs.lua @ 8:374bbc2ff102
Version beta4
Bug fixed, which made it impossible to explicitly become interested in a topic
Fixed positioning of dialog for entering a new suggestion
Display of 404 pages
Bug fixed, which made it impossible to explicitly become interested in a topic
Fixed positioning of dialog for entering a new suggestion
Display of 404 pages
author | bsw |
---|---|
date | Sat Jan 02 12:00:00 2010 +0100 (2010-01-02) |
parents | 80c215dbf076 |
children | 00d1004545f1 |
rev | line source |
---|---|
bsw/jbe@0 | 1 function ui.tabs(tabs) |
bsw/jbe@0 | 2 ui.container{ |
bsw/jbe@0 | 3 attr = { class = "ui_tabs" }, |
bsw/jbe@0 | 4 content = function() |
bsw/jbe@0 | 5 local params = param.get_all_cgi() |
bsw/jbe@0 | 6 local current_tab = params["tab"] |
bsw/jbe@0 | 7 ui.container{ |
bsw/jbe@0 | 8 attr = { class = "ui_tabs_links" }, |
bsw/jbe@0 | 9 content = function() |
bsw/jbe@0 | 10 for i, tab in ipairs(tabs) do |
bsw/jbe@0 | 11 params["tab"] = i > 1 and tab.name or nil |
bsw/jbe@0 | 12 ui.link{ |
bsw/jbe@0 | 13 attr = { |
bsw/jbe@0 | 14 class = ( |
bsw/jbe@0 | 15 tab.name == current_tab and "selected" or |
bsw/jbe@0 | 16 not current_tab and i == 1 and "selected" or |
bsw/jbe@0 | 17 "" |
bsw/jbe@0 | 18 ) |
bsw/jbe@0 | 19 }, |
bsw/jbe@0 | 20 module = request.get_module(), |
bsw/jbe@0 | 21 view = request.get_view(), |
bsw/jbe@0 | 22 id = param.get_id_cgi(), |
bsw/jbe@0 | 23 text = tab.label, |
bsw/jbe@0 | 24 params = params |
bsw/jbe@0 | 25 } |
bsw/jbe@4 | 26 slot.put(" ") |
bsw/jbe@0 | 27 end |
bsw/jbe@0 | 28 end |
bsw/jbe@0 | 29 } |
bsw/jbe@0 | 30 for i, tab in ipairs(tabs) do |
bsw/jbe@0 | 31 if tab.name == current_tab or not current_tab and i == 1 then |
bsw/jbe@0 | 32 ui.container{ |
bsw/jbe@0 | 33 attr = { class = "ui_tabs_content" }, |
bsw/jbe@0 | 34 content = tab.content |
bsw/jbe@0 | 35 } |
bsw/jbe@0 | 36 end |
bsw/jbe@0 | 37 end |
bsw/jbe@0 | 38 end |
bsw/jbe@0 | 39 } |
bsw/jbe@0 | 40 end |
bsw/jbe@0 | 41 |