Commit 61ddec46 by Victor Shnayder

Use params from view in template.

parent 003dc7ef
...@@ -159,54 +159,43 @@ ...@@ -159,54 +159,43 @@
%> %>
% if course.has_ended() and cert_status: % if course.has_ended() and cert_status:
<% <%
passing_grade = False if cert_status['status'] == 'generating':
cert_button = False
survey_button = False
if cert_status['status'] in [CertificateStatuses.generating, CertificateStatuses.regenerating]:
status_css_class = 'course-status-certrendering' status_css_class = 'course-status-certrendering'
cert_button = True elif cert_status['status'] == 'ready':
survey_button = True
passing_grade = True
elif cert_status['status'] == CertificateStatuses.downloadable:
status_css_class = 'course-status-certavailable' status_css_class = 'course-status-certavailable'
cert_button = True elif cert_status['status'] == 'notpassing':
survey_button = True
passing_grade = True
elif cert_status['status'] == CertificateStatuses.notpassing:
status_css_class = 'course-status-certnotavailable' status_css_class = 'course-status-certnotavailable'
survey_button = True
else: else:
# This is primarily the 'unavailable' state, but also 'error', 'deleted', etc.
status_css_class = 'course-status-processing' status_css_class = 'course-status-processing'
if survey_button and not course.end_of_course_survey_url:
survey_button = False
%> %>
<div class="message message-status ${status_css_class} is-shown"> <div class="message message-status ${status_css_class} is-shown">
% if cert_status['status'] == CertificateStatuses.unavailable: % if cert_status['status'] == 'processing':
<p class="message-copy">Final course details are being wrapped up at this time. <p class="message-copy">Final course details are being wrapped up at
Your final standing will be available shortly.</p> this time. Your final standing will be available shortly.</p>
% elif passing_grade: % elif cert_status['status'] in ('generating', 'ready'):
<p class="message-copy">You have received a grade of <p class="message-copy">You have received a grade of
<span class="grade-value">${cert_status['grade']}</span> <span class="grade-value">${cert_status['grade']}</span>
in this course.</p> in this course.</p>
% elif cert_status['status'] == CertificateStatuses.notpassing: % elif cert_status['status'] == 'notpassing':
<p class="message-copy">You did not complete the necessary requirements for completion of this course. <p class="message-copy">You did not complete the necessary requirements for
</p> completion of this course.</p>
% endif % endif
% if cert_button or survey_button:
% if cert_status['show_disabled_download_button'] or cert_status['show_download_url'] or cert_status['show_survey_button']:
<ul class="actions"> <ul class="actions">
% if cert_button and cert_status['status'] in [CertificateStatuses.generating, CertificateStatuses.regenerating]: % if cert_status['show_disabled_download_button']:
<li class="action"><span class="btn disabled" href="">Your Certificate is Generating</span></li> <li class="action"><span class="btn disabled" href="">
% elif cert_button and cert_status['status'] == CertificateStatuses.downloadable: Your Certificate is Generating</span></li>
% elif cert_status['show_download_url']:
<li class="action"> <li class="action">
<a class="btn" href="${cert_status['download_url']}" <a class="btn" href="${cert_status['download_url']}"
title="This link will open/download a PDF document"> title="This link will open/download a PDF document">
Download Your PDF Certificate</a></li> Download Your PDF Certificate</a></li>
% endif % endif
% if survey_button:
<li class="action"><a class="cta" href="${course.end_of_course_survey_url}"> % if cert_status['show_survey_button']:
<li class="action"><a class="cta" href="${cert_status['survey_url']}">
Complete our course feedback survey</a></li> Complete our course feedback survey</a></li>
% endif % endif
</ul> </ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment