Facebook App ID is now configurable in settings_local.py. Default ID in settings.py for the stage server.

This commit is contained in:
sork 2011-04-18 16:52:10 +02:00
Родитель 9a135f1ee9
Коммит 9ecb418575
9 изменённых файлов: 23 добавлений и 10 удалений

Просмотреть файл

@ -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&amp;app_id=100139296738213&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;message={{ badge.facebook_msg }}"></a>
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&amp;app_id={{ FB_APP_ID }}&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;message={{ badge.facebook_msg }}"></a>
<a href="https://twitter.com/share?url={{twitter_url}}&amp;text={{ badge.twitter_msg }}%20%23spark&amp;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&amp;app_id=100139296738213&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;message={{facebook_msg}}"></a>
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&amp;app_id={{ FB_APP_ID }}&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;message={{facebook_msg}}"></a>
<a href="https://twitter.com/share?url={{twitter_url}}&amp;text={{twitter_msg}}&amp;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&amp;app_id=100139296738213&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;message={{facebook_spark_msg}}"></a>
<a class="facebook" href="https://www.facebook.com/dialog/feed?display=popup&amp;app_id={{ FB_APP_ID }}&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;message={{facebook_spark_msg}}"></a>
<a href="https://twitter.com/share?url={{twitter_url}}&amp;text={{twitter_msg}}%20%23spark&amp;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}}&amp;text={{ twitter_badge_msg % {'badge_name':badge_name, 'short_url':''} }}%20%23spark&amp;via=mozmobile" target="_blank">{{ _('Share on Twitter') }}</a></li>
<li class="cta"><a href="https://m.facebook.com/dialog/feed?display=touch&amp;app_id=100139296738213&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;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&amp;app_id={{ FB_APP_ID }}&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;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}}&amp;text={{twitter_msg}}%20%23spark&amp;via=mozmobile" target="_blank">{{ _('Share on Twitter') }}</a></li>
<li class="cta"><a href="https://m.facebook.com/dialog/feed?display=touch&amp;app_id=100139296738213&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;message={{facebook_spark_msg}}">{{ _('Share on Facebook') }}</a></li>
<li class="cta"><a href="https://m.facebook.com/dialog/feed?display=touch&amp;app_id={{ FB_APP_ID }}&amp;redirect_uri={{facebook_redirect}}&amp;link={{facebook_url}}&amp;name={{facebook_title}}&amp;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'