Skip to content
Snippets Groups Projects
Commit d6c15ffd authored by Robert Raposa's avatar Robert Raposa
Browse files

Add new waffle for modals.

parent 8b7701df
No related merge requests found
"""
Learner analytics helpers and settings
"""
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlagNamespace
from openedx.core.djangoapps.waffle_utils import (
CourseWaffleFlag, WaffleFlag, WaffleFlagNamespace
)
# Namespace for learner analytics waffle flags.
WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='learner_analytics')
# Simple safety valve in case the modal breaks DOM.
INCLUDE_UPSELL_MODAL = WaffleFlag(WAFFLE_FLAG_NAMESPACE, 'include_upsell_modal')
# Enables the learner analytics page for different courses via waffle course overrides.
ENABLE_DASHBOARD_TAB = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'enable_dashboard_tab')
......@@ -7,7 +7,7 @@ from django.core.urlresolvers import reverse
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangolib.js_utils import js_escaped_string
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.learner_analytics import ENABLE_DASHBOARD_TAB
from openedx.features.learner_analytics import INCLUDE_UPSELL_MODAL
%>
<%namespace name='static' file='/static_content.html'/>
......@@ -85,8 +85,7 @@ from openedx.features.learner_analytics import ENABLE_DASHBOARD_TAB
<div id="currency_data" value="${currency_data}"></div>
<div class="container">
<% course_key = CourseKey.from_string('course-v1:Fake+Course+Key') %>
% if ENABLE_DASHBOARD_TAB.is_enabled(course_key):
% if INCLUDE_UPSELL_MODAL.is_enabled():
${static.renderReact(
component="UpsellExperimentModal",
id="upsell-modal",
......
......@@ -18,7 +18,7 @@ from openedx.core.djangoapps.theming import helpers as theming_helpers
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.learner_analytics import ENABLE_DASHBOARD_TAB
from openedx.features.learner_analytics import INCLUDE_UPSELL_MODAL
from entitlements.models import CourseEntitlement
from student.models import CourseEnrollment
......@@ -125,8 +125,7 @@ from student.models import CourseEnrollment
<section class="dashboard" id="dashboard-main">
<main class="main-container" id="main" aria-label="Content" tabindex="-1">
<% course_key = CourseKey.from_string('course-v1:Fake+Course+Key') %>
% if ENABLE_DASHBOARD_TAB.is_enabled(course_key):
% if INCLUDE_UPSELL_MODAL.is_enabled():
${static.renderReact(
component="UpsellExperimentModal",
id="upsell-modal",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment