liquid_feedback_frontend

diff 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
author bsw/jbe
date Sat Feb 20 22:10:31 2010 +0100 (2010-02-20)
parents 80c215dbf076
children 0849be391140
line diff
     1.1 --- a/app/main/area/show.lua	Tue Feb 02 00:31:06 2010 +0100
     1.2 +++ b/app/main/area/show.lua	Sat Feb 20 22:10:31 2010 +0100
     1.3 @@ -36,39 +36,104 @@
     1.4    params = { area_id = area.id }
     1.5  }
     1.6  
     1.7 -ui.tabs{
     1.8 -  {
     1.9 -    name = "issues",
    1.10 -    label = _"Issues",
    1.11 +--[[
    1.12 +for i, issue in ipairs(area.issues) do
    1.13 +  local head_name = "issue_head_content_" .. tostring(issue.id)
    1.14 +  local name = "issue_content_" .. tostring(issue.id)
    1.15 +  local icon_name = "issue_icon_" .. tostring(issue.id)
    1.16 +  ui.container{
    1.17 +    attr = { class = "ui_tabs" },
    1.18      content = function()
    1.19 -      execute.view{
    1.20 -        module = "issue",
    1.21 -        view = "_list",
    1.22 -        params = { issues_selector = area:get_reference_selector("issues"), for_area_list = true }
    1.23 +      local onclick = 
    1.24 +        'if (ui_tabs_active["' .. name .. '"]) {' ..
    1.25 +          'el=document.getElementById("' .. name .. '");' ..
    1.26 +          'el.innerHTML="";' ..
    1.27 +          'el.style.display="none";' ..
    1.28 +          'ui_tabs_active["' .. name .. '"]=false' ..
    1.29 +        '} else {' ..
    1.30 +          'ui_tabs_active["' .. name .. '"]=true;' ..
    1.31 +          'document.getElementById("' .. name .. '").style.display="block"; ' ..
    1.32 +          'var hourglass_el = document.getElementById("' .. icon_name .. '");' ..
    1.33 +          'var hourglass_src = hourglass_el.src;' ..
    1.34 +          'hourglass_el.src = "' .. encode.url{ static = "icons/16/connect.png" } .. '";' ..
    1.35 +          'partialMultiLoad(' ..
    1.36 +            '{ trace: "trace", system_error: "system_error", ' .. name .. '_title: "title", ' .. name .. '_actions: "actions", ' .. name .. '_content: "default" },' ..
    1.37 +            '{},' ..
    1.38 +            '"error",' ..
    1.39 +            '"' .. 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",' ..
    1.40 +            '{},' ..
    1.41 +            '{},' ..
    1.42 +            'function() {' ..
    1.43 +              'hourglass_el.src = hourglass_src;' ..
    1.44 +            '},' ..
    1.45 +            'function() {' ..
    1.46 +              'hourglass_el.src = hourglass_src;' ..
    1.47 +            '}' ..
    1.48 +          '); ' ..
    1.49 +        '}' ..
    1.50 +        'return(false);'
    1.51 +      ui.link{
    1.52 +        attr = {
    1.53 +          name = name,
    1.54 +          class = "ui_tabs_accordeon_head",
    1.55 +          id = head_name,
    1.56 +          onclick = onclick,
    1.57 +        },
    1.58 +        module  = "issue",
    1.59 +        view    = "show",
    1.60 +        id      = issue.id,
    1.61 +        params  = params,
    1.62 +        anchor  = name,
    1.63 +        content = function()
    1.64 +          ui.image{
    1.65 +            attr = { id = icon_name },
    1.66 +            static = "icons/16/script.png"
    1.67 +          }
    1.68 +          ui.container{
    1.69 +            attr = { style = "float: right;" },
    1.70 +            content = function()
    1.71 +              
    1.72 +            end
    1.73 +          }
    1.74 +          slot.put(tostring(issue.id))
    1.75 +        end
    1.76        }
    1.77      end
    1.78 -  },
    1.79 -  {
    1.80 -    name = "members",
    1.81 -    label = _"Members",
    1.82 +  }
    1.83 +
    1.84 +  ui.container{
    1.85 +    attr = {
    1.86 +      id = name,
    1.87 +      class = "ui_tabs_accordeon_content",
    1.88 +    },
    1.89      content = function()
    1.90 -      execute.view{
    1.91 -        module = "member",
    1.92 -        view = "_list",
    1.93 -        params = { members_selector = area:get_reference_selector("members") }
    1.94 -      }
    1.95 +      ui.container{ attr = { id = name .. "_title",   }, content = function() slot.put(" ") end }
    1.96 +      ui.container{ attr = { id = name .. "_actions", }, content = function() slot.put(" ") end }
    1.97 +      ui.container{ attr = { id = name .. "_content", }, content = function() 
    1.98 +        execute.view{
    1.99 +          module = "initiative",
   1.100 +          view = "_list",
   1.101 +          params = {
   1.102 +            issue = issue,
   1.103 +            initiatives_selector = issue:get_reference_selector("initiatives"),
   1.104 +            limit = 3,
   1.105 +            per_page = 3,
   1.106 +            no_sort = true,
   1.107 +          }
   1.108 +        }
   1.109 +      end }
   1.110      end
   1.111 -  },
   1.112 -  {
   1.113 -    name = "delegations",
   1.114 -    label = _"Delegations",
   1.115 -    content = function()
   1.116 -      execute.view{
   1.117 -        module = "delegation",
   1.118 -        view = "_list",
   1.119 -        params = { delegations_selector = area:get_reference_selector("delegations") }
   1.120 -      }
   1.121 -    end
   1.122 -  },
   1.123 +  }
   1.124 +
   1.125 +  if config.user_tab_mode == "accordeon_all_expanded" then
   1.126 +    ui.script{ script = 'document.getElementById("' .. head_name .. '").onclick();' }
   1.127 +  end
   1.128 +end
   1.129 +--]]
   1.130 +
   1.131 +execute.view{
   1.132 +  module = "area",
   1.133 +  view = "show_tab",
   1.134 +  params = { area = area }
   1.135  }
   1.136  

Impressum / About Us