Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
30c14b36
Commit
30c14b36
authored
6 years ago
by
Matthew Piatetsky
Browse files
Options
Downloads
Patches
Plain Diff
bundles on track selection
parent
0ec4232c
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/course_modes/views.py
+19
-0
19 additions, 0 deletions
common/djangoapps/course_modes/views.py
themes/edx.org/lms/templates/course_modes/choose.html
+4
-1
4 additions, 1 deletion
themes/edx.org/lms/templates/course_modes/choose.html
with
23 additions
and
1 deletion
common/djangoapps/course_modes/views.py
+
19
−
0
View file @
30c14b36
...
...
@@ -28,6 +28,8 @@ from lms.djangoapps.commerce.utils import EcommerceService
from
lms.djangoapps.experiments.utils
import
get_experiment_user_metadata_context
from
openedx.core.djangoapps.catalog.utils
import
get_currency_data
from
openedx.core.djangoapps.embargo
import
api
as
embargo_api
from
openedx.core.djangoapps.programs.utils
import
ProgramDataExtender
,
ProgramProgressMeter
from
openedx.core.djangoapps.waffle_utils
import
WaffleFlag
,
WaffleFlagNamespace
from
student.models
import
CourseEnrollment
from
util.db
import
outer_atomic
from
xmodule.modulestore.django
import
modulestore
...
...
@@ -140,7 +142,24 @@ class ChooseModeView(View):
in
CourseMode
.
modes_for_course
(
course_key
,
only_selectable
=
False
)
)
course_id
=
text_type
(
course_key
)
bundle_data
=
{}
bundles_on_track_selection
=
WaffleFlag
(
WaffleFlagNamespace
(
name
=
u
'
experiments
'
),
u
'
bundles_on_track_selection
'
)
if
bundles_on_track_selection
.
is_enabled
():
meter
=
ProgramProgressMeter
(
request
.
site
,
request
.
user
,
enrollments
=
[
CourseEnrollment
])
if
meter
.
programs
and
meter
.
programs
[
0
]:
program_data
=
meter
.
programs
[
0
]
program_data
=
ProgramDataExtender
(
program_data
,
request
.
user
,
mobile_only
=
False
).
extend
()
skus
=
program_data
.
get
(
'
skus
'
)
ecommerce_service
=
EcommerceService
()
bundle_data
=
{
'
program_marketing_site_url
'
:
program_data
.
get
(
'
marketing_url
'
),
'
program_bundle_url
'
:
ecommerce_service
.
get_checkout_page_url
(
*
skus
),
'
discount_data
'
:
program_data
.
get
(
'
discount_data
'
),
}
context
=
{
"
bundle_data
"
:
bundle_data
,
"
course_modes_choose_url
"
:
reverse
(
"
course_modes_choose
"
,
kwargs
=
{
'
course_id
'
:
course_id
}
...
...
This diff is collapsed.
Click to expand it.
themes/edx.org/lms/templates/course_modes/choose.html
+
4
−
1
View file @
30c14b36
...
...
@@ -5,7 +5,7 @@
from
django.utils.translation
import
ugettext
as
_
from
django.urls
import
reverse
from
opaque_keys.edx.keys
import
CourseKey
from
openedx.core.djangolib.js_utils
import
js_escaped_string
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
INCLUDE_UPSELL_MODAL
from
openedx.features.portfolio_project
import
INCLUDE_PORTFOLIO_UPSELL_MODAL
...
...
@@ -85,6 +85,9 @@ from openedx.features.portfolio_project import INCLUDE_PORTFOLIO_UPSELL_MODAL
%endif
<div
id=
"currency_data"
value=
"${currency_data}"
></div>
<script
type=
"application/json"
id=
"bundle-data"
>
$
{
bundle_data
|
n
,
dump_js_escaped_json
}
</script>
<div
class=
"container"
>
% if INCLUDE_UPSELL_MODAL.is_enabled():
${static.renderReact(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment