From: Guillaume Pellerin Date: Wed, 12 Jun 2013 09:52:31 +0000 (+0200) Subject: add payback testimonial X-Git-Tag: 2.8.1-pro~487^2^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=89a1114643a5b285d9fd6054030d648d000837bb;p=teleforma.git add payback testimonial --- diff --git a/teleforma/static/teleforma/images/attestation_fifpl.png b/teleforma/static/teleforma/images/attestation_fifpl.png new file mode 100644 index 00000000..8bcc3d86 Binary files /dev/null and b/teleforma/static/teleforma/images/attestation_fifpl.png differ diff --git a/teleforma/templates/teleforma/seminar_testimonial_payback.html b/teleforma/templates/teleforma/seminar_testimonial_payback.html new file mode 100644 index 00000000..d8a680a9 --- /dev/null +++ b/teleforma/templates/teleforma/seminar_testimonial_payback.html @@ -0,0 +1,118 @@ + +{% load i18n %} +{% load telemeta_utils %} +{% load teleforma_tags %} + +{% get_current_language as LANGUAGE_CODE %} +{% get_available_languages as LANGUAGES %} + + + + + +{%block head_title %}{% description %} - {% trans "Testimonial" %}{% endblock %} + +{% block stylesheets %} + +{% endblock %} + + + +{% block extra_stylesheets %}{% endblock %} + + + + +{% block layout %} +
+
+ + +
+ {{ testimonial.user.first_name|upper }} {{ testimonial.user.last_name|upper }} +
+ + +
+ {{ seminar.title }} +
+ + +
+ {{ first_revision.date|date:'j F Y' }} {% trans "until" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %} +
+ + +
+ {{ seminar.duration|hours }} {% trans "hours" %} +
+ + +
+ {{ seminar.price }} +
+ +
+ {{ seminar.price }} +
+ + +
+ {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %} +
+ + +
+
+{% endblock layout %} + + + diff --git a/teleforma/urls.py b/teleforma/urls.py index 3bd0abfa..8bea98a5 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -113,6 +113,8 @@ urlpatterns = patterns('', name="teleforma-testimonials"), url(r'^desk/seminars/(?P.*)/testimonial-presence/$', TestimonialPresenceView.as_view(), name="teleforma-seminar-testimonial-presence"), + url(r'^desk/seminars/(?P.*)/testimonial-payback/$', TestimonialPaybackView.as_view(), + name="teleforma-seminar-testimonial-payback"), # Postman url(r'^messages/', include('postman.urls')), diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 0a195609..d5300b86 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -671,3 +671,21 @@ class TestimonialPresenceView(TestimonialView): @method_decorator(login_required) def dispatch(self, *args, **kwargs): return super(TestimonialPresenceView, self).dispatch(*args, **kwargs) + + +class TestimonialPaybackView(TestimonialView): + + template_name = 'teleforma/seminar_testimonial_payback.html' + pdf_template_name = template_name + + def get_context_data(self, **kwargs): + context = super(TestimonialPaybackView, self).get_context_data(**kwargs) + seminar = context['seminar'] + context['answers'] = Answer.objects.filter(question__in=seminar.question.all(), + user=self.request.user, + validated=True).order_by('question__rank') + return context + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(TestimonialPaybackView, self).dispatch(*args, **kwargs)