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
e59410be
Commit
e59410be
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
7 changed files
with
52 additions
and
19 deletions
+52
-19
cms/djangoapps/contentstore/views/item.py
+10
-9
cms/djangoapps/contentstore/views/tests/test_item.py
+1
-1
cms/envs/help_tokens.ini
+1
-0
cms/static/js/models/xblock_info.js
+4
-2
cms/static/js/views/modals/course_outline_modals.js
+4
-7
cms/static/sass/views/_outline.scss
+4
-0
cms/templates/js/highlights-editor.underscore
+28
-0
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
e59410be
...
...
@@ -46,8 +46,10 @@ 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.schedules.config
import
COURSE_UPDATE_WAFFLE_FLAG
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 +82,9 @@ NEVER = lambda x: False
ALWAYS
=
lambda
x
:
True
highlights_setting
=
WaffleSwitch
(
u'dynamic_pacing'
,
u'studio_course_update'
)
def
hash_resource
(
resource
):
"""
Hash a :class:`xblock.fragment.FragmentResource`.
...
...
@@ -1185,8 +1190,10 @@ 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'
:
getattr
(
xblock
,
'highlights'
,
[]),
'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 +1255,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 @
e59410be
...
...
@@ -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 @
e59410be
...
...
@@ -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 @
e59410be
...
...
@@ -163,8 +163,10 @@ function(Backbone, _, str, ModuleUtils) {
/**
* This xBlock's Highlights to message to learners.
*/
highlights
:
null
,
highlights_enabled
:
null
highlights
:
[],
highlights_enabled
:
false
,
highlights_preview_only
:
true
,
highlights_doc_url
:
''
},
initialize
:
function
()
{
...
...
cms/static/js/views/modals/course_outline_modals.js
View file @
e59410be
...
...
@@ -236,12 +236,7 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
},
getIntroductionMessage
:
function
()
{
return
StringUtils
.
interpolate
(
gettext
(
'Enter 3-5 highlights to include in the email message that learners receive for '
+
'this section (250 character limit).'
)
);
return
''
;
},
callAnalytics
:
function
(
event
)
{
...
...
@@ -930,7 +925,9 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
{},
AbstractEditor
.
prototype
.
getContext
.
call
(
this
),
{
highlights
:
this
.
model
.
get
(
'highlights'
)
||
[]
highlights
:
this
.
model
.
get
(
'highlights'
),
highlights_preview_only
:
this
.
model
.
get
(
'highlights_preview_only'
),
highlights_doc_url
:
this
.
model
.
get
(
'highlights_doc_url'
)
}
);
}
...
...
cms/static/sass/views/_outline.scss
View file @
e59410be
...
...
@@ -671,6 +671,10 @@
.highlight-input-label
{
font-weight
:
600
;
}
.highlights-info
{
font-size
:
smaller
;
}
}
// outline: edit item settings
...
...
cms/templates/js/highlights-editor.underscore
View file @
e59410be
<form>
<h3 class="modal-section-title" id="highlights_label"><%- gettext('Section Highlights') %></h3>
<div class="highlights-info">
<% if (highlights_preview_only) { %>
<p><b>
<%- gettext('This feature is currently in testing. Course teams can enter highlights, but learners will not receive email messages.') %>
</b></p>
<% } %>
<%- gettext('Enter 3-5 highlights to include in the email message that learners receive for this section (250 character limit).') %>
<p>
<br>
<% // xss-lint: disable=underscore-not-escaped %>
<%= edx.HtmlUtils.interpolateHtml(
gettext(
'For more information and an example of the email template, ' +
'read our {linkStart}documentation{linkEnd}.'
),
{
linkStart: edx.HtmlUtils.HTML('<a href="' + highlights_doc_url + '">'),
linkEnd: edx.HtmlUtils.HTML('</a>')
}
) %>
</p>
</div>
<hr>
<div class="modal-section-content block-highlights">
<div role="group" class="list-fields" aria-labelledby="highlights_label">
<%
...
...
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