liquid_feedback_frontend
view env/ui/tabs.lua @ 2:5c601807d397
Version alpha3
Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft
Wiki formatting for drafts
Showing differences between two drafts of the same initiative
Display of outgoing delegation chains
Many other improvements
Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft
Wiki formatting for drafts
Showing differences between two drafts of the same initiative
Display of outgoing delegation chains
Many other improvements
| author | bsw |
|---|---|
| date | Mon Nov 23 12:00:00 2009 +0100 (2009-11-23) |
| parents | 3bfb2fcf7ab9 |
| children | 80c215dbf076 |
line source
1 function ui.tabs(tabs)
2 ui.container{
3 attr = { class = "ui_tabs" },
4 content = function()
5 local params = param.get_all_cgi()
6 local current_tab = params["tab"]
7 ui.container{
8 attr = { class = "ui_tabs_links" },
9 content = function()
10 for i, tab in ipairs(tabs) do
11 params["tab"] = i > 1 and tab.name or nil
12 ui.link{
13 attr = {
14 class = (
15 tab.name == current_tab and "selected" or
16 not current_tab and i == 1 and "selected" or
17 ""
18 )
19 },
20 module = request.get_module(),
21 view = request.get_view(),
22 id = param.get_id_cgi(),
23 text = tab.label,
24 params = params
25 }
26 end
27 end
28 }
29 for i, tab in ipairs(tabs) do
30 if tab.name == current_tab or not current_tab and i == 1 then
31 ui.container{
32 attr = { class = "ui_tabs_content" },
33 content = tab.content
34 }
35 end
36 end
37 end
38 }
39 end
