liquid_feedback_frontend
annotate app/main/area/show.lua @ 19:00d1004545f1
Dynamic interface using XMLHttpRequests, and many other changes
Bugfixes:
- Only allow voting on admitted initiatives
- Repaired issue search
- Don't display delegations for closed issues on member page
- Don't show revoke link in initiative, when issue is already half_frozen
- Localization for voting JavaScript
- Display author of suggestions
Disclosure of voting data after voting is finished:
- Possibility to inspect every ballot including preferences
- Show number of voters preferring one initiative to another initiative
Interface behaviour changes:
- Reversed default order of drafts
- Default order of suggestions changed
- Show new drafts of initiatives only once per day in timeline
Accessibility:
- Barrier-free voting implemented
- POST links are now accessible without JavaScript
- Changed gray for unsatisfied supporters in bar graph to a lighter gray
Other interface improvements:
- Optical enhancements
- Dynamic interface using XMLHttpRequests
- Show usage terms in about section
- Show own membership in area listing
- Show uninformed supporters greyed out and marked with yellow question mark
- Warning box in non-admitted initiatives
- When voted, don't display voting notice and change label of voting link
- Show object counts in more tabulator heads
- Enlarged member statement input field
Miscellaneous:
- Code cleanup
- Added README file containing installation instructions
- Use new WebMCP function ui.filters{...} instead of own ui.filter and ui.order functions
Bugfixes:
- Only allow voting on admitted initiatives
- Repaired issue search
- Don't display delegations for closed issues on member page
- Don't show revoke link in initiative, when issue is already half_frozen
- Localization for voting JavaScript
- Display author of suggestions
Disclosure of voting data after voting is finished:
- Possibility to inspect every ballot including preferences
- Show number of voters preferring one initiative to another initiative
Interface behaviour changes:
- Reversed default order of drafts
- Default order of suggestions changed
- Show new drafts of initiatives only once per day in timeline
Accessibility:
- Barrier-free voting implemented
- POST links are now accessible without JavaScript
- Changed gray for unsatisfied supporters in bar graph to a lighter gray
Other interface improvements:
- Optical enhancements
- Dynamic interface using XMLHttpRequests
- Show usage terms in about section
- Show own membership in area listing
- Show uninformed supporters greyed out and marked with yellow question mark
- Warning box in non-admitted initiatives
- When voted, don't display voting notice and change label of voting link
- Show object counts in more tabulator heads
- Enlarged member statement input field
Miscellaneous:
- Code cleanup
- Added README file containing installation instructions
- Use new WebMCP function ui.filters{...} instead of own ui.filter and ui.order functions
author | bsw/jbe |
---|---|
date | Sat Feb 20 22:10:31 2010 +0100 (2010-02-20) |
parents | 80c215dbf076 |
children | 0849be391140 |
rev | line source |
---|---|
bsw/jbe@0 | 1 local area = Area:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec() |
bsw/jbe@0 | 2 |
bsw/jbe@0 | 3 slot.put_into("title", encode.html(_"Area '#{name}'":gsub("#{name}", area.name))) |
bsw/jbe@0 | 4 |
bsw/jbe@0 | 5 ui.container{ |
bsw/jbe@0 | 6 attr = { class = "vertical"}, |
bsw/jbe@0 | 7 content = function() |
bsw/jbe@0 | 8 ui.field.text{ value = area.description } |
bsw/jbe@0 | 9 end |
bsw/jbe@0 | 10 } |
bsw/jbe@0 | 11 |
bsw/jbe@0 | 12 |
bsw/jbe@0 | 13 slot.select("actions", function() |
bsw/jbe@0 | 14 ui.link{ |
bsw/jbe@0 | 15 content = function() |
bsw@2 | 16 ui.image{ static = "icons/16/folder_add.png" } |
bsw@2 | 17 slot.put(_"Create new issue") |
bsw/jbe@0 | 18 end, |
bsw@2 | 19 module = "initiative", |
bsw/jbe@0 | 20 view = "new", |
bsw/jbe@0 | 21 params = { area_id = area.id } |
bsw/jbe@0 | 22 } |
bsw/jbe@0 | 23 end) |
bsw/jbe@0 | 24 |
bsw/jbe@4 | 25 util.help("area.show") |
bsw/jbe@4 | 26 |
bsw/jbe@0 | 27 execute.view{ |
bsw/jbe@0 | 28 module = "membership", |
bsw/jbe@0 | 29 view = "_show_box", |
bsw/jbe@0 | 30 params = { area = area } |
bsw/jbe@0 | 31 } |
bsw/jbe@0 | 32 |
bsw/jbe@0 | 33 execute.view{ |
bsw/jbe@0 | 34 module = "delegation", |
bsw/jbe@0 | 35 view = "_show_box", |
bsw/jbe@0 | 36 params = { area_id = area.id } |
bsw/jbe@0 | 37 } |
bsw/jbe@0 | 38 |
bsw/jbe@19 | 39 --[[ |
bsw/jbe@19 | 40 for i, issue in ipairs(area.issues) do |
bsw/jbe@19 | 41 local head_name = "issue_head_content_" .. tostring(issue.id) |
bsw/jbe@19 | 42 local name = "issue_content_" .. tostring(issue.id) |
bsw/jbe@19 | 43 local icon_name = "issue_icon_" .. tostring(issue.id) |
bsw/jbe@19 | 44 ui.container{ |
bsw/jbe@19 | 45 attr = { class = "ui_tabs" }, |
bsw/jbe@0 | 46 content = function() |
bsw/jbe@19 | 47 local onclick = |
bsw/jbe@19 | 48 'if (ui_tabs_active["' .. name .. '"]) {' .. |
bsw/jbe@19 | 49 'el=document.getElementById("' .. name .. '");' .. |
bsw/jbe@19 | 50 'el.innerHTML="";' .. |
bsw/jbe@19 | 51 'el.style.display="none";' .. |
bsw/jbe@19 | 52 'ui_tabs_active["' .. name .. '"]=false' .. |
bsw/jbe@19 | 53 '} else {' .. |
bsw/jbe@19 | 54 'ui_tabs_active["' .. name .. '"]=true;' .. |
bsw/jbe@19 | 55 'document.getElementById("' .. name .. '").style.display="block"; ' .. |
bsw/jbe@19 | 56 'var hourglass_el = document.getElementById("' .. icon_name .. '");' .. |
bsw/jbe@19 | 57 'var hourglass_src = hourglass_el.src;' .. |
bsw/jbe@19 | 58 'hourglass_el.src = "' .. encode.url{ static = "icons/16/connect.png" } .. '";' .. |
bsw/jbe@19 | 59 'partialMultiLoad(' .. |
bsw/jbe@19 | 60 '{ trace: "trace", system_error: "system_error", ' .. name .. '_title: "title", ' .. name .. '_actions: "actions", ' .. name .. '_content: "default" },' .. |
bsw/jbe@19 | 61 '{},' .. |
bsw/jbe@19 | 62 '"error",' .. |
bsw/jbe@19 | 63 '"' .. request.get_relative_baseurl() .. 'issue/show/' .. tostring(issue.id) .. '.html?&_webmcp_json_slots[]=title&_webmcp_json_slots[]=actions&_webmcp_json_slots[]=default&_webmcp_json_slots[]=trace&_webmcp_json_slots[]=system_error&dyn=1",' .. |
bsw/jbe@19 | 64 '{},' .. |
bsw/jbe@19 | 65 '{},' .. |
bsw/jbe@19 | 66 'function() {' .. |
bsw/jbe@19 | 67 'hourglass_el.src = hourglass_src;' .. |
bsw/jbe@19 | 68 '},' .. |
bsw/jbe@19 | 69 'function() {' .. |
bsw/jbe@19 | 70 'hourglass_el.src = hourglass_src;' .. |
bsw/jbe@19 | 71 '}' .. |
bsw/jbe@19 | 72 '); ' .. |
bsw/jbe@19 | 73 '}' .. |
bsw/jbe@19 | 74 'return(false);' |
bsw/jbe@19 | 75 ui.link{ |
bsw/jbe@19 | 76 attr = { |
bsw/jbe@19 | 77 name = name, |
bsw/jbe@19 | 78 class = "ui_tabs_accordeon_head", |
bsw/jbe@19 | 79 id = head_name, |
bsw/jbe@19 | 80 onclick = onclick, |
bsw/jbe@19 | 81 }, |
bsw/jbe@19 | 82 module = "issue", |
bsw/jbe@19 | 83 view = "show", |
bsw/jbe@19 | 84 id = issue.id, |
bsw/jbe@19 | 85 params = params, |
bsw/jbe@19 | 86 anchor = name, |
bsw/jbe@19 | 87 content = function() |
bsw/jbe@19 | 88 ui.image{ |
bsw/jbe@19 | 89 attr = { id = icon_name }, |
bsw/jbe@19 | 90 static = "icons/16/script.png" |
bsw/jbe@19 | 91 } |
bsw/jbe@19 | 92 ui.container{ |
bsw/jbe@19 | 93 attr = { style = "float: right;" }, |
bsw/jbe@19 | 94 content = function() |
bsw/jbe@19 | 95 |
bsw/jbe@19 | 96 end |
bsw/jbe@19 | 97 } |
bsw/jbe@19 | 98 slot.put(tostring(issue.id)) |
bsw/jbe@19 | 99 end |
bsw/jbe@0 | 100 } |
bsw/jbe@0 | 101 end |
bsw/jbe@19 | 102 } |
bsw/jbe@19 | 103 |
bsw/jbe@19 | 104 ui.container{ |
bsw/jbe@19 | 105 attr = { |
bsw/jbe@19 | 106 id = name, |
bsw/jbe@19 | 107 class = "ui_tabs_accordeon_content", |
bsw/jbe@19 | 108 }, |
bsw/jbe@0 | 109 content = function() |
bsw/jbe@19 | 110 ui.container{ attr = { id = name .. "_title", }, content = function() slot.put(" ") end } |
bsw/jbe@19 | 111 ui.container{ attr = { id = name .. "_actions", }, content = function() slot.put(" ") end } |
bsw/jbe@19 | 112 ui.container{ attr = { id = name .. "_content", }, content = function() |
bsw/jbe@19 | 113 execute.view{ |
bsw/jbe@19 | 114 module = "initiative", |
bsw/jbe@19 | 115 view = "_list", |
bsw/jbe@19 | 116 params = { |
bsw/jbe@19 | 117 issue = issue, |
bsw/jbe@19 | 118 initiatives_selector = issue:get_reference_selector("initiatives"), |
bsw/jbe@19 | 119 limit = 3, |
bsw/jbe@19 | 120 per_page = 3, |
bsw/jbe@19 | 121 no_sort = true, |
bsw/jbe@19 | 122 } |
bsw/jbe@19 | 123 } |
bsw/jbe@19 | 124 end } |
bsw/jbe@0 | 125 end |
bsw/jbe@19 | 126 } |
bsw/jbe@19 | 127 |
bsw/jbe@19 | 128 if config.user_tab_mode == "accordeon_all_expanded" then |
bsw/jbe@19 | 129 ui.script{ script = 'document.getElementById("' .. head_name .. '").onclick();' } |
bsw/jbe@19 | 130 end |
bsw/jbe@19 | 131 end |
bsw/jbe@19 | 132 --]] |
bsw/jbe@19 | 133 |
bsw/jbe@19 | 134 execute.view{ |
bsw/jbe@19 | 135 module = "area", |
bsw/jbe@19 | 136 view = "show_tab", |
bsw/jbe@19 | 137 params = { area = area } |
bsw/jbe@0 | 138 } |
bsw/jbe@0 | 139 |