liquid_feedback_frontend

view app/main/index/index.lua @ 1145:904f6807f7fa

Added support for upcoming moonbridge bases WebMCP
author bsw
date Sat Mar 21 15:26:39 2015 +0100 (2015-03-21)
parents 701a5cf6b067
children 8288027edb54
line source
1 local function getIssuesSelector()
2 return Issue:new_selector()
3 :add_order_by([[
4 coalesce(
5 issue.fully_frozen + issue.voting_time,
6 issue.half_frozen + issue.verification_time,
7 issue.accepted + issue.discussion_time,
8 issue.created + issue.admission_time
9 ) - now()
10 ]])
11 end
13 --[[
14 ui.title( function ()
15 ui.link { attr = { class = "home" }, module = "index", view = "index", text = _"Home" }
16 end)
17 --]]
19 ui.title()
21 if false then
22 slot.select ( "tabs", function ()
24 ui.tag {
25 attr = { onclick = "showTab(0);" },
26 content = "units",
27 }
28 slot.put ( " " )
29 ui.tag {
30 attr = { onclick = "showTab(1);" },
31 content = "timeline"
32 }
33 slot.put ( " " )
34 ui.tag {
35 attr = { onclick = "showTab(2);" },
36 content = "what"
37 }
38 slot.put ( " " )
39 ui.tag {
40 attr = { onclick = "showTab(3);" },
41 content = "members"
42 }
44 end )
46 ui.script { script = [[
48 var tabs = ["tab1", "main", "tab2", "tab3"]
49 var currentId;
51 function showTab(id) {
52 var tabId = tabs[id];
53 $('.tab').hide();
54 $('.main').hide();
55 $('.' + tabId).show();
56 currentId = id;
57 };
59 showTab(0);
61 $(function(){
62 // Bind the swipeHandler callback function to the swipe event on div.box
63 $( "body" ).on( "swiperight", function swipeHandler( event ) {
64 newId = currentId - 1;
65 if (newId < 0) return;
66 showTab(newId);
67 } )
68 $( "body" ).on( "swipeleft", function swipeHandler( event ) {
69 newId = currentId + 1;
70 if (newId > tabs.length - 1) return;
71 showTab(newId);
72 } )
73 });
75 ]]}
76 end
79 if app.session.member then
80 execute.view{ module = "index", view = "_sidebar_motd_intern" }
81 else
82 execute.view{ module = "index", view = "_sidebar_motd_public" }
83 end
85 if app.session:has_access("anonymous") then
86 -- show the units the member has voting privileges for
87 execute.view {
88 module = "index", view = "_sidebar_units", params = {
89 member = app.session.member
90 }
91 }
92 end
94 -- show the user what can be done
95 execute.view { module = "index", view = "_sidebar_whatcanido" }
97 -- show active members
98 if app.session:has_access("all_pseudonymous") then
99 execute.view{ module = "index", view = "_sidebar_members" }
100 end
102 if app.session:has_access("anonymous") then
104 if not app.session.member then
105 -- execute.view {
106 -- module = "slideshow", view = "_index"
107 -- }
108 end
110 execute.view {
111 module = "issue", view = "_list2", params = { }
112 }
114 end -- if app.session:has_access "anonymous"

Impressum / About Us