liquid_feedback_frontend

diff app/main/vote/_action/update.lua @ 26:3036f2732b83

Allow discarding own voting
author bsw
date Sun Feb 21 15:11:48 2010 +0100 (2010-02-21)
parents 00d1004545f1
children ec86db506312
line diff
     1.1 --- a/app/main/vote/_action/update.lua	Sun Feb 21 14:23:56 2010 +0100
     1.2 +++ b/app/main/vote/_action/update.lua	Sun Feb 21 15:11:48 2010 +0100
     1.3 @@ -10,12 +10,22 @@
     1.4    return false
     1.5  end
     1.6  
     1.7 +
     1.8 +
     1.9  local move_up = param.get("move_up", atom.integer)
    1.10  local move_down = param.get("move_down", atom.integer)
    1.11  
    1.12  if not move_down and not move_up then
    1.13    local direct_voter = DirectVoter:by_pk(issue.id, app.session.member_id)
    1.14  
    1.15 +  if param.get("discard", atom.boolean) then
    1.16 +    if direct_voter then
    1.17 +      direct_voter:destroy()
    1.18 +    end
    1.19 +    slot.put_into("notice", _"Your vote has been discarded. Delegation rules apply if set.")
    1.20 +    return
    1.21 +  end
    1.22 +
    1.23    if not direct_voter then
    1.24      direct_voter = DirectVoter:new()
    1.25      direct_voter.issue_id = issue.id

Impressum / About Us