Skip to content
Snippets Groups Projects
Commit 046e14ec authored by Ben Adida's avatar Ben Adida
Browse files

added election badge

parent e694a7cb
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,20 @@ this {{election.election_type}} is <u>not</u> featured on the front page.
</p>
{% if admin_p %}
{% if not election.private_p %}
<div style="background: lightyellow; padding:5px; padding-left: 10px; margin-top: 15px; border: 1px solid #aaa; width: 720px;" class="round">
<a href="#" onclick="$('#badgebody').slideToggle(250);">Embed an Election Badge</a>
<div id="badgebody" style="display:none;">
<br />
<form action="#">
<textarea cols="90" rows="4" wrap="soft">&lt;iframe src="{{election_badge_url}}" frameborder="0" style="border: 1px solid black" height="75" width="200"&gt;
&lt;/iframe&gt;</textarea><br />
<p style="font-size:0.8em;">adding this HTML to your site displays a thin banner with direct links to voting.</p>
</form>
</div>
</div>
{% endif %}
<p>
{% if election.result %}
......
......@@ -52,6 +52,9 @@ from django.conf import settings
def get_election_url(election):
return settings.URL_HOST + reverse(election_shortcut, args=[election.short_name])
def get_election_badge_url(election):
return settings.URL_HOST + reverse(election_badge, args=[election.uuid])
def get_election_govote_url(election):
return settings.URL_HOST + reverse(election_vote_shortcut, args=[election.short_name])
......@@ -282,6 +285,7 @@ def one_election_view(request, election):
eligible_p = True
election_url = get_election_url(election)
election_badge_url = get_election_badge_url(election)
status_update_message = None
vote_url = "%s/booth/vote.html?%s" % (settings.SECURE_URL_HOST, urllib.urlencode({'election_url' : reverse(one_election, args=[election.uuid])}))
......@@ -328,7 +332,8 @@ def one_election_view(request, election):
return render_template(request, 'election_view',
{'election' : election, 'trustees': trustees, 'admin_p': admin_p, 'user': user,
'voter': voter, 'votes': votes, 'notregistered': notregistered, 'eligible_p': eligible_p,
'can_feature_p': can_feature_p, 'election_url' : election_url, 'vote_url': vote_url,
'can_feature_p': can_feature_p, 'election_url' : election_url,
'vote_url': vote_url, 'election_badge_url' : election_badge_url,
'test_cookie_url': test_cookie_url, 'socialbuttons_url' : socialbuttons_url})
def test_cookie(request):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment