liquid_feedback_frontend
changeset 26:3036f2732b83
Allow discarding own voting
author | bsw |
---|---|
date | Sun Feb 21 15:11:48 2010 +0100 (2010-02-21) |
parents | 4b2af207cefa |
children | 0929c483458e |
files | app/main/vote/_action/update.lua app/main/vote/list.lua locale/translations.de.lua locale/translations.eo.lua static/icons/16/email_delete.png |
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
2.1 --- a/app/main/vote/list.lua Sun Feb 21 14:23:56 2010 +0100 2.2 +++ b/app/main/vote/list.lua Sun Feb 21 15:11:48 2010 +0100 2.3 @@ -31,8 +31,27 @@ 2.4 view = "show", 2.5 id = issue.id 2.6 } 2.7 + ui.link{ 2.8 + content = function() 2.9 + ui.image{ static = "icons/16/email_delete.png" } 2.10 + slot.put(_"Discard voting") 2.11 + end, 2.12 + module = "vote", 2.13 + action = "update", 2.14 + params = { 2.15 + issue_id = issue.id, 2.16 + discard = true 2.17 + }, 2.18 + routing = { 2.19 + default = { 2.20 + mode = "redirect", 2.21 + module = "issue", 2.22 + view = "show", 2.23 + id = issue.id 2.24 + } 2.25 + } 2.26 + } 2.27 end) 2.28 - 2.29 end 2.30 2.31
3.1 --- a/locale/translations.de.lua Sun Feb 21 14:23:56 2010 +0100 3.2 +++ b/locale/translations.de.lua Sun Feb 21 15:11:48 2010 +0100 3.3 @@ -118,6 +118,7 @@ 3.4 ["Disapproval (prefer to lower blocks) [single entry]"] = "Ablehnung (jedoch Bevorzugung gegenüber unteren Ablehnungsblöcken)"; 3.5 ["Disapproval [many entries]"] = "Ablehnung"; 3.6 ["Disapproval [single entry]"] = "Ablehnung"; 3.7 +["Discard voting"] = "Abstimmung zurückziehen"; 3.8 ["Discussion"] = "Diskussion"; 3.9 ["Discussion URL"] = "Diskussions-URL"; 3.10 ["Discussion on issue"] = "Diskussion zum Thema"; 3.11 @@ -271,6 +272,7 @@ 3.12 ["No membership at all"] = "Gar keine Mitgliedschaft"; 3.13 ["No support at all"] = "Gar keine Unterstützung"; 3.14 ["Not a member"] = "Kein Mitglied"; 3.15 +["Not approved"] = "Nicht zugelassen"; 3.16 ["Not approved (rank #{rank})"] = "Nicht angenommen (Rang #{rank})"; 3.17 ["Not voted"] = "Nicht abgestimmt"; 3.18 ["Not voted (not admitted)"] = "Nicht abgestimmt (nicht zugelassen)"; 3.19 @@ -518,6 +520,7 @@ 3.20 ["Your support has been added to this initiative"] = "Deine Unterstützung wurde der Initiative hinzugefügt"; 3.21 ["Your support has been removed from this initiative"] = "Deine Unterstützung wurde der Initiave entzogen"; 3.22 ["Your support has been updated to the latest draft"] = "Deine Unterstützung wurde auf den neuesten Entwurf aktualisiert"; 3.23 +["Your vote has been discarded. Delegation rules apply if set."] = "Deine Abstimmung wurde zurückgezogen. Delegationsregeln gelten sofern gesetzt."; 3.24 ["Your web browser is not fully supported yet."] = "Dein Web-Browser wird noch nicht vollständig unterstützt."; 3.25 ["Z-A"] = "Z-A"; 3.26 ["and #{count} more initiatives"] = "und #{count} weitere Initiativen";
4.1 --- a/locale/translations.eo.lua Sun Feb 21 14:23:56 2010 +0100 4.2 +++ b/locale/translations.eo.lua Sun Feb 21 15:11:48 2010 +0100 4.3 @@ -118,6 +118,7 @@ 4.4 ["Disapproval (prefer to lower blocks) [single entry]"] = false; 4.5 ["Disapproval [many entries]"] = false; 4.6 ["Disapproval [single entry]"] = false; 4.7 +["Discard voting"] = false; 4.8 ["Discussion"] = "Diskuto"; 4.9 ["Discussion URL"] = "Diskuto-URL"; 4.10 ["Discussion on issue"] = "Diskuto pri la temo"; 4.11 @@ -271,6 +272,7 @@ 4.12 ["No membership at all"] = "Tute sen membreco"; 4.13 ["No support at all"] = "Tute sen subteno"; 4.14 ["Not a member"] = "Ne estas membro"; 4.15 +["Not approved"] = false; 4.16 ["Not approved (rank #{rank})"] = false; 4.17 ["Not voted"] = "Ne balotinta"; 4.18 ["Not voted (not admitted)"] = false; 4.19 @@ -518,6 +520,7 @@ 4.20 ["Your support has been added to this initiative"] = "Via subteno estas aldonita al la iniciato"; 4.21 ["Your support has been removed from this initiative"] = "Via subteno estas forigita de la iniciato"; 4.22 ["Your support has been updated to the latest draft"] = "Via subteno estas ĝisdatigita al la plej nova skizo"; 4.23 +["Your vote has been discarded. Delegation rules apply if set."] = false; 4.24 ["Your web browser is not fully supported yet."] = "Via retumilo ne estas jam komplete subtenita."; 4.25 ["Z-A"] = "Z-A"; 4.26 ["and #{count} more initiatives"] = "kaj #{count} pliaj iniciatoj";
5.1 Binary file static/icons/16/email_delete.png has changed