liquid_feedback_frontend
annotate app/main/report/index.lua @ 127:4fb486bce608
add pageinator to issue view.
this "paginator" shows links to the prev/area/next issues that have the same
state then the current one. This helps a lot when inspecting new issues or voting.
The voting filter works a little bit different, as he also activtes the not_voted subfilter
because it is most likely only not voted issues are interessting to the user
this "paginator" shows links to the prev/area/next issues that have the same
state then the current one. This helps a lot when inspecting new issues or voting.
The voting filter works a little bit different, as he also activtes the not_voted subfilter
because it is most likely only not voted issues are interessting to the user
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Tue Oct 05 04:44:06 2010 +0200 (2010-10-05) |
parents | a851cc1d9903 |
children |
rev | line source |
---|---|
bsw@31 | 1 function link_area(area) |
bsw@31 | 2 ui.link{ |
bsw@31 | 3 external = "", |
bsw@31 | 4 attr = { |
bsw@31 | 5 onclick = |
bsw@31 | 6 "openEl('area_" .. tostring(area.id) .. "');" .. |
bsw@31 | 7 "return(false);" |
bsw@31 | 8 }, |
bsw@31 | 9 content = function() |
bsw@31 | 10 ui.heading{ |
bsw@31 | 11 content = area.name |
bsw@31 | 12 } |
bsw@31 | 13 end |
bsw@31 | 14 } |
bsw@31 | 15 end |
bsw@31 | 16 |
bsw@31 | 17 slot.set_layout("report") |
bsw@31 | 18 |
bsw@34 | 19 slot.put("<br />") |
bsw@34 | 20 |
bsw@34 | 21 ui.container{ |
bsw@31 | 22 attr = { |
bsw@34 | 23 class = "nav", |
bsw@34 | 24 style = "text-align: center;" |
bsw@31 | 25 }, |
bsw@31 | 26 content = function() |
bsw@34 | 27 |
bsw@34 | 28 |
bsw@34 | 29 ui.container{ |
bsw@34 | 30 attr = { |
bsw@34 | 31 class = "left", |
bsw@34 | 32 }, |
bsw@34 | 33 content = function() |
bsw@34 | 34 ui.link{ |
bsw@34 | 35 external = "", |
bsw@34 | 36 attr = { |
bsw@34 | 37 onclick = "undo(); return(false);" |
bsw@34 | 38 }, |
bsw@34 | 39 content = function() |
bsw@34 | 40 ui.image{ static = "icons/16/cancel.png" } |
bsw@34 | 41 slot.put(" ") |
bsw@34 | 42 slot.put(_"Back") |
bsw@34 | 43 end |
bsw@34 | 44 } |
bsw@34 | 45 end |
bsw@31 | 46 } |
bsw@34 | 47 |
bsw@34 | 48 ui.form{ |
bsw@31 | 49 attr = { |
bsw@34 | 50 style = "float: right;", |
bsw@34 | 51 onsubmit = "openElDirect(); return(false);" |
bsw@34 | 52 }, |
bsw@34 | 53 content = function() |
bsw@34 | 54 slot.put("#") |
bsw@34 | 55 ui.tag{ |
bsw@34 | 56 tag = "input", |
bsw@34 | 57 attr = { |
bsw@34 | 58 id = "input_issue", |
bsw@34 | 59 type = "text", |
bsw@34 | 60 style = "width: 4em;" |
bsw@34 | 61 } |
bsw@34 | 62 } |
bsw@34 | 63 slot.put(".") |
bsw@34 | 64 ui.tag{ |
bsw@34 | 65 tag = "input", |
bsw@34 | 66 attr = { |
bsw@34 | 67 id = "input_initiative", |
bsw@34 | 68 type = "text", |
bsw@34 | 69 style = "width: 4em;" |
bsw@34 | 70 } |
bsw@34 | 71 } |
bsw@34 | 72 slot.put(" ") |
bsw@34 | 73 ui.tag{ |
bsw@34 | 74 tag = "input", |
bsw@34 | 75 attr = { |
bsw@34 | 76 type = "submit", |
bsw@34 | 77 value = "OK", |
bsw@34 | 78 } |
bsw@34 | 79 } |
bsw@34 | 80 end |
bsw@34 | 81 } |
bsw@34 | 82 |
bsw@34 | 83 |
bsw@34 | 84 ui.link{ |
bsw@34 | 85 external = "", |
bsw@34 | 86 attr = { |
bsw@34 | 87 onclick = "openPrevIssue(); return(false);" |
bsw@34 | 88 }, |
bsw@34 | 89 content = function() |
bsw@34 | 90 ui.image{ static = "icons/16/resultset_previous_double.png" } |
bsw@34 | 91 slot.put(" ") |
bsw@34 | 92 slot.put(_"Previous issue") |
bsw@34 | 93 end |
bsw@31 | 94 } |
bsw@34 | 95 |
bsw@34 | 96 ui.link{ |
bsw@34 | 97 external = "", |
bsw@34 | 98 attr = { |
bsw@34 | 99 onclick = "openPrevInitiative(); return(false);" |
bsw@34 | 100 }, |
bsw@34 | 101 content = function() |
bsw@34 | 102 ui.image{ static = "icons/16/resultset_previous.png" } |
bsw@34 | 103 slot.put(" ") |
bsw@34 | 104 slot.put(_"Previous initiative") |
bsw@34 | 105 end |
bsw@34 | 106 } |
bsw@34 | 107 |
bsw@34 | 108 ui.link{ |
bsw@34 | 109 external = "", |
bsw@31 | 110 attr = { |
bsw@34 | 111 onclick = "openParent(); return(false);" |
bsw@34 | 112 }, |
bsw@34 | 113 content = function() |
bsw@34 | 114 ui.image{ static = "icons/16/go_up.png" } |
bsw@34 | 115 slot.put(" ") |
bsw@34 | 116 slot.put(_"Go up") |
bsw@34 | 117 end |
bsw@34 | 118 } |
bsw@34 | 119 |
bsw@34 | 120 ui.link{ |
bsw@34 | 121 external = "", |
bsw@34 | 122 attr = { |
bsw@34 | 123 onclick = "openNextInitiative(); return(false);" |
bsw@34 | 124 }, |
bsw@34 | 125 content = function() |
bsw@34 | 126 ui.image{ static = "icons/16/resultset_next.png" } |
bsw@34 | 127 slot.put(" ") |
bsw@34 | 128 slot.put(_"Next initiative") |
bsw@34 | 129 end |
bsw@34 | 130 } |
bsw@34 | 131 |
bsw@34 | 132 ui.link{ |
bsw@34 | 133 external = "", |
bsw@34 | 134 attr = { |
bsw@34 | 135 onclick = "openNextIssue(); return(false);" |
bsw@34 | 136 }, |
bsw@34 | 137 content = function() |
bsw@34 | 138 ui.image{ static = "icons/16/resultset_next_double.png" } |
bsw@34 | 139 slot.put(" ") |
bsw@34 | 140 slot.put(_"Next issue") |
bsw@34 | 141 end |
bsw@31 | 142 } |
bsw@31 | 143 end |
bsw@31 | 144 } |
bsw@31 | 145 |
bsw@34 | 146 slot.put("<br />") |
bsw@31 | 147 |
bsw@34 | 148 local areas = Area:new_selector():add_order_by("name"):exec() |
bsw@31 | 149 |
bsw@31 | 150 |
bsw@31 | 151 ui.container{ |
bsw@31 | 152 attr = { id = "areas" }, |
bsw@31 | 153 content = function() |
bsw@31 | 154 for i, area in ipairs(areas) do |
bsw@31 | 155 link_area(area) |
bsw@31 | 156 end |
bsw@34 | 157 slot.put("<br /><br />") |
bsw@34 | 158 slot.put(_"This report can be saved (use 'save complete website') and used offline.") end |
bsw@31 | 159 } |
bsw@31 | 160 |
bsw@31 | 161 ui.script{ script = "openEl('areas')" } |
bsw@31 | 162 |
bsw@31 | 163 for i, area in ipairs(areas) do |
bsw@31 | 164 execute.view{ |
bsw@31 | 165 module = "report", |
bsw@31 | 166 view = "area", |
bsw@31 | 167 params = { area = area } |
bsw@31 | 168 } |
bsw@34 | 169 end |
bsw@34 | 170 |