liquid_feedback_frontend

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

Impressum / About Us