required_duration = (conf.date_end - conf.date_begin).total_seconds() * 0.9
- # print("Required duration: %d seconds" % required_duration)
- # print("Total spent: %d seconds" % total_spent.total_seconds())
+ print("Required duration: %d seconds" % required_duration)
+ print("Total spent: %d seconds" % total_spent.total_seconds())
if total_spent.total_seconds() >= required_duration:
# Chercher une attestation existante
if seminar:
user=user,
seminar=None
).first()
- # print("Existing testimonial: %s" % existing_testimonial)
+ print("Existing testimonial: %s" % existing_testimonial)
if not existing_testimonial:
print("Creating testimonial for %s" % conf.title + " for user " + user.username)
<table class="listing" width="100%">
<tbody id="spacing">
- {% if testimonial.seminar %}
+ {% if testimonial.conference %}
<tr>
- <td><a href="{% url 'teleforma-seminar-testimonial' testimonial.seminar.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Training testimonial" %}</a></td>
- <td>{% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}</td>
- <td><a href="{% url 'teleforma-seminar-testimonial-download' testimonial.seminar.id %}?format=pdf"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
- </tr>
-
- {% if show_fifpl %}<tr>
- <td><a href="{% url 'teleforma-seminar-testimonial-payback' testimonial.seminar.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %})</td>
+ <td><a href="{% url 'teleforma-conference-testimonial' testimonial.conference.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />Attestation de formation</a></td>
<td>{% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}</td>
- <td><a href="{% url 'teleforma-seminar-testimonial-payback' testimonial.seminar.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
+ <td><a href="{% url 'teleforma-conference-testimonial-download' testimonial.conference.id %}?format=pdf"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
</tr>
- {% endif %}
- {% elif testimonial.conference %}
+ {% if show_fifpl %}<tr>
+ <td><a href="{% url 'teleforma-conference-testimonial-payback' testimonial.conference.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %})</td>
+ <td>{% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}</td>
+ <td><a href="{% url 'teleforma-conference-testimonial-payback' testimonial.conference.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
+ </tr>
+ {% endif %}
+ {% elif testimonial.seminar %}
<tr>
- <td><a href="{% url 'teleforma-conference-testimonial' testimonial.conference.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Training testimonial" %}</a></td>
+ <td><a href="{% url 'teleforma-seminar-testimonial' testimonial.seminar.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Training testimonial" %}</a></td>
<td>{% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}</td>
- <td><a href="{% url 'teleforma-conference-testimonial-download' testimonial.conference.id %}?format=pdf"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
+ <td><a href="{% url 'teleforma-seminar-testimonial-download' testimonial.seminar.id %}?format=pdf"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
</tr>
- {% if show_fifpl %}<tr>
- <td><a href="{% url 'teleforma-conference-testimonial-payback' testimonial.conference.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %})</td>
- <td>{% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}</td>
- <td><a href="{% url 'teleforma-conference-testimonial-payback' testimonial.conference.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
- </tr>
- {% endif %}
+ {% if show_fifpl %}<tr>
+ <td><a href="{% url 'teleforma-seminar-testimonial-payback' testimonial.seminar.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" /> {% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %})</td>
+ <td>{% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}</td>
+ <td><a href="{% url 'teleforma-seminar-testimonial-payback' testimonial.seminar.id %}?format=pdf" target="_blank"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a></td>
+ </tr>
+ {% endif %}
+
+
{% endif %}
</tbody>
user = self.request.user
testimonials = Testimonial.objects.filter(user=user)
for testimonial in testimonials:
- if testimonial.seminar:
+ if testimonial.conference:
+ # Attestation de conférence (webconf sans séminaire associé)
+ # Pour les conférences, pas de validation nécessaire, juste vérifier que l'attestation existe
+ t.append(testimonial)
+ elif testimonial.seminar:
# Attestation de séminaire
seminar = testimonial.seminar
if seminar_validated(user, seminar) and (get_seminar_delta(user, seminar) >= 0 or testimonial.date_added <= REVISION_DATE_FILTER):
t.append(testimonial)
- elif testimonial.conference:
- # Attestation de conférence (webconf sans séminaire associé)
- # Pour les conférences, pas de validation nécessaire, juste vérifier que l'attestation existe
- t.append(testimonial)
return t
def get_context_data(self, **kwargs):