liquid_feedback_frontend

diff app/main/initiative/_list.lua @ 2:5c601807d397

Version alpha3

Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft

Wiki formatting for drafts

Showing differences between two drafts of the same initiative

Display of outgoing delegation chains

Many other improvements
author bsw
date Mon Nov 23 12:00:00 2009 +0100 (2009-11-23)
parents 3bfb2fcf7ab9
children 768faea1096d
line diff
     1.1 --- a/app/main/initiative/_list.lua	Wed Nov 18 12:00:00 2009 +0100
     1.2 +++ b/app/main/initiative/_list.lua	Mon Nov 23 12:00:00 2009 +0100
     1.3 @@ -52,21 +52,15 @@
     1.4        content = function()
     1.5          local initiatives = initiatives_selector:exec()
     1.6          local columns = {}
     1.7 -        local issue = initiatives[1] and initiatives[1].issue or {}
     1.8 -        if issue.accepted and issue.closed and issue.ranks_available then 
     1.9 -          columns[#columns+1] = {
    1.10 -            content = function(record)
    1.11 +        columns[#columns+1] = {
    1.12 +          content = function(record)
    1.13 +            if record.issue.accepted and record.issue.closed and record.issue.ranks_available then 
    1.14                ui.field.rank{ value = record.rank }
    1.15 -            end
    1.16 -          }
    1.17 -          columns[#columns+1] = {
    1.18 -            content = function(record)
    1.19                if record.negative_votes and record.positive_votes then
    1.20                  local max_value = record.issue.voter_count
    1.21 - trace.debug(record.issue.voter_count)
    1.22                  ui.bargraph{
    1.23                    max_value = max_value,
    1.24 -                  width = 100,
    1.25 +                  width = 200,
    1.26                    bars = {
    1.27                      { color = "#0a0", value = record.positive_votes },
    1.28                      { color = "#aaa", value = max_value - record.negative_votes - record.positive_votes },
    1.29 @@ -74,34 +68,41 @@
    1.30                    }
    1.31                  }
    1.32                end
    1.33 -            end
    1.34 -          }
    1.35 -        else
    1.36 -          columns[#columns+1] = {
    1.37 -            content = function(record)
    1.38 +            else
    1.39                local max_value = (record.issue.population or 0)
    1.40                ui.bargraph{
    1.41                  max_value = max_value,
    1.42 -                width = 100,
    1.43 +                width = 200,
    1.44                  bars = {
    1.45 -                  { color = "#0a0", value = (record.satisfied_informed_supporter_count or 0) },
    1.46 -                  { color = "#8f8", value = (record.supporter_count or 0) - (record.satisfied_informed_supporter_count or 0) },
    1.47 +                  { color = "#0a0", value = (record.satisfied_supporter_count or 0) },
    1.48 +                  { color = "#8f8", value = (record.supporter_count or 0) - (record.satisfied_supporter_count or 0) },
    1.49                    { color = "#ddd", value = max_value - (record.supporter_count or 0) },
    1.50                  }
    1.51                }
    1.52              end
    1.53 -          }
    1.54 -        end
    1.55 +          end
    1.56 +        }
    1.57          columns[#columns+1] = {
    1.58            content = function(record)
    1.59              ui.link{
    1.60                content = function()
    1.61 -                util.put_highlighted_string(record.shortened_name)
    1.62 +                local name
    1.63 +                if record.name_highlighted then
    1.64 +                  name = encode.highlight(record.name_highlighted)
    1.65 +                else
    1.66 +                  name = encode.html(record.name)
    1.67 +                end
    1.68 +                slot.put(name)
    1.69                end,
    1.70                module = "initiative",
    1.71                view = "show",
    1.72                id = record.id
    1.73              }
    1.74 +            if record.issue.state == "new" then
    1.75 +              ui.image{
    1.76 +                static = "icons/16/new.png"
    1.77 +              }
    1.78 +            end
    1.79            end
    1.80          }
    1.81  

Impressum / About Us