Schedules: Course Update support bulleted highlights
This commit is contained in:
@@ -320,7 +320,7 @@ class CourseUpdateResolver(BinnedSchedulesBaseResolver):
|
|||||||
for schedule in schedules:
|
for schedule in schedules:
|
||||||
enrollment = schedule.enrollment
|
enrollment = schedule.enrollment
|
||||||
try:
|
try:
|
||||||
week_summary = get_course_week_summary(enrollment.course_id, week_num)
|
week_highlights = get_week_highlights(enrollment.course_id, week_num)
|
||||||
except CourseUpdateDoesNotExist:
|
except CourseUpdateDoesNotExist:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ class CourseUpdateResolver(BinnedSchedulesBaseResolver):
|
|||||||
self.site, reverse('course_root', args=[course_id_str])
|
self.site, reverse('course_root', args=[course_id_str])
|
||||||
),
|
),
|
||||||
'week_num': week_num,
|
'week_num': week_num,
|
||||||
'week_summary': week_summary,
|
'week_highlights': week_highlights,
|
||||||
|
|
||||||
# This is used by the bulk email optout policy
|
# This is used by the bulk email optout policy
|
||||||
'course_ids': [course_id_str],
|
'course_ids': [course_id_str],
|
||||||
@@ -344,9 +344,9 @@ class CourseUpdateResolver(BinnedSchedulesBaseResolver):
|
|||||||
|
|
||||||
|
|
||||||
@request_cached
|
@request_cached
|
||||||
def get_course_week_summary(course_id, week_num):
|
def get_week_highlights(course_id, week_num):
|
||||||
if COURSE_UPDATE_WAFFLE_FLAG.is_enabled(course_id):
|
if COURSE_UPDATE_WAFFLE_FLAG.is_enabled(course_id):
|
||||||
course = modulestore().get_course(course_id)
|
course = modulestore().get_course(course_id)
|
||||||
return course.week_summary(week_num)
|
return course.highlights_for_week(week_num)
|
||||||
else:
|
else:
|
||||||
raise CourseUpdateDoesNotExist()
|
raise CourseUpdateDoesNotExist()
|
||||||
|
|||||||
@@ -20,31 +20,18 @@
|
|||||||
<p>
|
<p>
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
Here is what you can look forward to learning this week:
|
Here is what you can look forward to learning this week:
|
||||||
<p>{{ week_summary }}</p>
|
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
<ul>
|
||||||
|
{% for highlight in week_highlights %}
|
||||||
|
<li>{{ highlight }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
{% trans "Resume your course now" as course_cta_text %}
|
||||||
<!-- email client support for style sheets is pretty spotty, so we have to inline all of these styles -->
|
{% include "schedules/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%}
|
||||||
<a
|
|
||||||
href="{{ course_url }}"
|
{% include "schedules/edx_ace/common/upsell_cta.html"%}
|
||||||
style="
|
|
||||||
color: #ffffff;
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
-webkit-border-radius: 4px;
|
|
||||||
-moz-border-radius: 4px;
|
|
||||||
background-color: #005686;
|
|
||||||
border-top: 10px solid #005686;
|
|
||||||
border-bottom: 10px solid #005686;
|
|
||||||
border-right: 16px solid #005686;
|
|
||||||
border-left: 16px solid #005686;
|
|
||||||
display: inline-block;
|
|
||||||
">
|
|
||||||
<!-- old email clients require the use of the font tag :( -->
|
|
||||||
<font color="#ffffff"><b>{% trans "Resume your course now" %}</b></font>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -7,3 +7,5 @@ Here is what you can look forward to learning this week:
|
|||||||
{{ week_summary }}
|
{{ week_summary }}
|
||||||
|
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
|
||||||
|
{% include "schedules/edx_ace/common/upsell_cta.txt"%}
|
||||||
|
|||||||
Reference in New Issue
Block a user