Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
dc8b1caf
Commit
dc8b1caf
authored
Nov 09, 2017
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Studio Section Highlights: add doc and preview text to modal
parent
d037a19c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
13 deletions
+41
-13
cms/djangoapps/contentstore/views/item.py
+13
-8
cms/djangoapps/contentstore/views/tests/test_item.py
+1
-1
cms/envs/help_tokens.ini
+1
-0
cms/static/js/models/xblock_info.js
+3
-1
cms/static/js/views/modals/course_outline_modals.js
+23
-3
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
dc8b1caf
...
...
@@ -46,8 +46,9 @@ from contentstore.views.helpers import (
)
from
contentstore.views.preview
import
get_preview_fragment
from
edxmako.shortcuts
import
render_to_string
from
help_tokens.core
import
HelpUrlExpert
from
models.settings.course_grading
import
CourseGradingModel
from
openedx.core.djangoapps.waffle_utils
import
WaffleSwitch
from
openedx.core.djangoapps.waffle_utils
import
CourseWaffleFlag
,
WaffleFlagNamespace
,
WaffleSwitch
from
openedx.core.lib.gating
import
api
as
gating_api
from
openedx.core.lib.xblock_utils
import
request_token
,
wrap_xblock
from
static_replace
import
replace_static_urls
...
...
@@ -80,6 +81,14 @@ NEVER = lambda x: False
ALWAYS
=
lambda
x
:
True
highlights_setting
=
WaffleSwitch
(
u'dynamic_pacing'
,
u'studio_course_update'
)
COURSE_UPDATE_WAFFLE_FLAG
=
CourseWaffleFlag
(
waffle_namespace
=
WaffleFlagNamespace
(
name
=
u'schedules'
),
flag_name
=
u'send_updates_for_course'
,
flag_undefined_default
=
False
)
def
hash_resource
(
resource
):
"""
Hash a :class:`xblock.fragment.FragmentResource`.
...
...
@@ -1186,7 +1195,9 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
elif
xblock
.
category
==
'chapter'
:
xblock_info
.
update
({
'highlights'
:
xblock
.
highlights
,
'highlights_enabled'
:
highlights_setting
()
.
is_enabled
(),
'highlights_enabled'
:
highlights_setting
.
is_enabled
(),
'highlights_preview_only'
:
not
COURSE_UPDATE_WAFFLE_FLAG
.
is_enabled
(
course
.
id
),
'highlights_doc_url'
:
HelpUrlExpert
.
the_one
()
.
url_for_token
(
'content-highlights'
),
})
# update xblock_info with special exam information if the feature flag is enabled
...
...
@@ -1248,12 +1259,6 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
return
xblock_info
def
highlights_setting
():
namespace
=
u'dynamic_pacing'
switch
=
u'studio_course_update'
return
WaffleSwitch
(
namespace
,
switch
)
def
add_container_page_publishing_info
(
xblock
,
xblock_info
):
# pylint: disable=invalid-name
"""
Adds information about the xblock's publish state to the supplied
...
...
cms/djangoapps/contentstore/views/tests/test_item.py
View file @
dc8b1caf
...
...
@@ -2574,7 +2574,7 @@ class TestXBlockInfo(ItemTest):
def
test_highlights_enabled
(
self
):
chapter
=
modulestore
()
.
get_item
(
self
.
chapter
.
location
)
with
highlights_setting
()
.
override
():
with
highlights_setting
.
override
():
xblock_info
=
create_xblock_info
(
chapter
)
self
.
assertTrue
(
xblock_info
[
'highlights_enabled'
])
...
...
cms/envs/help_tokens.ini
View file @
dc8b1caf
...
...
@@ -32,6 +32,7 @@ group_configurations = course_author:course_features/content_experiments/content
container
=
course_author:developing_course/course_components.html#components-that-contain-other-components
video
=
course_author:video/index.html
certificates
=
course_author:set_up_course/studio_add_course_information/studio_creating_certificates.html
content_highlights
=
course_author:developing_course/course_sections.html#set-section-highlights-for-weekly-course-highlight-messages
# below are the language directory names for the different locales
[locales]
...
...
cms/static/js/models/xblock_info.js
View file @
dc8b1caf
...
...
@@ -164,7 +164,9 @@ function(Backbone, _, str, ModuleUtils) {
* This xBlock's Highlights to message to learners.
*/
highlights
:
null
,
highlights_enabled
:
null
highlights_enabled
:
null
,
highlights_preview_only
:
null
,
highlights_doc_url
:
null
},
initialize
:
function
()
{
...
...
cms/static/js/views/modals/course_outline_modals.js
View file @
dc8b1caf
...
...
@@ -236,12 +236,32 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
},
getIntroductionMessage
:
function
()
{
return
StringUtils
.
interpolate
(
var
preview_text
=
''
;
if
(
this
.
model
.
get
(
'highlights_preview_only'
))
{
preview_text
=
StringUtils
.
interpolate
(
gettext
(
'We are testing this feature right now. So messages will not actually be sent at this time.'
)
);
preview_text
=
'<p><b>'
+
preview_text
+
'</b></p>'
;
}
var
intro_text
=
StringUtils
.
interpolate
(
gettext
(
'Enter 3-5 highlights to include in the email message that learners receive for '
+
'this section (250 character limit).'
'Enter 3-5 highlights to include in the email message that learners receive for '
+
'this section (250 character limit).'
)
);
var
doc_text
=
StringUtils
.
interpolate
(
gettext
(
'For more information and an example of the email template, '
+
'read our {linkStart}documentation{linkEnd}.'
),
{
linkStart
:
'<a href="{'
+
this
.
model
.
get
(
'highlights_doc_url'
)
+
'}">'
,
linkEnd
:
'</a>'
}
);
return
preview_text
+
intro_text
+
'<p>'
+
doc_text
+
'</p>'
;
},
callAnalytics
:
function
(
event
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment