Skip to content

Instantly share code, notes, and snippets.

@clemblanco
Created May 30, 2013 10:58
Show Gist options
  • Save clemblanco/5677108 to your computer and use it in GitHub Desktop.
Save clemblanco/5677108 to your computer and use it in GitHub Desktop.
Publish View from PointsFB
{% 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