--- /dev/null
+{% load teleforma_tags %}
+{% load i18n %}
+
+<div class="course_content">
+
+<div class="course_subtitle">
+<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {{ title }}</h3>
+</div>
+
+<table class="listing" width="100%">
+ <tbody>
+
+ <tr>
+ <td {% if forloop.first %}class="border-top"{% endif %} width="95%"><a href="{% url teleforma-seminar-testimonial seminar.id %}?format=pdf" target="_blank" title="{% trans "Testimonial" %}"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Testimonial" %} : {{ seminar.title }}{% if seminar.rank %} n°{{seminar.rank}}{% endif %}</a></td>
+ <td {% if forloop.first %}class="border-top"{% endif %} width="5%" align="center"><a href="{% url teleforma-seminar-testimonial-download seminar.id %}?format=pdf"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
+ </tr>
+
+ </tbody>
+</table>
+
+</div>
+
{% endwith %}
{% endwith %}
+ {% with _("Step 7 : download your testimonial") as title %}
+ {% include "teleforma/inc/testimonial_list.html" %}
+ {% endwith %}
+
{% endif %}
{% endblock course_content %}
profile_view = ProfileView()
document = DocumentView()
media = MediaView()
-testimonial = TestimonialView()
urlpatterns = patterns('',
# url(r'^$', HomeView.as_view(), name='teleforma-home'),
# Testimonial
url(r'^desk/seminars/(?P<pk>.*)/testimonial/$', TestimonialView.as_view(),
name="teleforma-seminar-testimonial"),
+ url(r'^desk/seminars/(?P<pk>.*)/testimonial/download/$', TestimonialDownloadView.as_view(),
+ name="teleforma-seminar-testimonial-download"),
# Postman
url(r'^messages/', include('postman.urls')),
@method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(TestimonialView, self).dispatch(*args, **kwargs)
-
+
def get_context_data(self, **kwargs):
context = super(TestimonialView, self).get_context_data(**kwargs)
context['seminar'] = self.get_object()
return context
+
+class TestimonialDownloadView(TestimonialView):
+
+ pdf_filename = 'testimonial.pdf'
+
+ def get_pdf_filename(self):
+ super(TestimonialView, self).get_pdf_filename()
+ seminar = self.get_object()
+ prefix = unicode(_('Testimonial'))
+ filename = '_'.join([prefix, seminar.title,
+ self.request.user.first_name, self.request.user.last_name,])
+ filename += '.pdf'
+ return filename.encode('utf-8')
+
+