Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #494 from edx/ajpal/date-link
Browse files Browse the repository at this point in the history
Remove Date Last Updated from roster view
  • Loading branch information
ajpal authored Jun 29, 2016
2 parents 01103b3 + f6e60c7 commit 0acb206
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ define(function (require) {
expect(controller.options.rootView.$('.learners-header-region').html())
.toContainText('Learner Details');
expect(controller.options.rootView.$('.learners-header-region').html())
.toContainText(date.toLocaleDateString('en-us', {year: 'numeric', month: 'long', day: 'numeric'}));
.not.toContainText(date.toLocaleDateString('en-us', {year: 'numeric', month: 'long', day: 'numeric'}));
expect(controller.options.trackingModel.get('page')).toBe('learner_details');
expect(controller.options.trackingModel.trigger).toHaveBeenCalledWith('segment:page');
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<div class="section-heading bordered">
<h4 class="section-title"><%- title %></h4>
<span class="section-heading-note small"><%- lastUpdated %></span>
</div>
8 changes: 1 addition & 7 deletions analytics_dashboard/static/apps/learners/app/views/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ define(function (require) {
var _ = require('underscore'),
Marionette = require('marionette'),

Utils = require('utils/utils'),
headerTemplate = require('text!learners/app/templates/header.underscore'),

HeaderView;
Expand All @@ -21,13 +20,8 @@ define(function (require) {
},

templateHelpers: function () {
var lastUpdatedMessage = _.template(gettext('Date Last Updated: <%- lastUpdatedDateString %>')),
lastUpdatedDateString = this.model.has('lastUpdated') ?
Utils.formatDate(this.model.get('lastUpdated')) :
gettext('unknown');
return {
title: this.model.get('title'),
lastUpdated: lastUpdatedMessage({lastUpdatedDateString: lastUpdatedDateString})
title: this.model.get('title')
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ define(function (require) {
}).render();

expect(fixture).toContainText('First Title');
expect(fixture).toContainText('Date Last Updated: unknown');
expect(fixture).not.toContainText('Date Last Updated: unknown');
pageModel.set('title', 'Updated Title');
expect(fixture).toContainText('Updated Title');
});
Expand All @@ -37,7 +37,7 @@ define(function (require) {
model: pageModel
}).render();

expect(fixture).toContainText('Date Last Updated: January 15, 2016');
expect(fixture).not.toContainText('Date Last Updated: January 15, 2016');
});

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define(function (require) {

it('renders a header title and date', function () {
expect(this.rootView.$('.learners-header-region').html()).toContainText('Testing Title');
expect(this.rootView.$('.learners-header-region').html()).toContainText('February 28, 2016');
expect(this.rootView.$('.learners-header-region').html()).not.toContainText('February 28, 2016');
});

it('renders and clears alerts', function () {
Expand Down

0 comments on commit 0acb206

Please sign in to comment.