# HG changeset patch # User bsw # Date 1267011448 -3600 # Node ID a851cc1d9903e2abe58405102103d630e079c69d # Parent 1d213e9e3456c6d4b544acfaa83d06a754c72819 Beautified report view for closed issues diff -r 1d213e9e3456 -r a851cc1d9903 app/main/_layout/report.html --- a/app/main/_layout/report.html Tue Feb 23 21:10:56 2010 +0100 +++ b/app/main/_layout/report.html Wed Feb 24 12:37:28 2010 +0100 @@ -17,7 +17,7 @@ el.style.display = 'block'; } function undo() { - if (lastEls.length > 0) { + if (lastEls.length > 1) { var el = lastEls.pop(); el.style.display='none'; }; @@ -27,6 +27,7 @@ } var prev_issues = {}; var prev_initiatives = {}; + var parents = {}; var next_initiatives = {}; var next_issues = {}; function openPrevIssue() { @@ -35,6 +36,9 @@ function openPrevInitiative() { openEl(prev_initiatives[lastEls[lastEls.length-1].id]); }; + function openParent() { + openEl(parents[lastEls[lastEls.length-1].id]); + }; function openNextInitiative() { openEl(next_initiatives[lastEls[lastEls.length-1].id]); }; @@ -53,6 +57,24 @@ initiative_id_el.value = ""; } +
diff -r 1d213e9e3456 -r a851cc1d9903 app/main/report/area.lua --- a/app/main/report/area.lua Tue Feb 23 21:10:56 2010 +0100 +++ b/app/main/report/area.lua Wed Feb 24 12:37:28 2010 +0100 @@ -117,6 +117,8 @@ end } +ui.script{ script = "parents['area_" .. tostring(area.id) .. "'] = 'areas';" } + local next_issue = issues[1] if next_issue then ui.script{ script = "next_issues['area_" .. tostring(area.id) .. "'] = 'issue_" .. tostring(next_issue.id) .. "';" } @@ -157,6 +159,8 @@ ui.script{ script = "next_initiatives['issue_" .. tostring(issue.id) .. "'] = 'initiative_" .. tostring(next_initiative.id) .. "';" } end + ui.script{ script = "parents['issue_" .. tostring(issue.id) .. "'] = 'area_" .. tostring(area.id) .. "';" } + local next_issue = issues[i+1] if next_issue then ui.script{ script = "next_issues['issue_" .. tostring(issue.id) .. "'] = 'issue_" .. tostring(next_issue.id) .. "';" } @@ -197,6 +201,8 @@ ui.script{ script = "prev_initiatives['initiative_" .. tostring(initiative.id) .. "'] = 'initiative_" .. tostring(previous_initiative.id) .. "';" } end + ui.script{ script = "parents['initiative_" .. tostring(initiative.id) .. "'] = 'issue_" .. tostring(issue.id) .. "';" } + local next_initiative = initiatives[j+1] if next_initiative then ui.script{ script = "next_initiatives['initiative_" .. tostring(initiative.id) .. "'] = 'initiative_" .. tostring(next_initiative.id) .. "';" } diff -r 1d213e9e3456 -r a851cc1d9903 app/main/report/index.lua --- a/app/main/report/index.lua Tue Feb 23 21:10:56 2010 +0100 +++ b/app/main/report/index.lua Wed Feb 24 12:37:28 2010 +0100 @@ -8,7 +8,6 @@ }, content = function() ui.heading{ - attr = { style = "background-color: #000; color: #fff;" }, content = area.name } end @@ -17,97 +16,136 @@ slot.set_layout("report") -ui.form{ +slot.put("
") + +ui.container{ attr = { - style = " float: right;", - onsubmit = "openElDirect(); return(false);" + class = "nav", + style = "text-align: center;" }, content = function() - slot.put("#") - ui.tag{ - tag = "input", - attr = { - id = "input_issue", - type = "text", - style = "width: 4em;" - } + + + ui.container{ + attr = { + class = "left", + }, + content = function() + ui.link{ + external = "", + attr = { + onclick = "undo(); return(false);" + }, + content = function() + ui.image{ static = "icons/16/cancel.png" } + slot.put(" ") + slot.put(_"Back") + end + } + end } - slot.put(".") - ui.tag{ - tag = "input", + + ui.form{ attr = { - id = "input_initiative", - type = "text", - style = "width: 4em;" - } + style = "float: right;", + onsubmit = "openElDirect(); return(false);" + }, + content = function() + slot.put("#") + ui.tag{ + tag = "input", + attr = { + id = "input_issue", + type = "text", + style = "width: 4em;" + } + } + slot.put(".") + ui.tag{ + tag = "input", + attr = { + id = "input_initiative", + type = "text", + style = "width: 4em;" + } + } + slot.put(" ") + ui.tag{ + tag = "input", + attr = { + type = "submit", + value = "OK", + } + } + end + } + + + ui.link{ + external = "", + attr = { + onclick = "openPrevIssue(); return(false);" + }, + content = function() + ui.image{ static = "icons/16/resultset_previous_double.png" } + slot.put(" ") + slot.put(_"Previous issue") + end } - slot.put(" ") - ui.tag{ - tag = "input", + + ui.link{ + external = "", + attr = { + onclick = "openPrevInitiative(); return(false);" + }, + content = function() + ui.image{ static = "icons/16/resultset_previous.png" } + slot.put(" ") + slot.put(_"Previous initiative") + end + } + + ui.link{ + external = "", attr = { - type = "submit", - value = "OK", - } + onclick = "openParent(); return(false);" + }, + content = function() + ui.image{ static = "icons/16/go_up.png" } + slot.put(" ") + slot.put(_"Go up") + end + } + + ui.link{ + external = "", + attr = { + onclick = "openNextInitiative(); return(false);" + }, + content = function() + ui.image{ static = "icons/16/resultset_next.png" } + slot.put(" ") + slot.put(_"Next initiative") + end + } + + ui.link{ + external = "", + attr = { + onclick = "openNextIssue(); return(false);" + }, + content = function() + ui.image{ static = "icons/16/resultset_next_double.png" } + slot.put(" ") + slot.put(_"Next issue") + end } end } -ui.link{ - external = "", - attr = { - onclick = "undo(); return(false);" - }, - text = _"Back" -} - -slot.put(" ") - -ui.link{ - external = "", - text = _"Areas" -} - -slot.put(" ") - -ui.link{ - external = "", - attr = { - onclick = "openPrevIssue(); return(false);" - }, - text = "<< " .. _"Previous issue" -} - -slot.put(" ") +slot.put("
") -ui.link{ - external = "", - attr = { - onclick = "openPrevInitiative(); return(false);" - }, - text = "< " .. _"Previous initiative" -} - -slot.put(" ") - -ui.link{ - external = "", - attr = { - onclick = "openNextInitiative(); return(false);" - }, - text = _"Next initiative" .. " >" -} - -slot.put(" ") - -ui.link{ - external = "", - attr = { - onclick = "openNextIssue(); return(false);" - }, - text = _"Next issue" .. " >>" -} - -local areas = Area:new_selector():exec() +local areas = Area:new_selector():add_order_by("name"):exec() ui.container{ @@ -116,7 +154,8 @@ for i, area in ipairs(areas) do link_area(area) end - end + slot.put("

") + slot.put(_"This report can be saved (use 'save complete website') and used offline.") end } ui.script{ script = "openEl('areas')" } @@ -127,4 +166,5 @@ view = "area", params = { area = area } } -end \ No newline at end of file +end + diff -r 1d213e9e3456 -r a851cc1d9903 config/default.lua --- a/config/default.lua Tue Feb 23 21:10:56 2010 +0100 +++ b/config/default.lua Wed Feb 24 12:37:28 2010 +0100 @@ -1,5 +1,5 @@ config.app_name = "LiquidFeedback" -config.app_version = "beta12" +config.app_version = "beta12.1" config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" diff -r 1d213e9e3456 -r a851cc1d9903 locale/translations.de.lua --- a/locale/translations.de.lua Tue Feb 23 21:10:56 2010 +0100 +++ b/locale/translations.de.lua Wed Feb 24 12:37:28 2010 +0100 @@ -155,6 +155,7 @@ ["Fully frozen at"] = "Ganz eingefroren am/um"; ["Global delegation"] = "Globale Delegation"; ["Global delegation active"] = "Globale Delegation aktiv"; +["Go up"] = "Nach oben"; ["Half frozen at"] = "Halb eingefroren am/um"; ["Hello "] = "Hallo "; ["Help for: #{text}"] = "Hilfe zu: #{text}"; @@ -450,6 +451,7 @@ ["This name is already taken, please choose another one!"] = "Dieser Name ist bereits vergeben, bitte wähle einen anderen!"; ["This name is really too short!"] = "Dieser Name ist wirklich zu kurz!"; ["This name is too short!"] = "Dieser Name ist zu kurz!"; +["This report can be saved (use 'save complete website') and used offline."] = "Dieser Bericht kann gespeichert (mit 'Webseite komplett speichern') und offline genutzt werden."; ["This suggestion has been meanwhile deleted"] = "Diese Anregung wurde zwischenzeitlich gelöscht"; ["This title is really too short!"] = "Dieser Titel ist wirklich zu kurz!"; ["This username is too short!"] = "Dieser Benutzername ist zu kurz!"; diff -r 1d213e9e3456 -r a851cc1d9903 locale/translations.en.lua --- a/locale/translations.en.lua Tue Feb 23 21:10:56 2010 +0100 +++ b/locale/translations.en.lua Wed Feb 24 12:37:28 2010 +0100 @@ -155,6 +155,7 @@ ["Fully frozen at"] = false; ["Global delegation"] = false; ["Global delegation active"] = false; +["Go up"] = false; ["Half frozen at"] = false; ["Hello "] = false; ["Help for: #{text}"] = false; @@ -450,6 +451,7 @@ ["This name is already taken, please choose another one!"] = false; ["This name is really too short!"] = false; ["This name is too short!"] = false; +["This report can be saved (use 'save complete website') and used offline."] = false; ["This suggestion has been meanwhile deleted"] = false; ["This title is really too short!"] = false; ["This username is too short!"] = false; diff -r 1d213e9e3456 -r a851cc1d9903 locale/translations.eo.lua --- a/locale/translations.eo.lua Tue Feb 23 21:10:56 2010 +0100 +++ b/locale/translations.eo.lua Wed Feb 24 12:37:28 2010 +0100 @@ -155,6 +155,7 @@ ["Fully frozen at"] = "Tute ĝelita je"; ["Global delegation"] = "Ĝenerala delegacio"; ["Global delegation active"] = "Ĝenerala delegacio estas aktiva"; +["Go up"] = false; ["Half frozen at"] = "Duone ĝelita je"; ["Hello "] = "Saluton "; ["Help for: #{text}"] = "Helpo por: #{text}"; @@ -450,6 +451,7 @@ ["This name is already taken, please choose another one!"] = "Tiu nomo estas jam fordonita, bonvolu elekti alian!"; ["This name is really too short!"] = "Tiu nomo estas vere tro mallonga!"; ["This name is too short!"] = "Tiu nomo estas tro mallonga!"; +["This report can be saved (use 'save complete website') and used offline."] = false; ["This suggestion has been meanwhile deleted"] = "Tiu sugesto estis intertempe forviŝita"; ["This title is really too short!"] = "Tiu titolo estas vere tro mallonga!"; ["This username is too short!"] = "Tiu salutonomo estas tro mallonga!"; diff -r 1d213e9e3456 -r a851cc1d9903 static/icons/16/go_up.png Binary file static/icons/16/go_up.png has changed diff -r 1d213e9e3456 -r a851cc1d9903 static/icons/16/resultset_next_double.png Binary file static/icons/16/resultset_next_double.png has changed diff -r 1d213e9e3456 -r a851cc1d9903 static/icons/16/resultset_previous_double.png Binary file static/icons/16/resultset_previous_double.png has changed