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
30dfa98b
Commit
30dfa98b
authored
Oct 30, 2017
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Section Highlights Studio UI: Encircle number of highlights
parent
dbad9fbc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
18 deletions
+27
-18
cms/static/js/spec/views/pages/course_outline_spec.js
+7
-5
cms/static/sass/views/_outline.scss
+16
-2
cms/templates/js/course-outline.underscore
+4
-11
No files found.
cms/static/js/spec/views/pages/course_outline_spec.js
View file @
30dfa98b
...
...
@@ -532,7 +532,7 @@ define(['jquery', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'common/j
describe
(
'Section Highlights'
,
function
()
{
var
createCourse
,
createCourseWithHighlights
,
createCourseWithHighlightsDisabled
,
mockHighlightValues
,
highlightsLink
,
highlightInputs
,
openHighlights
,
saveHighlights
,
setHighlights
,
expectHighlightLink
Text
ToBe
,
expectHighlightsToBe
,
expectServerHandshakeWithHighlights
,
expectHighlightLink
Number
ToBe
,
expectHighlightsToBe
,
expectServerHandshakeWithHighlights
,
expectHighlightsToUpdate
,
maxNumHighlights
=
5
;
...
...
@@ -591,8 +591,10 @@ define(['jquery', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'common/j
}
};
expectHighlightLinkTextToBe
=
function
(
expectedValue
)
{
expect
(
highlightsLink
()).
toContainText
(
expectedValue
);
expectHighlightLinkNumberToBe
=
function
(
expectedNumber
)
{
var
link
=
highlightsLink
();
expect
(
link
).
toContainText
(
'Section Highlights'
);
expect
(
link
.
find
(
'.number-highlights'
)).
toHaveHtml
(
expectedNumber
);
};
expectHighlightsToBe
=
function
(
expectedHighlights
)
{
...
...
@@ -645,13 +647,13 @@ define(['jquery', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'common/j
it
(
'displays link when no highlights exist'
,
function
()
{
createCourseWithHighlights
([]);
expectHighlightLink
TextToBe
(
'Enter Section Highlights'
);
expectHighlightLink
NumberToBe
(
0
);
});
it
(
'displays link when highlights exist'
,
function
()
{
var
highlights
=
mockHighlightValues
(
2
);
createCourseWithHighlights
(
highlights
);
expectHighlightLink
TextToBe
(
'Section Highlights: 2 entered'
);
expectHighlightLink
NumberToBe
(
2
);
});
it
(
'can view when no highlights exist'
,
function
()
{
...
...
cms/static/sass/views/_outline.scss
View file @
30dfa98b
...
...
@@ -640,10 +640,24 @@
color
:
theme-color
(
"primary"
);
}
.number-highlights
{
background
:
theme-color
(
"primary"
);
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
color
:
$white
;
display
:
inline-block
;
font-weight
:
bold
;
line-height
:
18px
;
margin-right
:
2px
;
text-align
:
center
;
width
:
18px
;
}
.highlight-input-text
{
width
:
100%
;
margin-bottom
:
5px
;
margin-top
:
5px
;
margin-bottom
:
(
$baseline
/
4
)
;
margin-top
:
(
$baseline
/
4
)
;
}
.highlights-description
{
...
...
cms/templates/js/course-outline.underscore
View file @
30dfa98b
...
...
@@ -201,20 +201,13 @@ if (is_proctored_exam) {
</div>
<% } %>
<% if (xblockInfo.get('highlights_enabled') && course.get('self_paced') && xblockInfo.isChapter()) { %>
<div class="block-highlights">
<span class="sr block-highlights-label"><%- gettext('Highlights:') %></span>
<div class="block-highlights">
<% var number_of_highlights = (xblockInfo.get('highlights') || []).length; %>
<% if (number_of_highlights > 0) { %>
<span class="block-highlights-value highlights-button action-button">
<%- edx.StringUtils.interpolate(
gettext('Section Highlights: {number_of_highlights} entered'),
{number_of_highlights: number_of_highlights}
) %>
<span class="number-highlights"><%- number_of_highlights %></span>
<%- gettext('Section Highlights') %>
</span>
<% } else { %>
<span class="block-highlights-value highlights-button action-button"><%- gettext('Enter Section Highlights') %></span>
<% } %>
</div>
</div>
<% } %>
<% if (xblockInfo.get('is_time_limited')) { %>
<div class="status-timed-proctored-exam">
...
...
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