liquid_feedback_frontend

diff app/main/issue/show.lua @ 16:559c6be0e1e9

"Vote later" feature; Refactored interest box
author bsw
date Tue Feb 02 00:10:17 2010 +0100 (2010-02-02)
parents afd9f769c7ae
children 00d1004545f1
line diff
     1.1 --- a/app/main/issue/show.lua	Sun Jan 31 22:34:45 2010 +0100
     1.2 +++ b/app/main/issue/show.lua	Tue Feb 02 00:10:17 2010 +0100
     1.3 @@ -8,6 +8,12 @@
     1.4  
     1.5  util.help("issue.show")
     1.6  
     1.7 +local voting_requested_percentage = 0
     1.8 +if issue.vote_later and issue.population and issue.population > 0 then
     1.9 +  voting_requested_percentage = math.ceil(issue.vote_later  / issue.population * 100)
    1.10 +end
    1.11 +local voting_requested_string = "(" .. tostring(voting_requested_percentage) .. "%)"
    1.12 +
    1.13  ui.tabs{
    1.14    {
    1.15      name = "initiatives",
    1.16 @@ -36,18 +42,6 @@
    1.17        end
    1.18      end
    1.19    },
    1.20 ---[[  {
    1.21 -    name = "voting_requests",
    1.22 -    label = _"Voting requests",
    1.23 -    content = function()
    1.24 -      execute.view{
    1.25 -        module = "issue_voting_request",
    1.26 -        view = "_list",
    1.27 -        params = { issue = issue }
    1.28 -      }
    1.29 -    end
    1.30 -  },
    1.31 ---]]
    1.32    {
    1.33      name = "interested_members",
    1.34      label = _"Interested members",
    1.35 @@ -77,6 +71,22 @@
    1.36      end
    1.37    },
    1.38    {
    1.39 +    name = "voting_requests",
    1.40 +    label = _"Vote later requests" .. " " .. voting_requested_string,
    1.41 +    content = function()
    1.42 +      execute.view{
    1.43 +        module = "member",
    1.44 +        view = "_list",
    1.45 +        params = {
    1.46 +          issue = issue,
    1.47 +          members_selector =  issue:get_reference_selector("interested_members_snapshot")
    1.48 +            :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id")
    1.49 +            :add_where("direct_interest_snapshot.voting_requested = false")
    1.50 +        }
    1.51 +      }
    1.52 +    end
    1.53 +  },
    1.54 +  {
    1.55      name = "details",
    1.56      label = _"Details",
    1.57      content = function()

Impressum / About Us