]> git.parisson.com Git - teleforma.git/commitdiff
add payback testimonial
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 12 Jun 2013 09:52:31 +0000 (11:52 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 12 Jun 2013 09:52:31 +0000 (11:52 +0200)
teleforma/static/teleforma/images/attestation_fifpl.png [new file with mode: 0644]
teleforma/templates/teleforma/seminar_testimonial_payback.html [new file with mode: 0644]
teleforma/urls.py
teleforma/views/pro.py

diff --git a/teleforma/static/teleforma/images/attestation_fifpl.png b/teleforma/static/teleforma/images/attestation_fifpl.png
new file mode 100644 (file)
index 0000000..8bcc3d8
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 (file)
index 0000000..d8a680a
--- /dev/null
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+{% load i18n %}
+{% load telemeta_utils %}
+{% load teleforma_tags %}
+
+{% get_current_language as LANGUAGE_CODE %}
+{% get_available_languages as LANGUAGES %}
+<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
+
+<head>
+<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
+
+<title>{%block head_title %}{% description %} - {% trans "Testimonial" %}{% endblock %}</title>
+
+{% block stylesheets %}
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}teleforma/css/teleforma_pdf.css" />
+{% endblock %}
+
+<style>
+ @page {
+  background-image: url({{ STATIC_URL }}teleforma/images/attestation_fifpl.png);
+
+  @frame user {
+  -pdf-frame-content: user;
+    top: 394px;
+    left: 260px;
+  }
+
+  @frame seminar {
+  -pdf-frame-content: seminar;
+    top: 460px;
+    left: 75px;
+  }
+
+  @frame dates {
+  -pdf-frame-content: dates;
+    top: 569px;
+    left: 263px;
+  }
+
+  @frame hours {
+  -pdf-frame-content: hours;
+    top: 649px;
+    left: 308px;
+  }
+
+  @frame price-ht {
+  -pdf-frame-content: price-ht;
+    top: 730px;
+    left: 377px;
+  }
+
+  @frame price-ttc {
+  -pdf-frame-content: price-ttc;
+    top: 730px;
+    left: 477px;
+  }
+
+  @frame date-now {
+  -pdf-frame-content: date-now;
+    top: 805px;
+    left: 267px;
+  }
+
+}
+
+</style>
+
+{% block extra_stylesheets %}{% endblock %}
+
+</head>
+
+<body>
+{% block layout %}
+<div id="layout">
+<div id="content" style="font-size=1.3em;">
+
+
+<div id="user">
+  {{ testimonial.user.first_name|upper }} {{ testimonial.user.last_name|upper }}
+</div>
+
+
+<div id="seminar" style="position: absolute; left: 200px; top: 50px; z-index=2;">
+  {{ seminar.title }}
+</div>
+
+
+<div id="dates">
+  {{ 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 %}
+</div>
+
+
+<div id="hours">
+  {{ seminar.duration|hours }} {% trans "hours" %}
+</div>
+
+
+<div id="price-ht">
+  {{ seminar.price }}
+</div>
+
+<div id="price-ttc">
+  {{ seminar.price }}
+</div>
+
+
+<div id="date-now">
+  {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}
+</div>
+
+
+</div>
+</div>
+{% endblock layout %}
+
+</body>
+</html>
index 3bd0abfab87c10461de208ed5c55b144ca50d990..8bea98a5bf5e448f3af62baa11b82f774574ae25 100644 (file)
@@ -113,6 +113,8 @@ urlpatterns = patterns('',
                                                     name="teleforma-testimonials"),
     url(r'^desk/seminars/(?P<pk>.*)/testimonial-presence/$', TestimonialPresenceView.as_view(),
                                                     name="teleforma-seminar-testimonial-presence"),
+    url(r'^desk/seminars/(?P<pk>.*)/testimonial-payback/$', TestimonialPaybackView.as_view(),
+                                                    name="teleforma-seminar-testimonial-payback"),
 
     # Postman
     url(r'^messages/', include('postman.urls')),
index 0a195609529a32286abf992d98b605105824e9a3..d5300b86ecef32343c22f325dee3599858684b08 100644 (file)
@@ -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)