From f84bb93ec9af485fa86a98eb1026dc07a304f839 Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Mon, 4 Oct 2010 13:19:54 -0700 Subject: [PATCH] added smart tracker to emails, allow subject to be completely overridden. --- auth/templates/login_box.html | 2 +- helios/templates/email/vote_body.txt | 8 +++++++- helios/templates/email/vote_subject.txt | 2 +- helios/templates/voters_email.html | 5 ++++- helios/views.py | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/auth/templates/login_box.html b/auth/templates/login_box.html index ce047e2..4fb7a6e 100644 --- a/auth/templates/login_box.html +++ b/auth/templates/login_box.html @@ -5,7 +5,7 @@ {% else %} {% for auth_system in enabled_auth_systems %} {% ifequal auth_system "password" %} -<form method="post" action="{{ SECURE_URL_HOST }}{% url auth.auth_systems.password.password_login_view %}"> +<form method="post" action="{% url auth.auth_systems.password.password_login_view %}"> <input type="hidden" name="election_uuid" value="{{election.uuid}}" /> <input type="hidden" name="csrf_token" value="{{csrf_token}}" /> <input type="hidden" name="return_url" value="{{return_url}}" /> diff --git a/helios/templates/email/vote_body.txt b/helios/templates/email/vote_body.txt index 301bc62..4e2afd3 100644 --- a/helios/templates/email/vote_body.txt +++ b/helios/templates/email/vote_body.txt @@ -9,7 +9,13 @@ Your username: {{voter.user.user_id}} Your password: {{voter.user.info.password}} {% else %} Log in with your {{voter.voter_type}} account. -{% endifequal %}{% if election.use_voter_aliases %} +{% endifequal %}{% if voter.vote_hash %} +We have a vote recorded for you already, with smart tracker: + + {{voter.vote_hash}} + +You may re-vote if you wish: only your last vote counts. +{% endif %}{% if election.use_voter_aliases %} In order to protect your privacy, this election is configured to never display your username, name, or email address to the public. Instead, the ballot tracking center will only display your alias. diff --git a/helios/templates/email/vote_subject.txt b/helios/templates/email/vote_subject.txt index 0d51546..a7929f1 100644 --- a/helios/templates/email/vote_subject.txt +++ b/helios/templates/email/vote_subject.txt @@ -1 +1 @@ -{{voter.election.name}} - {{custom_subject|safe}} +{{custom_subject|safe}} diff --git a/helios/templates/voters_email.html b/helios/templates/voters_email.html index 53481f9..cb7a26e 100644 --- a/helios/templates/voters_email.html +++ b/helios/templates/voters_email.html @@ -24,9 +24,12 @@ voter_id = '{{voter.voter_id}}'; the election URL, the login information, and a simple email signature.<br /> No need to include these in the body of your email below. </p> + <p> + If the voter has already voted, the message will include a reminder of their smart ballot tracker.<br /> + </p> <p> - The email will also <b><u>automatically</u></b> include the name of the election in the subject,<br />followed by your custom subject. + The subject of the email is set by default below, but can be changed to your liking. </p> <form class="prettyform" action="" method="POST" id="email_form"> diff --git a/helios/views.py b/helios/views.py index bcb741a..9430583 100644 --- a/helios/views.py +++ b/helios/views.py @@ -936,7 +936,7 @@ def voters_email(request, election): voter = Voter.get_by_election_and_voter_id(election, voter_id) if request.method == "GET": - email_form = forms.EmailVotersForm() + email_form = forms.EmailVotersForm({'subject': 'Vote in %s' % election.name, 'body':' '}) else: email_form = forms.EmailVotersForm(request.POST) -- GitLab