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
8e636677
Commit
8e636677
authored
Apr 29, 2015
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display tags in note template.
parent
64047478
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
lms/static/js/edxnotes/models/note.js
+1
-0
lms/static/js/spec/edxnotes/views/note_item_spec.js
+15
-2
lms/templates/edxnotes/note-item.underscore
+5
-0
No files found.
lms/static/js/edxnotes/models/note.js
View file @
8e636677
...
...
@@ -12,6 +12,7 @@ define(['backbone', 'js/edxnotes/utils/utils', 'underscore.string'], function (B
'text'
:
''
,
'quote'
:
''
,
'ranges'
:
[],
'tags'
:
[],
'unit'
:
{
'display_name'
:
''
,
'url'
:
''
,
...
...
lms/static/js/spec/edxnotes/views/note_item_spec.js
View file @
8e636677
...
...
@@ -53,8 +53,21 @@ define([
it
(
'should display update value and accompanying text'
,
function
()
{
var
view
=
getView
();
expect
(
view
.
$
(
'.reference-title'
).
last
()).
toContainText
(
'Last Edited:'
);
expect
(
view
.
$
(
'.reference-meta'
).
last
()).
toContainText
(
'December 11, 2014 at 11:12AM'
);
expect
(
view
.
$
(
'.reference-title'
)[
1
]).
toContainText
(
'Last Edited:'
);
expect
(
view
.
$
(
'.reference-updated-date'
).
last
()).
toContainText
(
'December 11, 2014 at 11:12AM'
);
});
it
(
'should not display tags if there are none'
,
function
()
{
var
view
=
getView
();
expect
(
view
.
$el
).
not
.
toContain
(
'.reference-tags'
);
expect
(
view
.
$
(
'.reference-title'
).
length
).
toBe
(
2
);
});
it
(
'should display tags if they exist'
,
function
()
{
var
view
=
getView
({
tags
:
[
"First"
,
"Second"
]});
expect
(
view
.
$
(
'.reference-title'
).
length
).
toBe
(
3
);
expect
(
view
.
$
(
'.reference-title'
)[
2
]).
toContainText
(
'Tags:'
);
expect
(
view
.
$
(
'.reference-tags'
).
last
()).
toContainText
(
'First, Second'
);
});
it
(
'should log the edx.student_notes.used_unit_link event properly'
,
function
()
{
...
...
lms/templates/edxnotes/note-item.underscore
View file @
8e636677
...
...
@@ -34,5 +34,10 @@
<h3 class="reference-title"><%- gettext("Last Edited:") %></h3>
<span class="reference-meta reference-updated-date"><%- updated %></span>
<% if (tags.length > 0) { %>
<h3 class="reference-title"><%- gettext("Tags:") %></h3>
<span class="reference-meta reference-tags"><%- tags.join(", ") %></span>
<% } %>
</div>
</footer>
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