Created
May 30, 2013 10:58
-
-
Save clemblanco/5677108 to your computer and use it in GitHub Desktop.
Publish View from PointsFB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends '::base.html.twig' %} | |
{% block content_back %} | |
{{' participated'}} | |
{% endblock content_back %} | |
{% block content %} | |
{% for key, flash in app.session.getFlashes() %} | |
<div class="center red {{ key }}"><p>{{ flash }}</p></div> | |
{% endfor %} | |
<a href="#" class="btn publish" onclick="postToFeed(); return false;">Doublez vos chances en publiant sur votre mur !</a> | |
<a href="{{ path('contest_homepage') }}" class="passlink blue">Retour à l'accueil ></a> | |
{% if entity.imagefilename is not null %} | |
{% set picture = 'http://' ~ urlinterne ~ '/upload/q/' ~ entity.imagefilename %} | |
{% else %} | |
{% set picture = app.request.uriForPath('/bundles/novawayconcours/images/default-question-img.jpg') %} | |
{% endif %} | |
<script> | |
function postToFeed() { | |
var obj = { | |
method: 'feed', | |
link: '{{ app_url }}', | |
picture: '{{ picture }}', | |
name: '{{ entity.title_share | humanize }}', | |
caption: '{{ contest.title | humanize }}', | |
description: '{{ contest.description | humanize }}' | |
}; | |
function callback(response) { | |
document.location.href = '{{ url('contest_published') }}'; | |
} | |
FB.ui(obj, callback); | |
} | |
</script> | |
{% endblock content %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment