## mako

<%page expression_filter="h"/>

<%namespace name='static' file='../../static_content.html'/>

<%!
from django.conf import settings
from openedx.core.djangolib.js_utils import js_escaped_string
from openedx.features.course_experience import SHOW_REVIEWS_TOOL_FLAG
%>

% if SHOW_REVIEWS_TOOL_FLAG.is_enabled(course.id):
    <div class="coursetalk-read-reviews">
        <span class="fa fa-spinner fa-spin" aria-hidden="true"></span>
        ## Coursetalk Widget
        <div id="ct-custom-read-review-widget" data-provider="${platform_key}" data-course="${course.id}"></div>
    </div>
% endif

<%static:webpack entry="CourseTalkReviews">
    new CourseTalkReviews({
        toggleButton: '.toggle-read-write-reviews',
        loadIcon: '.coursetalk-read-reviews .fa.fa-spinner',
        readSrc: "${settings.COURSE_TALK_READ_ONLY_SOURCE | n, js_escaped_string}",
        writeSrc: "${settings.COURSE_TALK_WRITE_ONLY_SOURCE | n, js_escaped_string}"
    });
</%static:webpack>
