Commit 8e636677 by cahrens

Display tags in note template.

parent 64047478
......@@ -12,6 +12,7 @@ define(['backbone', 'js/edxnotes/utils/utils', 'underscore.string'], function (B
'text': '',
'quote': '',
'ranges': [],
'tags': [],
'unit': {
'display_name': '',
'url': '',
......
......@@ -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 () {
......
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment