]> git.parisson.com Git - mezzo.git/commitdiff
generic share button (use 'object' in the context)
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 4 Apr 2016 16:57:13 +0000 (18:57 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 4 Apr 2016 16:57:33 +0000 (18:57 +0200)
app/festival/templates/festival/video_detail.html
app/templates/agenda/event_detail.html
app/templates/includes/share_buttons.html

index 404a80e6f999283ecda62eee63917b1793dd65a1..14f1f8933d1c5493b1f90cc8d2efe633d672190e 100644 (file)
     <iframe src="http://medias.ircam.fr/embed/media/{{ video.media_id }}" frameborder="0" allowfullscreen="" width="100%"></iframe>
 </div>
 
+{% with video as object %}
+  {% include "includes/share_buttons.html" %}
+{% endwith %}
+
 <div class="video-event">
     <h2>{% trans 'Related event' %}</h2>
     {% with video.event as event %}
index 767ea5f95596fc80f72c5cee8267b104694cc09a..3cef8fc55b21ea3379ab2c1acb0d16063be30648 100644 (file)
@@ -71,7 +71,9 @@
 
 {% block event_detail_sharebuttons %}
 {% set_short_url_for event %}
+  {% with event as object %}
     {% include "includes/share_buttons.html" %}
+  {% endwith %}
 {% endblock %}
 
 {% if event.location %}
index 7f4c4419fe9168ca3f02ff3b54a67f28261acedf..4d124d1414b6c4cadb8d145d4b750cd68457524d 100644 (file)
@@ -1,8 +1,8 @@
 {% load i18n %}
 
 <div class="share__button">
-    <a class="btn btn-facebook" target="_blank" href="http://facebook.com/sharer.php?u={{ request.build_absolute_uri }}&amp;t={{ event.title|urlencode }}">{% trans "Share on Facebook" %}</a>
-    <a class="btn btn-twitter" target="_blank" href="http://twitter.com/home?status={{ event.short_url|urlencode }}%20{{ event.title|urlencode }}">{% trans "Share on Twitter" %}</a>
-    <a class="btn btn-email" target="_blank" href="mailto:?subject=SUBJECT TEXT HERE&amp;body=TEXT HERE URL">{% trans "Share by email" %}</a>
+    <a class="btn btn-facebook" target="_blank" href="http://facebook.com/sharer.php?u={{ request.build_absolute_uri }}&amp;t={{ object.title|urlencode }}">{% trans "Share on Facebook" %}</a>
+    <a class="btn btn-twitter" target="_blank" href="http://twitter.com/home?status={{ object.title|urlencode }}%20{{ request.build_absolute_uri }}">{% trans "Share on Twitter" %}</a>
+    <a class="btn btn-email" target="_blank" href="mailto:?subject=object.title&amp;body={{ request.build_absolute_uri }}">{% trans "Share by email" %}</a>
     <a class="btn btn-print" href="javascript:window.print()">{% trans "Print this page" %}</a>
-</div>
\ No newline at end of file
+</div>