# HG changeset patch # User bsw # Date 1266761508 -3600 # Node ID 3036f2732b83a401d84723d34160babae071e2cc # Parent 4b2af207cefafb0c0f0f1d5f0d16b2d880435533 Allow discarding own voting diff -r 4b2af207cefa -r 3036f2732b83 app/main/vote/_action/update.lua --- a/app/main/vote/_action/update.lua Sun Feb 21 14:23:56 2010 +0100 +++ b/app/main/vote/_action/update.lua Sun Feb 21 15:11:48 2010 +0100 @@ -10,12 +10,22 @@ return false end + + local move_up = param.get("move_up", atom.integer) local move_down = param.get("move_down", atom.integer) if not move_down and not move_up then local direct_voter = DirectVoter:by_pk(issue.id, app.session.member_id) + if param.get("discard", atom.boolean) then + if direct_voter then + direct_voter:destroy() + end + slot.put_into("notice", _"Your vote has been discarded. Delegation rules apply if set.") + return + end + if not direct_voter then direct_voter = DirectVoter:new() direct_voter.issue_id = issue.id diff -r 4b2af207cefa -r 3036f2732b83 app/main/vote/list.lua --- a/app/main/vote/list.lua Sun Feb 21 14:23:56 2010 +0100 +++ b/app/main/vote/list.lua Sun Feb 21 15:11:48 2010 +0100 @@ -31,8 +31,27 @@ view = "show", id = issue.id } + ui.link{ + content = function() + ui.image{ static = "icons/16/email_delete.png" } + slot.put(_"Discard voting") + end, + module = "vote", + action = "update", + params = { + issue_id = issue.id, + discard = true + }, + routing = { + default = { + mode = "redirect", + module = "issue", + view = "show", + id = issue.id + } + } + } end) - end diff -r 4b2af207cefa -r 3036f2732b83 locale/translations.de.lua --- a/locale/translations.de.lua Sun Feb 21 14:23:56 2010 +0100 +++ b/locale/translations.de.lua Sun Feb 21 15:11:48 2010 +0100 @@ -118,6 +118,7 @@ ["Disapproval (prefer to lower blocks) [single entry]"] = "Ablehnung (jedoch Bevorzugung gegenüber unteren Ablehnungsblöcken)"; ["Disapproval [many entries]"] = "Ablehnung"; ["Disapproval [single entry]"] = "Ablehnung"; +["Discard voting"] = "Abstimmung zurückziehen"; ["Discussion"] = "Diskussion"; ["Discussion URL"] = "Diskussions-URL"; ["Discussion on issue"] = "Diskussion zum Thema"; @@ -271,6 +272,7 @@ ["No membership at all"] = "Gar keine Mitgliedschaft"; ["No support at all"] = "Gar keine Unterstützung"; ["Not a member"] = "Kein Mitglied"; +["Not approved"] = "Nicht zugelassen"; ["Not approved (rank #{rank})"] = "Nicht angenommen (Rang #{rank})"; ["Not voted"] = "Nicht abgestimmt"; ["Not voted (not admitted)"] = "Nicht abgestimmt (nicht zugelassen)"; @@ -518,6 +520,7 @@ ["Your support has been added to this initiative"] = "Deine Unterstützung wurde der Initiative hinzugefügt"; ["Your support has been removed from this initiative"] = "Deine Unterstützung wurde der Initiave entzogen"; ["Your support has been updated to the latest draft"] = "Deine Unterstützung wurde auf den neuesten Entwurf aktualisiert"; +["Your vote has been discarded. Delegation rules apply if set."] = "Deine Abstimmung wurde zurückgezogen. Delegationsregeln gelten sofern gesetzt."; ["Your web browser is not fully supported yet."] = "Dein Web-Browser wird noch nicht vollständig unterstützt."; ["Z-A"] = "Z-A"; ["and #{count} more initiatives"] = "und #{count} weitere Initiativen"; diff -r 4b2af207cefa -r 3036f2732b83 locale/translations.eo.lua --- a/locale/translations.eo.lua Sun Feb 21 14:23:56 2010 +0100 +++ b/locale/translations.eo.lua Sun Feb 21 15:11:48 2010 +0100 @@ -118,6 +118,7 @@ ["Disapproval (prefer to lower blocks) [single entry]"] = false; ["Disapproval [many entries]"] = false; ["Disapproval [single entry]"] = false; +["Discard voting"] = false; ["Discussion"] = "Diskuto"; ["Discussion URL"] = "Diskuto-URL"; ["Discussion on issue"] = "Diskuto pri la temo"; @@ -271,6 +272,7 @@ ["No membership at all"] = "Tute sen membreco"; ["No support at all"] = "Tute sen subteno"; ["Not a member"] = "Ne estas membro"; +["Not approved"] = false; ["Not approved (rank #{rank})"] = false; ["Not voted"] = "Ne balotinta"; ["Not voted (not admitted)"] = false; @@ -518,6 +520,7 @@ ["Your support has been added to this initiative"] = "Via subteno estas aldonita al la iniciato"; ["Your support has been removed from this initiative"] = "Via subteno estas forigita de la iniciato"; ["Your support has been updated to the latest draft"] = "Via subteno estas ĝisdatigita al la plej nova skizo"; +["Your vote has been discarded. Delegation rules apply if set."] = false; ["Your web browser is not fully supported yet."] = "Via retumilo ne estas jam komplete subtenita."; ["Z-A"] = "Z-A"; ["and #{count} more initiatives"] = "kaj #{count} pliaj iniciatoj"; diff -r 4b2af207cefa -r 3036f2732b83 static/icons/16/email_delete.png Binary file static/icons/16/email_delete.png has changed