Facebook App ID is now configurable in settings_local.py. Default ID in settings.py for the stage server.
This commit is contained in:
Родитель
9a135f1ee9
Коммит
9ecb418575
|
@ -25,7 +25,7 @@
|
|||
{% if logged_in %}
|
||||
<div class="badge-sharing">
|
||||
<span>{{ _('share this!') }}</span>
|
||||
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&app_id=100139296738213&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{ badge.facebook_msg }}"></a>
|
||||
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&app_id={{ FB_APP_ID }}&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{ badge.facebook_msg }}"></a>
|
||||
<a href="https://twitter.com/share?url={{twitter_url}}&text={{ badge.twitter_msg }}%20%23spark&via=mozmobile" class="twitter"></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<div class="sub-section">
|
||||
<h4>{{ _('Not an Android or Maemo user?') }}</h4>
|
||||
<div id="spread-the-word">
|
||||
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&app_id=100139296738213&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{facebook_msg}}"></a>
|
||||
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&app_id={{ FB_APP_ID }}&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{facebook_msg}}"></a>
|
||||
|
||||
<a href="https://twitter.com/share?url={{twitter_url}}&text={{twitter_msg}}&via=mozmobile" class="twitter"></a>
|
||||
</div>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<div class="sub-section">
|
||||
<h4>{{ _('Social media') }}</h4>
|
||||
<div id="spread-the-word">
|
||||
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&app_id=100139296738213&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{facebook_spark_msg}}"></a>
|
||||
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&app_id={{ FB_APP_ID }}&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{facebook_spark_msg}}"></a>
|
||||
|
||||
<a href="https://twitter.com/share?url={{twitter_url}}&text={{twitter_msg}}%20%23spark&via=mozmobile" class="twitter"></a>
|
||||
</div>
|
||||
|
|
|
@ -57,7 +57,8 @@ def home(request):
|
|||
'abs_url': profile.generic_sharing_url,
|
||||
'stats': get_global_stats(),
|
||||
'boost_status': boost_status,
|
||||
'open_boost_popup': 'new_user' in request.COOKIES})
|
||||
'open_boost_popup': 'new_user' in request.COOKIES,
|
||||
'FB_APP_ID': settings.FB_APP_ID})
|
||||
response.delete_cookie('new_user')
|
||||
return response
|
||||
else:
|
||||
|
@ -68,7 +69,8 @@ def home(request):
|
|||
'facebook_redirect': absolute_url(django_reverse('desktop.close_popup')),
|
||||
'facebook_msg': urlquote(unicode(FACEBOOK_SHARE_MSG)),
|
||||
'facebook_title': urlquote(unicode(FACEBOOK_SPARK_TITLE)),
|
||||
'stats': get_global_stats()}
|
||||
'stats': get_global_stats(),
|
||||
'FB_APP_ID': settings.FB_APP_ID}
|
||||
return jingo.render(request, 'desktop/home.html', data)
|
||||
|
||||
|
||||
|
@ -91,7 +93,8 @@ def user(request, username):
|
|||
'facebook_redirect': absolute_url(django_reverse('desktop.close_popup')),
|
||||
'facebook_title': urlquote(unicode(FACEBOOK_SPARK_TITLE)),
|
||||
'facebook_spark_msg': urlquote(unicode(FACEBOOK_SPARK_MSG)),
|
||||
'stats': get_global_stats()}
|
||||
'stats': get_global_stats(),
|
||||
'FB_APP_ID': settings.FB_APP_ID}
|
||||
|
||||
if not request.user.is_authenticated():
|
||||
data.update({'login_next_url': request.path})
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
</p>
|
||||
<ul id="sharing">
|
||||
<li class="cta"><a href="https://twitter.com/share?url={{twitter_url}}&text={{ twitter_badge_msg % {'badge_name':badge_name, 'short_url':''} }}%20%23spark&via=mozmobile" target="_blank">{{ _('Share on Twitter') }}</a></li>
|
||||
<li class="cta"><a href="https://m.facebook.com/dialog/feed?display=touch&app_id=100139296738213&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{ facebook_badge_msg % {'badge_name':badge_name} }}">{{ _('Share on Facebook') }}</a></li>
|
||||
<li class="cta"><a href="https://m.facebook.com/dialog/feed?display=touch&app_id={{ FB_APP_ID }}&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{ facebook_badge_msg % {'badge_name':badge_name} }}">{{ _('Share on Facebook') }}</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
|
@ -9,7 +9,7 @@
|
|||
</p>
|
||||
<ul id="sharing">
|
||||
<li class="cta"><a href="https://twitter.com/share?url={{twitter_url}}&text={{twitter_msg}}%20%23spark&via=mozmobile" target="_blank">{{ _('Share on Twitter') }}</a></li>
|
||||
<li class="cta"><a href="https://m.facebook.com/dialog/feed?display=touch&app_id=100139296738213&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{facebook_spark_msg}}">{{ _('Share on Facebook') }}</a></li>
|
||||
<li class="cta"><a href="https://m.facebook.com/dialog/feed?display=touch&app_id={{ FB_APP_ID }}&redirect_uri={{facebook_redirect}}&link={{facebook_url}}&name={{facebook_title}}&message={{facebook_spark_msg}}">{{ _('Share on Facebook') }}</a></li>
|
||||
</ul>
|
||||
{# Not used for this release #}
|
||||
{% set s = _('Share via SMS') %}
|
||||
|
|
|
@ -2,6 +2,7 @@ from django.http import HttpResponseRedirect
|
|||
from django.shortcuts import get_object_or_404
|
||||
from django.core.urlresolvers import reverse as django_reverse
|
||||
from django.utils.http import urlquote
|
||||
from django.conf import settings
|
||||
|
||||
import jingo
|
||||
|
||||
|
@ -338,7 +339,8 @@ def sharelink(request):
|
|||
'facebook_url': request.user.profile.facebook_sharing_url,
|
||||
'facebook_redirect': absolute_url(django_reverse('mobile.home')),
|
||||
'facebook_title': urlquote(unicode(FACEBOOK_SPARK_TITLE)),
|
||||
'facebook_spark_msg': urlquote(unicode(FACEBOOK_SPARK_MSG))}
|
||||
'facebook_spark_msg': urlquote(unicode(FACEBOOK_SPARK_MSG)),
|
||||
'FB_APP_ID': settings.FB_APP_ID}
|
||||
|
||||
return jingo.render(request, 'mobile/sharelink.html', data)
|
||||
|
||||
|
@ -361,7 +363,8 @@ def sharebadge(request):
|
|||
'facebook_url': profile.facebook_sharing_url,
|
||||
'facebook_redirect': absolute_url(django_reverse('mobile.home')),
|
||||
'facebook_title': urlquote(unicode(FACEBOOK_SPARK_TITLE)),
|
||||
'facebook_badge_msg': FACEBOOK_BADGE_MSG }
|
||||
'facebook_badge_msg': FACEBOOK_BADGE_MSG,
|
||||
'FB_APP_ID': settings.FB_APP_ID}
|
||||
return jingo.render(request, 'mobile/sharebadge.html', data)
|
||||
except Challenge.DoesNotExist:
|
||||
# Ignore invalid badges
|
||||
|
|
|
@ -382,3 +382,6 @@ SESSION_COOKIE_SECURE = True
|
|||
|
||||
# Campaign starting date used by the visualization -- to be changed in settings_local.py
|
||||
CAMPAIGN_STARTING_DATE = datetime.datetime(2011, 3, 26, 17)
|
||||
|
||||
# Facebook App ID
|
||||
FB_APP_ID = 195624900473285
|
||||
|
|
|
@ -49,6 +49,10 @@ RESPONSYS_ID = '<insert Responsys production key>'
|
|||
CAMPAIGN_STARTING_DATE = datetime.datetime(2011, 3, 29)
|
||||
|
||||
|
||||
# Facebook App ID
|
||||
FB_APP_ID = 100139296738213
|
||||
|
||||
|
||||
# Uncomment and update with stage/prod settings if necessary
|
||||
#MEDIA_URL = '/media/'
|
||||
#EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
Загрузка…
Ссылка в новой задаче