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

remove social buttons #117

parent 9ec2cbe4
No related branches found
No related tags found
No related merge requests found
......@@ -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">
......
......@@ -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" />
......
......@@ -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),
......
......@@ -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()
......
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment