liquid_feedback_frontend
changeset 31:a6caaff47205
Report view for all closed issues added
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/_layout/report.html Tue Feb 23 21:09:10 2010 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 +<html> 1.5 + <head> 1.6 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 1.7 + <title><!-- WEBMCP SLOTNODIV app_name --></title> 1.8 + <link rel="stylesheet" type="text/css" media="screen" href="<!-- WEBMCP SLOTNODIV stylesheet_url -->" /> 1.9 + <script> 1.10 + var lastEls = new Array(); 1.11 + function openEl(el) { 1.12 + var el = document.getElementById(el); 1.13 + if (! el) { 1.14 + return; 1.15 + } 1.16 + if (lastEls.length > 0) { 1.17 + lastEls[lastEls.length-1].style.display='none'; 1.18 + }; 1.19 + lastEls.push(el); 1.20 + el.style.display = 'block'; 1.21 + } 1.22 + function undo() { 1.23 + if (lastEls.length > 0) { 1.24 + var el = lastEls.pop(); 1.25 + el.style.display='none'; 1.26 + }; 1.27 + if (lastEls.length > 0) { 1.28 + lastEls[lastEls.length-1].style.display = 'block'; 1.29 + }; 1.30 + } 1.31 + var prev_issues = {}; 1.32 + var prev_initiatives = {}; 1.33 + var next_initiatives = {}; 1.34 + var next_issues = {}; 1.35 + function openPrevIssue() { 1.36 + openEl(prev_issues[lastEls[lastEls.length-1].id]); 1.37 + }; 1.38 + function openPrevInitiative() { 1.39 + openEl(prev_initiatives[lastEls[lastEls.length-1].id]); 1.40 + }; 1.41 + function openNextInitiative() { 1.42 + openEl(next_initiatives[lastEls[lastEls.length-1].id]); 1.43 + }; 1.44 + function openNextIssue() { 1.45 + openEl(next_issues[lastEls[lastEls.length-1].id]); 1.46 + }; 1.47 + function openElDirect() { 1.48 + var issue_id_el = document.getElementById("input_issue"); 1.49 + var initiative_id_el = document.getElementById("input_initiative"); 1.50 + if (initiative_id_el.value) { 1.51 + openEl("initiative_" + initiative_id_el.value); 1.52 + } else if (issue_id_el.value) { 1.53 + openEl("issue_" + issue_id_el.value); 1.54 + }; 1.55 + issue_id_el.value = ""; 1.56 + initiative_id_el.value = ""; 1.57 + } 1.58 + </script> 1.59 + </head> 1.60 + <body> 1.61 + <div class="main" id="default"> 1.62 + <!-- WEBMCP SLOT default --> 1.63 + </div> 1.64 + </body> 1.65 + <script> 1.66 + </script> 1.67 +</html> 1.68 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/app/main/initiative/_battles.lua Tue Feb 23 21:09:10 2010 +0100 2.3 @@ -0,0 +1,99 @@ 2.4 +local initiative = param.get("initiative", "table") 2.5 + 2.6 +if not initiative.issue.closed then 2.7 + return 2.8 +end 2.9 + 2.10 +local battled_initiatives = Initiative:new_selector() 2.11 + :add_field("winning_battle.count", "winning_count") 2.12 + :add_field("losing_battle.count", "losing_count") 2.13 + :join("battle", "winning_battle", { "winning_battle.winning_initiative_id = ? AND winning_battle.losing_initiative_id = initiative.id", initiative.id }) 2.14 + :join("battle", "losing_battle", { "losing_battle.losing_initiative_id = ? AND losing_battle.winning_initiative_id = initiative.id", initiative.id }) 2.15 + :add_order_by("rank") 2.16 + :exec() 2.17 + 2.18 + 2.19 +local number_of_initiatives = Initiative:new_selector() 2.20 + :add_where{ "issue_id = ?", initiative.issue_id } 2.21 + :add_where("admitted") 2.22 + :count() 2.23 + 2.24 +if number_of_initiatives > 1 then 2.25 + ui.container{ 2.26 + attr = { class = "heading first" }, 2.27 + content = _"This initiative compared to alternative initiatives" 2.28 + } 2.29 + 2.30 + ui.list{ 2.31 + records = battled_initiatives, 2.32 + columns = { 2.33 + { 2.34 + content = function() 2.35 + slot.put(_"This initiative") 2.36 + end 2.37 + }, 2.38 + { 2.39 + content = function(record) 2.40 + local population = initiative.issue.voter_count 2.41 + local value = record.winning_count 2.42 + ui.bargraph{ 2.43 + class = "bargraph bargraph50", 2.44 + max_value = population, 2.45 + width = 50, 2.46 + bars = { 2.47 + { color = "#aaa", value = population - value }, 2.48 + { color = "#444", value = value }, 2.49 + } 2.50 + } 2.51 + end 2.52 + }, 2.53 + { 2.54 + content = function(record) 2.55 + slot.put(record.winning_count) 2.56 + end 2.57 + }, 2.58 + { 2.59 + content = function(record) 2.60 + if record.winning_count == record.losing_count then 2.61 + ui.image{ static = "icons/16/bullet_blue.png" } 2.62 + elseif record.winning_count > record.losing_count then 2.63 + ui.image{ static = "icons/16/resultset_previous.png" } 2.64 + else 2.65 + ui.image{ static = "icons/16/resultset_next.png" } 2.66 + end 2.67 + end 2.68 + }, 2.69 + { 2.70 + field_attr = { style = "text-align: right;" }, 2.71 + content = function(record) 2.72 + slot.put(record.losing_count) 2.73 + end 2.74 + }, 2.75 + { 2.76 + content = function(record) 2.77 + local population = initiative.issue.voter_count 2.78 + local value = record.losing_count 2.79 + ui.bargraph{ 2.80 + class = "bargraph bargraph50", 2.81 + max_value = population, 2.82 + width = 50, 2.83 + bars = { 2.84 + { color = "#444", value = value }, 2.85 + { color = "#aaa", value = population - value }, 2.86 + } 2.87 + } 2.88 + end 2.89 + }, 2.90 + { 2.91 + content = function(record) 2.92 + ui.link{ 2.93 + module = "initiative", 2.94 + view = "show", 2.95 + id = record.id, 2.96 + text = record.name 2.97 + } 2.98 + end 2.99 + } 2.100 + } 2.101 + } 2.102 +end
3.1 --- a/app/main/initiative/_show_voting.lua Sun Feb 21 17:34:37 2010 +0100 3.2 +++ b/app/main/initiative/_show_voting.lua Tue Feb 23 21:09:10 2010 +0100 3.3 @@ -1,103 +1,16 @@ 3.4 local initiative = param.get("initiative", "table") 3.5 3.6 - 3.7 -local battled_initiatives = Initiative:new_selector() 3.8 - :add_field("winning_battle.count", "winning_count") 3.9 - :add_field("losing_battle.count", "losing_count") 3.10 - :join("battle", "winning_battle", { "winning_battle.winning_initiative_id = ? AND winning_battle.losing_initiative_id = initiative.id", initiative.id }) 3.11 - :join("battle", "losing_battle", { "losing_battle.losing_initiative_id = ? AND losing_battle.winning_initiative_id = initiative.id", initiative.id }) 3.12 - :add_order_by("rank") 3.13 - :exec() 3.14 - 3.15 -local number_of_initiatives = Initiative:new_selector() 3.16 - :add_where{ "issue_id = ?", initiative.issue_id } 3.17 - :add_where("admitted") 3.18 - :count() 3.19 - 3.20 if initiative.revoked then 3.21 slot.put(_"Not voted (revoked from initiator)") 3.22 elseif initiative.admitted == false then 3.23 slot.put(_"Not voted (not admitted)") 3.24 else 3.25 - if number_of_initiatives > 1 then 3.26 - ui.container{ 3.27 - attr = { class = "heading first" }, 3.28 - content = _"This initiative compared to alternative initiatives" 3.29 - } 3.30 3.31 - ui.list{ 3.32 - records = battled_initiatives, 3.33 - columns = { 3.34 - { 3.35 - content = function() 3.36 - slot.put(_"This initiative") 3.37 - end 3.38 - }, 3.39 - { 3.40 - content = function(record) 3.41 - local population = initiative.issue.voter_count 3.42 - local value = record.winning_count 3.43 - ui.bargraph{ 3.44 - class = "bargraph bargraph50", 3.45 - max_value = population, 3.46 - width = 50, 3.47 - bars = { 3.48 - { color = "#aaa", value = population - value }, 3.49 - { color = "#444", value = value }, 3.50 - } 3.51 - } 3.52 - end 3.53 - }, 3.54 - { 3.55 - content = function(record) 3.56 - slot.put(record.winning_count) 3.57 - end 3.58 - }, 3.59 - { 3.60 - content = function(record) 3.61 - if record.winning_count == record.losing_count then 3.62 - ui.image{ static = "icons/16/bullet_blue.png" } 3.63 - elseif record.winning_count > record.losing_count then 3.64 - ui.image{ static = "icons/16/resultset_previous.png" } 3.65 - else 3.66 - ui.image{ static = "icons/16/resultset_next.png" } 3.67 - end 3.68 - end 3.69 - }, 3.70 - { 3.71 - field_attr = { style = "text-align: right;" }, 3.72 - content = function(record) 3.73 - slot.put(record.losing_count) 3.74 - end 3.75 - }, 3.76 - { 3.77 - content = function(record) 3.78 - local population = initiative.issue.voter_count 3.79 - local value = record.losing_count 3.80 - ui.bargraph{ 3.81 - class = "bargraph bargraph50", 3.82 - max_value = population, 3.83 - width = 50, 3.84 - bars = { 3.85 - { color = "#444", value = value }, 3.86 - { color = "#aaa", value = population - value }, 3.87 - } 3.88 - } 3.89 - end 3.90 - }, 3.91 - { 3.92 - content = function(record) 3.93 - ui.link{ 3.94 - module = "initiative", 3.95 - view = "show", 3.96 - id = record.id, 3.97 - text = record.name 3.98 - } 3.99 - end 3.100 - } 3.101 - } 3.102 - } 3.103 - end 3.104 + execute.view{ 3.105 + module = "initiative", 3.106 + view = "_battles", 3.107 + params = { initiative = initiative } 3.108 + } 3.109 3.110 ui.container{ 3.111 attr = { class = "heading" },
4.1 --- a/app/main/initiative/show_static.lua Sun Feb 21 17:34:37 2010 +0100 4.2 +++ b/app/main/initiative/show_static.lua Tue Feb 23 21:09:10 2010 +0100 4.3 @@ -38,7 +38,7 @@ 4.4 end 4.5 end) 4.6 4.7 -slot.put_into("sub_title", encode.html(_"Initiative: '#{name}'":gsub("#{name}", initiative.shortened_name) )) 4.8 +slot.put_into("sub_title", encode.html(_"Initiative: '#{name}'":gsub("#{name}", initiative.name) )) 4.9 4.10 execute.view{ 4.11 module = "initiative", 4.12 @@ -47,4 +47,4 @@ 4.13 initiative = initiative, 4.14 expanded = true 4.15 } 4.16 -} 4.17 \ No newline at end of file 4.18 +}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/app/main/report/area.lua Tue Feb 23 21:09:10 2010 +0100 5.3 @@ -0,0 +1,220 @@ 5.4 +function show_issue(issue, initiatives_selector) 5.5 + ui.list{ 5.6 + records = initiatives_selector:exec(), 5.7 + columns = { 5.8 + { 5.9 + label = _"Date", 5.10 + label_attr = { style = "width: 7.5em;" }, 5.11 + content = function(initiative) 5.12 + slot.put(format.date(issue.closed)) 5.13 + end 5.14 + }, 5.15 + { 5.16 + label_attr = { style = "width: 8em;" }, 5.17 + label = _"Id", 5.18 + content = function(initiative) 5.19 + ui.link{ 5.20 + external = "", 5.21 + text = "#" .. tostring(issue.id) .. "." .. tostring(initiative.id), 5.22 + attr = { 5.23 + onclick = 5.24 + "openEl('initiative_" .. tostring(initiative.id) .. "');" .. 5.25 + "return(false);" 5.26 + } 5.27 + } 5.28 + end 5.29 + }, 5.30 + { 5.31 + label = _"Rank", 5.32 + label_attr = { style = "width: 3em;" }, 5.33 + field_attr = { style = "text-align: right;" }, 5.34 + content = function(initiative) 5.35 + ui.field.rank{ value = initiative.rank } 5.36 + end 5.37 + }, 5.38 + { 5.39 + label = _"Name", 5.40 + content = function(initiative) 5.41 + if initiative.rank and initiative.rank == 1 then 5.42 + slot.put("<b>") 5.43 + end 5.44 + ui.field.text{ value = initiative.name } 5.45 + if initiative.rank and initiative.rank == 1 then 5.46 + slot.put("</b>") 5.47 + end 5.48 + end 5.49 + } 5.50 + } 5.51 + } 5.52 +end 5.53 + 5.54 +function link_issue(issue) 5.55 + ui.link{ 5.56 + external = "", 5.57 + attr = { 5.58 + style = "text-decoration: none;", 5.59 + name = "issue_" .. tostring(issue.id), 5.60 + onclick = 5.61 + "openEl('issue_" .. tostring(issue.id) .. "');" .. 5.62 + "return(false);" 5.63 + }, 5.64 + content = function() 5.65 + ui.heading{ 5.66 + attr = { style = "background-color: #ddd; color: #000;" }, 5.67 + content = _("##{id}", { id = issue.id }) 5.68 + } 5.69 + end 5.70 + } 5.71 +end 5.72 + 5.73 + 5.74 +local area = param.get("area", "table") 5.75 + 5.76 +local issue_selector = Issue:new_selector() 5.77 +issue_selector:add_where{ "area_id = ?", area.id } 5.78 +issue_selector:add_where("closed NOTNULL") 5.79 +issue_selector:add_order_by("id") 5.80 + 5.81 + 5.82 +local issues = issue_selector:exec() 5.83 + 5.84 +ui.container{ 5.85 + attr = { 5.86 + id = "area_" .. tostring(area.id) 5.87 + }, 5.88 + content = function() 5.89 + 5.90 + link_area(area) 5.91 + 5.92 + for i, issue in ipairs(issues) do 5.93 + 5.94 + link_issue(issue) 5.95 + 5.96 + local initiatives_selector = issue:get_reference_selector("initiatives") 5.97 + 5.98 + local initiatives_count = initiatives_selector:count() 5.99 + 5.100 + initiatives_selector:add_order_by("rank") 5.101 + initiatives_selector:limit(3) 5.102 + 5.103 + show_issue(issue, initiatives_selector) 5.104 + 5.105 + if initiatives_count > 3 then 5.106 + ui.link{ 5.107 + attr = { 5.108 + style = "margin-left: 8em; font-style: italic;", 5.109 + onclick = "openEl('issue_" .. tostring(issue.id) .. "'); return(false);" 5.110 + }, 5.111 + content = _("and #{count} more initiatives", { count = initiatives_count - 3 }), 5.112 + external = "" 5.113 + } 5.114 + end 5.115 + 5.116 + slot.put("<br />") 5.117 + 5.118 + end 5.119 + 5.120 + end 5.121 +} 5.122 + 5.123 +local next_issue = issues[1] 5.124 +if next_issue then 5.125 + ui.script{ script = "next_issues['area_" .. tostring(area.id) .. "'] = 'issue_" .. tostring(next_issue.id) .. "';" } 5.126 +end 5.127 + 5.128 +if next_issue then 5.129 + local next_initiative = next_issue.initiatives[1] 5.130 + if next_initiative then 5.131 + ui.script{ script = "next_initiatives['area_" .. tostring(area.id) .. "'] = 'initiative_" .. tostring(next_initiative.id) .. "';" } 5.132 + end 5.133 +end 5.134 + 5.135 + 5.136 +for i, issue in ipairs(issues) do 5.137 + local initiatives_selector = issue:get_reference_selector("initiatives") 5.138 + :add_order_by("rank") 5.139 + 5.140 + local initiatives = initiatives_selector:exec() 5.141 + 5.142 + ui.container{ 5.143 + attr = { 5.144 + id = "issue_" .. tostring(issue.id) 5.145 + }, 5.146 + content = function() 5.147 + link_area(area) 5.148 + link_issue(issue) 5.149 + show_issue(issue, initiatives_selector) 5.150 + end 5.151 + } 5.152 + 5.153 + local previous_issue = issues[i-1] 5.154 + if previous_issue then 5.155 + ui.script{ script = "prev_issues['issue_" .. tostring(issue.id) .. "'] = 'issue_" .. tostring(previous_issue.id) .. "';" } 5.156 + end 5.157 + 5.158 + local next_initiative = initiatives[1] 5.159 + if next_initiative then 5.160 + ui.script{ script = "next_initiatives['issue_" .. tostring(issue.id) .. "'] = 'initiative_" .. tostring(next_initiative.id) .. "';" } 5.161 + end 5.162 + 5.163 + local next_issue = issues[i+1] 5.164 + if next_issue then 5.165 + ui.script{ script = "next_issues['issue_" .. tostring(issue.id) .. "'] = 'issue_" .. tostring(next_issue.id) .. "';" } 5.166 + end 5.167 + 5.168 + ui.script{ 5.169 + script = "document.getElementById('issue_" .. tostring(issue.id) .. "').style.display = 'none';" 5.170 + } 5.171 + 5.172 + 5.173 + for j, initiative in ipairs(initiatives) do 5.174 + 5.175 + ui.container{ 5.176 + attr = { 5.177 + id = "initiative_" .. tostring(initiative.id) 5.178 + }, 5.179 + content = function() 5.180 + execute.view{ 5.181 + module = "report", 5.182 + view = "initiative", 5.183 + params = { initiative = initiative } 5.184 + } 5.185 + slot.put("<br />") 5.186 + slot.put("<br />") 5.187 + slot.put("<br />") 5.188 + slot.put("<br />") 5.189 + slot.put("<br />") 5.190 + end 5.191 + } 5.192 + 5.193 + local previous_issue = issues[i-1] 5.194 + if previous_issue then 5.195 + ui.script{ script = "prev_issues['initiative_" .. tostring(initiative.id) .. "'] = 'issue_" .. tostring(previous_issue.id) .. "';" } 5.196 + end 5.197 + 5.198 + local previous_initiative = initiatives[j-1] 5.199 + if previous_initiative then 5.200 + ui.script{ script = "prev_initiatives['initiative_" .. tostring(initiative.id) .. "'] = 'initiative_" .. tostring(previous_initiative.id) .. "';" } 5.201 + end 5.202 + 5.203 + local next_initiative = initiatives[j+1] 5.204 + if next_initiative then 5.205 + ui.script{ script = "next_initiatives['initiative_" .. tostring(initiative.id) .. "'] = 'initiative_" .. tostring(next_initiative.id) .. "';" } 5.206 + end 5.207 + 5.208 + local next_issue = issues[i+1] 5.209 + if next_issue then 5.210 + ui.script{ script = "next_issues['initiative_" .. tostring(initiative.id) .. "'] = 'issue_" .. tostring(next_issue.id) .. "';" } 5.211 + end 5.212 + 5.213 + ui.script{ 5.214 + script = "document.getElementById('initiative_" .. tostring(initiative.id) .. "').style.display = 'none';" 5.215 + } 5.216 + 5.217 + end 5.218 +end 5.219 + 5.220 +ui.script{ 5.221 + script = "document.getElementById('area_" .. tostring(area.id) .. "').style.display = 'none';" 5.222 +} 5.223 +
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/app/main/report/index.lua Tue Feb 23 21:09:10 2010 +0100 6.3 @@ -0,0 +1,130 @@ 6.4 +function link_area(area) 6.5 + ui.link{ 6.6 + external = "", 6.7 + attr = { 6.8 + onclick = 6.9 + "openEl('area_" .. tostring(area.id) .. "');" .. 6.10 + "return(false);" 6.11 + }, 6.12 + content = function() 6.13 + ui.heading{ 6.14 + attr = { style = "background-color: #000; color: #fff;" }, 6.15 + content = area.name 6.16 + } 6.17 + end 6.18 + } 6.19 +end 6.20 + 6.21 +slot.set_layout("report") 6.22 + 6.23 +ui.form{ 6.24 + attr = { 6.25 + style = " float: right;", 6.26 + onsubmit = "openElDirect(); return(false);" 6.27 + }, 6.28 + content = function() 6.29 + slot.put("#") 6.30 + ui.tag{ 6.31 + tag = "input", 6.32 + attr = { 6.33 + id = "input_issue", 6.34 + type = "text", 6.35 + style = "width: 4em;" 6.36 + } 6.37 + } 6.38 + slot.put(".") 6.39 + ui.tag{ 6.40 + tag = "input", 6.41 + attr = { 6.42 + id = "input_initiative", 6.43 + type = "text", 6.44 + style = "width: 4em;" 6.45 + } 6.46 + } 6.47 + slot.put(" ") 6.48 + ui.tag{ 6.49 + tag = "input", 6.50 + attr = { 6.51 + type = "submit", 6.52 + value = "OK", 6.53 + } 6.54 + } 6.55 + end 6.56 +} 6.57 + 6.58 +ui.link{ 6.59 + external = "", 6.60 + attr = { 6.61 + onclick = "undo(); return(false);" 6.62 + }, 6.63 + text = _"Back" 6.64 +} 6.65 + 6.66 +slot.put(" ") 6.67 + 6.68 +ui.link{ 6.69 + external = "", 6.70 + text = _"Areas" 6.71 +} 6.72 + 6.73 +slot.put(" ") 6.74 + 6.75 +ui.link{ 6.76 + external = "", 6.77 + attr = { 6.78 + onclick = "openPrevIssue(); return(false);" 6.79 + }, 6.80 + text = "<< " .. _"Previous issue" 6.81 +} 6.82 + 6.83 +slot.put(" ") 6.84 + 6.85 +ui.link{ 6.86 + external = "", 6.87 + attr = { 6.88 + onclick = "openPrevInitiative(); return(false);" 6.89 + }, 6.90 + text = "< " .. _"Previous initiative" 6.91 +} 6.92 + 6.93 +slot.put(" ") 6.94 + 6.95 +ui.link{ 6.96 + external = "", 6.97 + attr = { 6.98 + onclick = "openNextInitiative(); return(false);" 6.99 + }, 6.100 + text = _"Next initiative" .. " >" 6.101 +} 6.102 + 6.103 +slot.put(" ") 6.104 + 6.105 +ui.link{ 6.106 + external = "", 6.107 + attr = { 6.108 + onclick = "openNextIssue(); return(false);" 6.109 + }, 6.110 + text = _"Next issue" .. " >>" 6.111 +} 6.112 + 6.113 +local areas = Area:new_selector():exec() 6.114 + 6.115 + 6.116 +ui.container{ 6.117 + attr = { id = "areas" }, 6.118 + content = function() 6.119 + for i, area in ipairs(areas) do 6.120 + link_area(area) 6.121 + end 6.122 + end 6.123 +} 6.124 + 6.125 +ui.script{ script = "openEl('areas')" } 6.126 + 6.127 +for i, area in ipairs(areas) do 6.128 + execute.view{ 6.129 + module = "report", 6.130 + view = "area", 6.131 + params = { area = area } 6.132 + } 6.133 +end 6.134 \ No newline at end of file
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/app/main/report/initiative.lua Tue Feb 23 21:09:10 2010 +0100 7.3 @@ -0,0 +1,86 @@ 7.4 +local initiative = param.get("initiative", "table") 7.5 + 7.6 +link_area(initiative.issue.area) 7.7 + 7.8 +link_issue(initiative.issue) 7.9 + 7.10 +ui.link{ 7.11 + external = "", 7.12 + attr = { 7.13 + style = "display: block; text-decoration: none;", 7.14 + name = "initiative_" .. tostring(initiative.id), 7.15 + }, 7.16 + content = function() 7.17 + ui.heading{ 7.18 + content = _("##{issue_id}.#{id} #{name}", { issue_id = initiative.issue.id, id = initiative.id, name = initiative.shortened_name }) 7.19 + } 7.20 + end 7.21 +} 7.22 + 7.23 +slot.put("<br />") 7.24 + 7.25 +if initiative.issue.ranks_available and initiative.admitted then 7.26 + local class = initiative.rank == 1 and "admitted_info" or "not_admitted_info" 7.27 + ui.container{ 7.28 + attr = { class = class }, 7.29 + content = function() 7.30 + local max_value = initiative.issue.voter_count 7.31 + slot.put(" ") 7.32 + local positive_votes = initiative.positive_votes 7.33 + local negative_votes = initiative.negative_votes 7.34 + slot.put(_"Yes" .. ": <b>" .. tostring(positive_votes) .. "</b>") 7.35 + slot.put(" · ") 7.36 + slot.put(_"Abstention" .. ": <b>" .. tostring(max_value - initiative.negative_votes - initiative.positive_votes) .. "</b>") 7.37 + slot.put(" · ") 7.38 + slot.put(_"No" .. ": <b>" .. tostring(initiative.negative_votes) .. "</b>") 7.39 + slot.put(" · ") 7.40 + slot.put("<b>") 7.41 + if initiative.rank == 1 then 7.42 + slot.put(_"Approved") 7.43 + elseif initiative.rank then 7.44 + slot.put(_("Not approved (rank #{rank})", { rank = initiative.rank })) 7.45 + else 7.46 + slot.put(_"Not approved") 7.47 + end 7.48 + slot.put("</b>") 7.49 + end 7.50 + } 7.51 +end 7.52 + 7.53 +if initiative.issue.state == "cancelled" then 7.54 + local policy = initiative.issue.policy 7.55 + ui.container{ 7.56 + attr = { class = "not_admitted_info" }, 7.57 + content = _("This issue has been cancelled. It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) }) 7.58 + } 7.59 +elseif initiative.admitted == false then 7.60 + local policy = initiative.issue.policy 7.61 + ui.container{ 7.62 + attr = { class = "not_admitted_info" }, 7.63 + content = _("This initiative has not been admitted! It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) }) 7.64 + } 7.65 +end 7.66 + 7.67 +if initiative.revoked then 7.68 + ui.container{ 7.69 + attr = { class = "revoked_info" }, 7.70 + content = function() 7.71 + slot.put(_("This initiative has been revoked at #{revoked}", { revoked = format.timestamp(initiative.revoked) })) 7.72 + end 7.73 + } 7.74 +end 7.75 + 7.76 + 7.77 +ui.container{ 7.78 + attr = { class = "draft_content wiki" }, 7.79 + content = function() 7.80 + slot.put(format.wiki_text(initiative.current_draft.content, initiative.current_draft.formatting_engine)) 7.81 + end 7.82 +} 7.83 + 7.84 +execute.view{ 7.85 + module = "initiative", 7.86 + view = "_battles", 7.87 + params = { initiative = initiative } 7.88 +} 7.89 +
8.1 --- a/config/default.lua Sun Feb 21 17:34:37 2010 +0100 8.2 +++ b/config/default.lua Tue Feb 23 21:09:10 2010 +0100 8.3 @@ -1,5 +1,5 @@ 8.4 config.app_name = "LiquidFeedback" 8.5 -config.app_version = "beta11" 8.6 +config.app_version = "beta12" 8.7 8.8 config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" 8.9
9.1 --- a/env/ui/field/negative_votes.lua Sun Feb 21 17:34:37 2010 +0100 9.2 +++ b/env/ui/field/negative_votes.lua Tue Feb 23 21:09:10 2010 +0100 9.3 @@ -8,9 +8,6 @@ 9.4 attr = { class = "value" }, 9.5 content = function() 9.6 slot.put(tostring(value) .. ' ') 9.7 - ui.image{ 9.8 - static = "icons/16/delete.png" 9.9 - } 9.10 end 9.11 } 9.12 end
10.1 --- a/env/ui/field/positive_votes.lua Sun Feb 21 17:34:37 2010 +0100 10.2 +++ b/env/ui/field/positive_votes.lua Tue Feb 23 21:09:10 2010 +0100 10.3 @@ -8,9 +8,6 @@ 10.4 attr = { class = "value" }, 10.5 content = function() 10.6 slot.put(tostring(value) .. ' ') 10.7 - ui.image{ 10.8 - static = "icons/16/add.png" 10.9 - } 10.10 end 10.11 } 10.12 end
11.1 --- a/locale/translations.de.lua Sun Feb 21 17:34:37 2010 +0100 11.2 +++ b/locale/translations.de.lua Tue Feb 23 21:09:10 2010 +0100 11.3 @@ -1,5 +1,7 @@ 11.4 #!/usr/bin/env lua 11.5 return { 11.6 +["##{id}"] = false; 11.7 +["##{issue_id}.#{id} #{name}"] = false; 11.8 ["#{interested_issues_to_vote_count} issue(s) you are interested in"] = "#{interested_issues_to_vote_count} Themen, die Dich interessieren"; 11.9 ["#{issues_to_vote_count} issue(s)"] = "#{issues_to_vote_count} Themen"; 11.10 ["#{number} Image(s) has been deleted"] = "Es wurde(n) #{number} Bild(er) gelöscht"; 11.11 @@ -101,6 +103,7 @@ 11.12 ["Created at"] = "Erzeugt am/um"; 11.13 ["Current draft"] = "Aktueller Entwurf"; 11.14 ["Current votings in areas you are member of and issues you are interested in:"] = "Jetzt laufende Abstimmungen zu Themen aus Deinen Themenbereichen oder solchen an denen Du interessiert bist:"; 11.15 +["Date"] = "Datum"; 11.16 ["Degree"] = "Grad"; 11.17 ["Delegations"] = "Delegationen"; 11.18 ["Delete filter"] = "Filter löschen"; 11.19 @@ -238,7 +241,7 @@ 11.20 ["Member page"] = "Mitgliederseite"; 11.21 ["Member successfully registered"] = "Mitglied erfolgreich registriert"; 11.22 ["Member successfully updated"] = "Mitglied erfolgreich aktualisert"; 11.23 -["Member voting"] = false; 11.24 +["Member voting"] = "Abstimmungsverhalten"; 11.25 ["Member: '#{login}' (#{name})"] = "Mitlied: '#{login}' (#{name})"; 11.26 ["Members"] = "Mitglieder"; 11.27 ["Membership by delegation"] = "Mitgliedschaft durch Delegation"; 11.28 @@ -264,6 +267,8 @@ 11.29 ["New passwords is too short."] = "Das neue Kennwort ist zu kurz"; 11.30 ["New suggestion"] = "Neue Anregung"; 11.31 ["Newest"] = "Neueste"; 11.32 +["Next initiative"] = "Nächste Initiative"; 11.33 +["Next issue"] = "Nächstes Thema"; 11.34 ["Next state"] = "Nächster Zustand"; 11.35 ["No"] = "Nein"; 11.36 ["No changes to your images were made"] = "An Deinen Bildern wurde nichts geändert"; 11.37 @@ -322,6 +327,8 @@ 11.38 ["Potential support"] = "Potentielle Unterstützung"; 11.39 ["Potential supported"] = "Potentiell unterstützt"; 11.40 ["Potential supporter"] = "Potentielle Unterstützer"; 11.41 +["Previous initiative"] = "Vorherige Initiative"; 11.42 +["Previous issue"] = "Vorheriges Thema"; 11.43 ["Profession"] = "Beruf"; 11.44 ["Profile"] = "Profil"; 11.45 ["Publish"] = "Veröffentlichen";
12.1 --- a/locale/translations.en.lua Sun Feb 21 17:34:37 2010 +0100 12.2 +++ b/locale/translations.en.lua Tue Feb 23 21:09:10 2010 +0100 12.3 @@ -1,5 +1,7 @@ 12.4 #!/usr/bin/env lua 12.5 return { 12.6 +["##{id}"] = false; 12.7 +["##{issue_id}.#{id} #{name}"] = false; 12.8 ["#{interested_issues_to_vote_count} issue(s) you are interested in"] = false; 12.9 ["#{issues_to_vote_count} issue(s)"] = false; 12.10 ["#{number} Image(s) has been deleted"] = false; 12.11 @@ -10,6 +12,7 @@ 12.12 ["+ #{weight}"] = false; 12.13 ["A-Z"] = false; 12.14 ["About"] = false; 12.15 +["About / Impressum"] = false; 12.16 ["About LiquidFeedback"] = false; 12.17 ["Abstention"] = false; 12.18 ["Abstention [many entries]"] = "Abstention"; 12.19 @@ -20,9 +23,8 @@ 12.20 ["Accordion (first expanded)"] = false; 12.21 ["Accordion (none expanded)"] = false; 12.22 ["Active?"] = false; 12.23 +["Add alternative initiative to issue"] = false; 12.24 ["Add my interest"] = false; 12.25 -["Add new initiative"] = false; 12.26 -["Add new initiative to issue"] = false; 12.27 ["Add new suggestion"] = false; 12.28 ["Add to my contacts"] = false; 12.29 ["Address"] = false; 12.30 @@ -32,6 +34,7 @@ 12.31 ["Administrator"] = false; 12.32 ["Admission time"] = false; 12.33 ["Admitted"] = false; 12.34 +["Alternative initiatives"] = false; 12.35 ["Any"] = false; 12.36 ["Approval (#th preference) [many entries]"] = "Approval (#th preference)"; 12.37 ["Approval (#th preference) [single entry]"] = "Approval (#th preference)"; 12.38 @@ -43,6 +46,7 @@ 12.39 ["Approval (third preference) [single entry]"] = "Approval (third preference)"; 12.40 ["Approval [many entries]"] = "Approval"; 12.41 ["Approval [single entry]"] = "Approval"; 12.42 +["Approved"] = false; 12.43 ["Are you sure?"] = false; 12.44 ["Area"] = false; 12.45 ["Area '#{name}'"] = false; 12.46 @@ -57,6 +61,7 @@ 12.47 ["Avatar"] = false; 12.48 ["Back"] = false; 12.49 ["Back to timeline"] = false; 12.50 +["Ballot of '#{member_name}' for issue ##{issue_id}"] = false; 12.51 ["Become a member"] = false; 12.52 ["Birthday"] = false; 12.53 ["Can't remove last initiator"] = false; 12.54 @@ -68,10 +73,12 @@ 12.55 ["Cancelled"] = false; 12.56 ["Change area delegation"] = false; 12.57 ["Change display settings"] = false; 12.58 +["Change filters and order"] = false; 12.59 ["Change global delegation"] = false; 12.60 ["Change issue delegation"] = false; 12.61 ["Change login"] = false; 12.62 ["Change name"] = false; 12.63 +["Change order"] = false; 12.64 ["Change password"] = false; 12.65 ["Change vote"] = false; 12.66 ["Change your login"] = false; 12.67 @@ -80,7 +87,6 @@ 12.68 ["Choose initiator"] = false; 12.69 ["Choose member"] = false; 12.70 ["Click for details"] = false; 12.71 -["Close"] = false; 12.72 ["Closed"] = false; 12.73 ["Collective opinion"] = false; 12.74 ["Commit suggestion"] = false; 12.75 @@ -97,6 +103,7 @@ 12.76 ["Created at"] = false; 12.77 ["Current draft"] = false; 12.78 ["Current votings in areas you are member of and issues you are interested in:"] = false; 12.79 +["Date"] = false; 12.80 ["Degree"] = false; 12.81 ["Delegations"] = false; 12.82 ["Delete filter"] = false; 12.83 @@ -114,17 +121,18 @@ 12.84 ["Disapproval (prefer to lower blocks) [single entry]"] = "Disapproval (prefer to lower blocks)"; 12.85 ["Disapproval [many entries]"] = "Disapproval"; 12.86 ["Disapproval [single entry]"] = "Disapproval"; 12.87 +["Discard voting"] = false; 12.88 ["Discussion"] = false; 12.89 ["Discussion URL"] = false; 12.90 ["Discussion on issue"] = false; 12.91 ["Discussion time"] = false; 12.92 ["Discussion with initiators"] = false; 12.93 ["Display settings"] = false; 12.94 -["Display starting from"] = false; 12.95 ["Download"] = false; 12.96 ["Download database export"] = false; 12.97 ["Draft"] = false; 12.98 ["Draft history"] = false; 12.99 +["EXPERIMENTAL FEATURE"] = false; 12.100 ["Edit"] = false; 12.101 ["Edit draft"] = false; 12.102 ["Edit initiative"] = false; 12.103 @@ -188,7 +196,6 @@ 12.104 ["Invited"] = false; 12.105 ["Issue"] = false; 12.106 ["Issue ##{id}"] = false; 12.107 -["Issue ##{id} (#{policy_name})"] = false; 12.108 ["Issue accepted"] = false; 12.109 ["Issue canceled"] = false; 12.110 ["Issue delegation"] = false; 12.111 @@ -223,6 +230,7 @@ 12.112 ["Member '#{member}'"] = false; 12.113 ["Member has been removed from initiators"] = false; 12.114 ["Member has been removed from your contacts"] = false; 12.115 +["Member has not approved latest draft"] = false; 12.116 ["Member is administrator"] = false; 12.117 ["Member is already saved in your contacts!"] = false; 12.118 ["Member is now invited to be initiator"] = false; 12.119 @@ -233,6 +241,7 @@ 12.120 ["Member page"] = false; 12.121 ["Member successfully registered"] = false; 12.122 ["Member successfully updated"] = false; 12.123 +["Member voting"] = false; 12.124 ["Member: '#{login}' (#{name})"] = false; 12.125 ["Members"] = false; 12.126 ["Membership by delegation"] = false; 12.127 @@ -243,6 +252,8 @@ 12.128 ["Missing help text: #{id}.#{lang}.txt"] = false; 12.129 ["Mobile phone"] = false; 12.130 ["Monday"] = false; 12.131 +["Move down"] = false; 12.132 +["Move up"] = false; 12.133 ["My opinion"] = false; 12.134 ["Name"] = false; 12.135 ["New"] = false; 12.136 @@ -256,6 +267,8 @@ 12.137 ["New passwords is too short."] = false; 12.138 ["New suggestion"] = false; 12.139 ["Newest"] = false; 12.140 +["Next initiative"] = false; 12.141 +["Next issue"] = false; 12.142 ["Next state"] = false; 12.143 ["No"] = false; 12.144 ["No changes to your images were made"] = false; 12.145 @@ -264,7 +277,11 @@ 12.146 ["No membership at all"] = false; 12.147 ["No support at all"] = false; 12.148 ["Not a member"] = false; 12.149 +["Not approved"] = false; 12.150 +["Not approved (rank #{rank})"] = false; 12.151 ["Not voted"] = false; 12.152 +["Not voted (not admitted)"] = false; 12.153 +["Not voted (revoked from initiator)"] = false; 12.154 ["Not yet voted"] = false; 12.155 ["Number of incoming delegations, follow link to see more details"] = false; 12.156 ["Number of initiatives to preview"] = false; 12.157 @@ -279,6 +296,7 @@ 12.158 ["One issue you are interested in"] = false; 12.159 ["One step back"] = false; 12.160 ["Open"] = false; 12.161 +["Opinions"] = false; 12.162 ["Order by"] = false; 12.163 ["Organizational unit"] = false; 12.164 ["Outgoing delegations"] = false; 12.165 @@ -309,11 +327,12 @@ 12.166 ["Potential support"] = false; 12.167 ["Potential supported"] = false; 12.168 ["Potential supporter"] = false; 12.169 +["Previous initiative"] = false; 12.170 +["Previous issue"] = false; 12.171 ["Profession"] = false; 12.172 ["Profile"] = false; 12.173 ["Publish"] = false; 12.174 ["Published"] = false; 12.175 -["Published contacts"] = false; 12.176 ["Rank"] = false; 12.177 ["Real name"] = false; 12.178 ["Refresh support to current draft"] = false; 12.179 @@ -350,6 +369,7 @@ 12.180 ["Search issues"] = false; 12.181 ["Search members"] = false; 12.182 ["Search results for: '#{search}'"] = false; 12.183 +["Select language \"#{langcode}\""] = false; 12.184 ["Set URL"] = false; 12.185 ["Set area delegation"] = false; 12.186 ["Set autoreject"] = false; 12.187 @@ -361,11 +381,13 @@ 12.188 ["Settings"] = false; 12.189 ["Show"] = false; 12.190 ["Show active members"] = false; 12.191 -["Show all initiatives"] = false; 12.192 +["Show alternative initiatives"] = false; 12.193 ["Show areas in use"] = false; 12.194 ["Show areas not in use"] = false; 12.195 ["Show diff"] = false; 12.196 +["Show filter"] = false; 12.197 ["Show filter details"] = false; 12.198 +["Show help text"] = false; 12.199 ["Show locked members"] = false; 12.200 ["Show member"] = false; 12.201 ["Show name history"] = false; 12.202 @@ -400,14 +422,22 @@ 12.203 ["Supporter"] = false; 12.204 ["Tabs"] = false; 12.205 ["Terms accepted"] = false; 12.206 +["Terms of use"] = false; 12.207 ["The code you've entered is invalid"] = false; 12.208 ["The draft of this initiative has been updated!"] = false; 12.209 ["The drafts do not differ"] = false; 12.210 ["The initiators suggest to support the following initiative:"] = false; 12.211 +["There are no more alternative initiatives currently."] = false; 12.212 +["There were no more alternative initiatives."] = false; 12.213 +["This initiative"] = false; 12.214 +["This initiative compared to alternative initiatives"] = false; 12.215 ["This initiative has been revoked at #{revoked}"] = false; 12.216 ["This initiative has not been admitted! It failed the quorum of #{quorum}."] = false; 12.217 ["This initiative is already revoked"] = false; 12.218 ["This initiative is revoked"] = false; 12.219 +["This issue has been cancelled. It failed the quorum of #{quorum}."] = false; 12.220 +["This issue has been finished with the following winning initiative:"] = false; 12.221 +["This issue has been finished without any winning initiative."] = false; 12.222 ["This issue is already closed."] = false; 12.223 ["This issue is already frozen."] = false; 12.224 ["This login is already taken, please choose another one!"] = false; 12.225 @@ -416,6 +446,7 @@ 12.226 ["This member has rejected to become initiator of this initiative"] = false; 12.227 ["This member is already initiator of this initiative"] = false; 12.228 ["This member is already invited to become initiator of this initiative"] = false; 12.229 +["This member is participating, the rest of delegation chain is suspended while discussing"] = false; 12.230 ["This name is already taken, please choose another one!"] = false; 12.231 ["This name is really too short!"] = false; 12.232 ["This name is too short!"] = false; 12.233 @@ -425,6 +456,7 @@ 12.234 ["Thursday"] = false; 12.235 ["Time left"] = false; 12.236 ["Timeline"] = false; 12.237 +["Title"] = false; 12.238 ["Title (80 chars max)"] = false; 12.239 ["Traditional wiki syntax"] = false; 12.240 ["Trustee"] = false; 12.241 @@ -442,8 +474,8 @@ 12.242 ["Voted no"] = false; 12.243 ["Voted proposal"] = false; 12.244 ["Voted yes"] = false; 12.245 -["Voter"] = false; 12.246 ["Voting"] = false; 12.247 +["Voting details"] = false; 12.248 ["Voting for this issue has already begun."] = false; 12.249 ["Voting for this issue is currently running!"] = false; 12.250 ["Voting has not started yet."] = false; 12.251 @@ -495,21 +527,21 @@ 12.252 ["Your support has been added to this initiative"] = false; 12.253 ["Your support has been removed from this initiative"] = false; 12.254 ["Your support has been updated to the latest draft"] = false; 12.255 +["Your vote has been discarded. Delegation rules apply if set."] = false; 12.256 ["Your web browser is not fully supported yet."] = false; 12.257 ["Z-A"] = false; 12.258 -["all"] = false; 12.259 ["and #{count} more initiatives"] = false; 12.260 ["continuing"] = false; 12.261 ["delete<br /><br />"] = false; 12.262 ["email"] = false; 12.263 +["last 24 hours"] = false; 12.264 ["login name"] = false; 12.265 ["must"] = false; 12.266 ["must not"] = false; 12.267 ["must/should"] = false; 12.268 ["must/should not"] = false; 12.269 ["neutral"] = false; 12.270 -["not implemented"] = false; 12.271 -["now"] = false; 12.272 +["requested"] = false; 12.273 ["should"] = false; 12.274 ["should not"] = false; 12.275 ["to reset your password please click on the following link:\n\n"] = false;
13.1 --- a/locale/translations.eo.lua Sun Feb 21 17:34:37 2010 +0100 13.2 +++ b/locale/translations.eo.lua Tue Feb 23 21:09:10 2010 +0100 13.3 @@ -1,5 +1,7 @@ 13.4 #!/usr/bin/env lua 13.5 return { 13.6 +["##{id}"] = false; 13.7 +["##{issue_id}.#{id} #{name}"] = false; 13.8 ["#{interested_issues_to_vote_count} issue(s) you are interested in"] = "#{interested_issues_to_vote_count} temoj, kiujn vi interesi"; 13.9 ["#{issues_to_vote_count} issue(s)"] = "#{issues_to_vote_count} temoj"; 13.10 ["#{number} Image(s) has been deleted"] = "Estas viŝita(j) #{number} bildo(j)"; 13.11 @@ -101,6 +103,7 @@ 13.12 ["Created at"] = "Kreita je"; 13.13 ["Current draft"] = "Aktuala skizo"; 13.14 ["Current votings in areas you are member of and issues you are interested in:"] = "Aktualaj voĉdonoj pri temoj en kiuj vi membraa kaj kiuj vin interesas:"; 13.15 +["Date"] = false; 13.16 ["Degree"] = "Grado"; 13.17 ["Delegations"] = "Delegacioj"; 13.18 ["Delete filter"] = "Forvisi filtron"; 13.19 @@ -264,6 +267,8 @@ 13.20 ["New passwords is too short."] = "La nova pasvorto estas tro mallonga"; 13.21 ["New suggestion"] = "Nova sugesto"; 13.22 ["Newest"] = "Plej nova"; 13.23 +["Next initiative"] = false; 13.24 +["Next issue"] = false; 13.25 ["Next state"] = "Sekva stato"; 13.26 ["No"] = "Ne"; 13.27 ["No changes to your images were made"] = "Viaj bildoj ne estas ŝanĝitaj"; 13.28 @@ -322,6 +327,8 @@ 13.29 ["Potential support"] = "Eventuala subteno"; 13.30 ["Potential supported"] = "Eble subtenota"; 13.31 ["Potential supporter"] = "Eventuala subtenanto"; 13.32 +["Previous initiative"] = false; 13.33 +["Previous issue"] = false; 13.34 ["Profession"] = "Profesio"; 13.35 ["Profile"] = "Profilo"; 13.36 ["Publish"] = "Publikigi";