diff --git a/helios/templates/cast_done.html b/helios/templates/cast_done.html index e4ddf4cf83e1008a8abde5d66c1ac948c483a773..75265abb060e5c9b3e0582330e1261e09efaedf8 100644 --- a/helios/templates/cast_done.html +++ b/helios/templates/cast_done.html @@ -13,10 +13,6 @@ <tt style="font-size:1.8em; font-weight: bold; padding-left: 20px;"> {{vote_hash}}</tt> </p> -<p> -<iframe src="{{socialbuttons_url}}" frameborder="0" border="0" style="width: 300px; height:35px;" scrolling="no" align="middle"></iframe> -</p> - {% if logout %} <p><b>For your safety, we have logged you out.</b></p> <iframe width="0" height="0" border="0" frameborder="0" src="/auth/logout"> diff --git a/helios/templates/election_view.html b/helios/templates/election_view.html index 64bf5e2ee9179c4f1d520a6264c2357c688e4760..472a8375b82074e008f7e6c53150a65d8ae7a1da 100644 --- a/helios/templates/election_view.html +++ b/helios/templates/election_view.html @@ -37,11 +37,7 @@ this {{election.election_type}} is <u>not</u> featured on the front page. </div> -<br /><br /> -{% if socialbuttons_url %} -<iframe src="{{socialbuttons_url}}" frameborder="0" border="0" style="width: 300px; height:100px;"></iframe> -{% endif %} - +<br /> <br clear="left" /> diff --git a/helios/urls.py b/helios/urls.py index 1a0df511afb7cdbd6548432aa6a4d4d5888cc32e..67c0077672cd476a705ca58d4bf9ab6ca4288e07 100644 --- a/helios/urls.py +++ b/helios/urls.py @@ -13,7 +13,6 @@ urlpatterns = patterns('', (r'^testcookie_2$', test_cookie_2), (r'^nocookies$', nocookies), (r'^stats/', include('helios.stats_urls')), - (r'^socialbuttons$', socialbuttons), # election shortcut by shortname (r'^e/(?P<election_short_name>[^/]+)$', election_shortcut), diff --git a/helios/views.py b/helios/views.py index ec998fb372fed7d5106abbd93a164fce3beaf38c..0aaaaa5bd0300d069e306ac0bc414c3783fae4a5 100644 --- a/helios/views.py +++ b/helios/views.py @@ -68,18 +68,6 @@ def get_election_govote_url(election): def get_castvote_url(cast_vote): return settings.URL_HOST + reverse(castvote_shortcut, args=[cast_vote.vote_tinyhash]) -# social buttons -def get_socialbuttons_url(url, text): - if not text: - return None - - return "%s%s?%s" % (settings.SOCIALBUTTONS_URL_HOST, - reverse(socialbuttons), - urllib.urlencode({ - 'url' : url, - 'text': text.encode('utf-8') - })) - ## ## remote auth utils @@ -334,9 +322,6 @@ def one_election_view(request, election): if election.result: status_update_message = u"Results are in for %s" % election.name - # a URL for the social buttons - socialbuttons_url = get_socialbuttons_url(election_url, status_update_message) - trustees = Trustee.get_by_election(election) # should we show the result? @@ -348,7 +333,7 @@ def one_election_view(request, election): 'can_feature_p': can_feature_p, 'election_url' : election_url, 'vote_url': vote_url, 'election_badge_url' : election_badge_url, 'show_result': show_result, - 'test_cookie_url': test_cookie_url, 'socialbuttons_url' : socialbuttons_url}) + 'test_cookie_url': test_cookie_url}) def test_cookie(request): continue_url = request.GET['continue_url'] @@ -369,14 +354,6 @@ def nocookies(request): retest_url = "%s?%s" % (reverse(test_cookie), urllib.urlencode({'continue_url' : request.GET['continue_url']})) return render_template(request, 'nocookies', {'retest_url': retest_url}) -def socialbuttons(request): - """ - just render the social buttons for sharing a URL - expecting "url" and "text" in request.GET - """ - return render_template(request, 'socialbuttons', - {'url': request.GET['url'], 'text':request.GET['text']}) - ## ## Trustees and Public Key ## @@ -772,14 +749,10 @@ def one_election_cast_done(request, election): # if logout: # auth_views.do_local_logout(request) - # tweet/fb your vote - socialbuttons_url = get_socialbuttons_url(cv_url, 'I cast a vote in %s' % election.name) - # remote logout is happening asynchronously in an iframe to be modular given the logout mechanism # include_user is set to False if logout is happening return render_template(request, 'cast_done', {'election': election, - 'vote_hash': vote_hash, 'logout': logout, - 'socialbuttons_url': socialbuttons_url}, + 'vote_hash': vote_hash, 'logout': logout}, include_user=(not logout)) @election_view() diff --git a/settings.py b/settings.py index e1994eb8bb2ed11377438176d9652b1e676ac466..1e20e2ffde7d3a297097d5b2c4f4e9d3b2ad73e7 100644 --- a/settings.py +++ b/settings.py @@ -178,12 +178,6 @@ URL_HOST = get_from_env("URL_HOST", "http://localhost:8000").rstrip("/") # SECURE_URL_HOST = "https://localhost:8443" SECURE_URL_HOST = get_from_env("SECURE_URL_HOST", URL_HOST).rstrip("/") -# this additional host is used to iframe-isolate the social buttons, -# which usually involve hooking in remote JavaScript, which could be -# a security issue. Plus, if there's a loading issue, it blocks the whole -# page. Not cool. -SOCIALBUTTONS_URL_HOST= get_from_env("SOCIALBUTTONS_URL_HOST", SECURE_URL_HOST).rstrip("/") - # election stuff SITE_TITLE = get_from_env('SITE_TITLE', 'Helios Voting') MAIN_LOGO_URL = get_from_env('MAIN_LOGO_URL', '/static/logo.png')