diff --git a/helios/templates/voters_email.html b/helios/templates/voters_email.html index 011005412896821e5804eb1b06b252307189b72b..535f7533fbeaf6cd87753c2f5f0c8788f03f4a95 100644 --- a/helios/templates/voters_email.html +++ b/helios/templates/voters_email.html @@ -47,7 +47,7 @@ You may tweak the subject and add a custom message using the form below. {{email_form.as_table}} </table> <div> - <label for=""> </label><input type="submit" value="Send" id="send_button" /> + <label for=""> </label><input type="submit" value="Send" id="send_button" class="button" /> </div> </form> diff --git a/helios/templates/voters_list.html b/helios/templates/voters_list.html index f2db9d3042db1ff11a66c83e89c1f5c1d73ae7aa..1409770868a887eafd24135e982a0d81d5c2155d 100644 --- a/helios/templates/voters_list.html +++ b/helios/templates/voters_list.html @@ -125,7 +125,9 @@ Voters {{voters_page.start_index}} - {{voters_page.end_index}} (of {{total_voter {% if admin_p or not election.use_voter_aliases %} <td> {% if admin_p %} +{% if election.frozen_at %} [<a href="{% url "helios.views.voters_email" election.uuid %}?voter_id={{voter.voter_login_id}}">email</a>] +{% endif %} [<a onclick="return confirm('are you sure you want to remove {{voter.name}} ?');" href="{% url "helios.views.voter_delete" election.uuid voter.uuid %}">x</a>] {% endif %} <img class="small-logo" src="/static/auth/login-icons/{{voter.voter_type}}.png" alt="{{voter.voter_type}}" /> {{voter.name}}</td> diff --git a/helios/views.py b/helios/views.py index aebdbef613b591d93ee3617e325bed36c1d67be9..d51191baa2bbaa2a38efedeb582113301a1ede3a 100644 --- a/helios/views.py +++ b/helios/views.py @@ -550,7 +550,7 @@ def password_voter_login(request, election): """ This is used to log in as a voter for a particular election """ - + # the URL to send the user to after they've logged in return_url = request.REQUEST.get('return_url', reverse(one_election_cast_confirm, args=[election.uuid])) bad_voter_login = (request.GET.get('bad_voter_login', "0") == "1") @@ -598,7 +598,15 @@ def password_voter_login(request, election): }) return HttpResponseRedirect(settings.SECURE_URL_HOST + redirect_url) - + else: + # bad form, bad voter login + redirect_url = login_url + "?" + urllib.urlencode({ + 'bad_voter_login' : '1', + 'return_url' : return_url + }) + + return HttpResponseRedirect(settings.SECURE_URL_HOST + redirect_url) + return HttpResponseRedirect(settings.SECURE_URL_HOST + return_url) @election_view() @@ -1362,7 +1370,7 @@ def voters_email(request, election): }) if request.method == "GET": - email_form = forms.EmailVotersForm() + email_form = forms.EmailVotersForm(initial={'subject': election.name, 'body': ' '}) if voter: email_form.fields['send_to'].widget = email_form.fields['send_to'].hidden_widget() else: