liquid_feedback_frontend

diff app/main/initiative/show.lua @ 5:afd9f769c7ae

Version beta1

Final voting with Schulze-Method is now possible

Many bug fixes and code cleanup

Registration with invite codes

More sort and filter options

Seperated display of "supporters" and "potential supporters"

Optical changes

Flood limit / initiative contigent is now checked by frontend

Neccessary changes to access core beta11
author bsw/jbe
date Fri Dec 25 12:00:00 2009 +0100 (2009-12-25)
parents 80c215dbf076
children 8d91bccab0bf
line diff
     1.1 --- a/app/main/initiative/show.lua	Thu Dec 10 12:00:00 2009 +0100
     1.2 +++ b/app/main/initiative/show.lua	Fri Dec 25 12:00:00 2009 +0100
     1.3 @@ -1,6 +1,16 @@
     1.4  local initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
     1.5  
     1.6 -
     1.7 +slot.select("actions", function()
     1.8 +  ui.link{
     1.9 +    content = function()
    1.10 +      ui.image{ static = "icons/16/script.png" }
    1.11 +      slot.put(_"Show all initiatives")
    1.12 +    end,
    1.13 +    module = "issue",
    1.14 +    view = "show",
    1.15 +    id = initiative.issue.id
    1.16 +  }
    1.17 +end)
    1.18  
    1.19  execute.view{
    1.20    module = "issue",
    1.21 @@ -18,55 +28,11 @@
    1.22    params = { initiative = initiative }
    1.23  }
    1.24  
    1.25 ---[[
    1.26 -
    1.27 -execute.view{
    1.28 -  module = "delegation",
    1.29 -  view = "_show_box",
    1.30 -  params = { issue_id = initiative.issue_id }
    1.31 -}
    1.32 -
    1.33 -execute.view{
    1.34 -  module = "issue",
    1.35 -  view = "_show_box",
    1.36 -  params = { issue = initiative.issue }
    1.37 -}
    1.38 -
    1.39 -
    1.40 -slot.select("path", function()
    1.41 -  ui.link{
    1.42 -    content = _"Area '#{name}'":gsub("#{name}", initiative.issue.area.name),
    1.43 -    module = "area",
    1.44 -    view = "show",
    1.45 -    id = initiative.issue.area.id
    1.46 -  }
    1.47 -  ui.container{ content = "::" }
    1.48 -  ui.link{
    1.49 -    content = _"Issue ##{id}":gsub("#{id}", initiative.issue.id),
    1.50 -    module = "issue",
    1.51 -    view = "show",
    1.52 -    id = initiative.issue.id
    1.53 -  }
    1.54 -end)
    1.55 -
    1.56 -slot.put_into("title", encode.html(_"Initiative: '#{name}'":gsub("#{name}", initiative.shortened_name) ))
    1.57 ---]]
    1.58 -
    1.59  slot.put_into("sub_title", encode.html(_"Initiative: '#{name}'":gsub("#{name}", initiative.shortened_name) ))
    1.60  
    1.61  slot.select("actions", function()
    1.62 -
    1.63    if not initiative.issue.fully_frozen and not initiative.issue.closed then
    1.64      ui.link{
    1.65 -      content = function()
    1.66 -        ui.image{ static = "icons/16/script.png" }
    1.67 -        slot.put(_"Show other initiatives")
    1.68 -      end,
    1.69 -      module = "issue",
    1.70 -      view = "show",
    1.71 -      id = initiative.issue.id
    1.72 -    }
    1.73 -    ui.link{
    1.74        attr = { class = "action" },
    1.75        content = function()
    1.76          ui.image{ static = "icons/16/script_add.png" }
    1.77 @@ -77,8 +43,6 @@
    1.78        params = { issue_id = initiative.issue.id }
    1.79      }
    1.80    end
    1.81 ---  ui.twitter("http://example.com/i" .. tostring(initiative.id) .. " " .. initiative.name)
    1.82 -
    1.83  end)
    1.84  
    1.85  
    1.86 @@ -99,7 +63,7 @@
    1.87            ui.link{
    1.88              attr = {
    1.89                class = "actions",
    1.90 -              target = _"blank",
    1.91 +              target = "_blank",
    1.92                title = initiative.discussion_url
    1.93              },
    1.94              content = function()
    1.95 @@ -256,7 +220,7 @@
    1.96          }
    1.97        }
    1.98        slot.put("<br />")
    1.99 -      if not initiative.issue.frozen and not initiative.issue.closed then
   1.100 +      if not initiative.issue.fully_frozen and not initiative.issue.closed then
   1.101          ui.link{
   1.102            content = function()
   1.103              ui.image{ static = "icons/16/comment_add.png" }
   1.104 @@ -269,7 +233,7 @@
   1.105      end
   1.106    },
   1.107    {
   1.108 -    name = "supporter",
   1.109 +    name = "satisfied_supporter",
   1.110      label = _"Supporter",
   1.111      content = function()
   1.112        execute.view{
   1.113 @@ -282,6 +246,26 @@
   1.114              :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id")
   1.115              :add_field("direct_interest_snapshot.weight")
   1.116              :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event")
   1.117 +            :add_where("direct_supporter_snapshot.satisfied")
   1.118 +        }
   1.119 +      }
   1.120 +    end
   1.121 +  },
   1.122 +  {
   1.123 +    name = "supporter",
   1.124 +    label = _"Potential supporter",
   1.125 +    content = function()
   1.126 +      execute.view{
   1.127 +        module = "member",
   1.128 +        view = "_list",
   1.129 +        params = {
   1.130 +          initiative = initiative,
   1.131 +          members_selector =  initiative:get_reference_selector("supporting_members_snapshot")
   1.132 +            :join("issue", nil, "issue.id = direct_supporter_snapshot.issue_id")
   1.133 +            :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id")
   1.134 +            :add_field("direct_interest_snapshot.weight")
   1.135 +            :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event")
   1.136 +            :add_where("NOT direct_supporter_snapshot.satisfied")
   1.137          }
   1.138        }
   1.139      end

Impressum / About Us