liquid_feedback_frontend
view 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 | 
 line source
     1 local area = Area:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec()
     3 slot.put_into("title", encode.html(_"Area '#{name}'":gsub("#{name}", area.name)))
     5 ui.container{
     6   attr = { class = "vertical"},
     7   content = function()
     8     ui.field.text{ value = area.description }
     9   end
    10 }
    13 slot.select("actions", function()
    14   ui.link{
    15     content = function()
    16       ui.image{ static = "icons/16/folder_add.png" }
    17       slot.put(_"Create new issue")
    18     end,
    19     module = "initiative",
    20     view = "new",
    21     params = { area_id = area.id }
    22   }
    23 end)
    25 util.help("area.show")
    27 execute.view{
    28   module = "membership",
    29   view = "_show_box",
    30   params = { area = area }
    31 }
    33 execute.view{
    34   module = "delegation",
    35   view = "_show_box",
    36   params = { area_id = area.id }
    37 }
    39 --[[
    40 for i, issue in ipairs(area.issues) do
    41   local head_name = "issue_head_content_" .. tostring(issue.id)
    42   local name = "issue_content_" .. tostring(issue.id)
    43   local icon_name = "issue_icon_" .. tostring(issue.id)
    44   ui.container{
    45     attr = { class = "ui_tabs" },
    46     content = function()
    47       local onclick = 
    48         'if (ui_tabs_active["' .. name .. '"]) {' ..
    49           'el=document.getElementById("' .. name .. '");' ..
    50           'el.innerHTML="";' ..
    51           'el.style.display="none";' ..
    52           'ui_tabs_active["' .. name .. '"]=false' ..
    53         '} else {' ..
    54           'ui_tabs_active["' .. name .. '"]=true;' ..
    55           'document.getElementById("' .. name .. '").style.display="block"; ' ..
    56           'var hourglass_el = document.getElementById("' .. icon_name .. '");' ..
    57           'var hourglass_src = hourglass_el.src;' ..
    58           'hourglass_el.src = "' .. encode.url{ static = "icons/16/connect.png" } .. '";' ..
    59           'partialMultiLoad(' ..
    60             '{ trace: "trace", system_error: "system_error", ' .. name .. '_title: "title", ' .. name .. '_actions: "actions", ' .. name .. '_content: "default" },' ..
    61             '{},' ..
    62             '"error",' ..
    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",' ..
    64             '{},' ..
    65             '{},' ..
    66             'function() {' ..
    67               'hourglass_el.src = hourglass_src;' ..
    68             '},' ..
    69             'function() {' ..
    70               'hourglass_el.src = hourglass_src;' ..
    71             '}' ..
    72           '); ' ..
    73         '}' ..
    74         'return(false);'
    75       ui.link{
    76         attr = {
    77           name = name,
    78           class = "ui_tabs_accordeon_head",
    79           id = head_name,
    80           onclick = onclick,
    81         },
    82         module  = "issue",
    83         view    = "show",
    84         id      = issue.id,
    85         params  = params,
    86         anchor  = name,
    87         content = function()
    88           ui.image{
    89             attr = { id = icon_name },
    90             static = "icons/16/script.png"
    91           }
    92           ui.container{
    93             attr = { style = "float: right;" },
    94             content = function()
    96             end
    97           }
    98           slot.put(tostring(issue.id))
    99         end
   100       }
   101     end
   102   }
   104   ui.container{
   105     attr = {
   106       id = name,
   107       class = "ui_tabs_accordeon_content",
   108     },
   109     content = function()
   110       ui.container{ attr = { id = name .. "_title",   }, content = function() slot.put(" ") end }
   111       ui.container{ attr = { id = name .. "_actions", }, content = function() slot.put(" ") end }
   112       ui.container{ attr = { id = name .. "_content", }, content = function() 
   113         execute.view{
   114           module = "initiative",
   115           view = "_list",
   116           params = {
   117             issue = issue,
   118             initiatives_selector = issue:get_reference_selector("initiatives"),
   119             limit = 3,
   120             per_page = 3,
   121             no_sort = true,
   122           }
   123         }
   124       end }
   125     end
   126   }
   128   if config.user_tab_mode == "accordeon_all_expanded" then
   129     ui.script{ script = 'document.getElementById("' .. head_name .. '").onclick();' }
   130   end
   131 end
   132 --]]
   134 execute.view{
   135   module = "area",
   136   view = "show_tab",
   137   params = { area = area }
   138 }
