Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Add location to single event
Browse files Browse the repository at this point in the history
  • Loading branch information
jrjohnson committed Mar 24, 2016
1 parent e2f572f commit f4c2183
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions addon/components/ilios-calendar-single-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default Component.extend({
sessionTitle: null,
description: null,
offeredAtPhrase: null,
location: null,
taughtByPhrase: null,
sessionIsPhrase: null,
noContentPhrase: 'None',
Expand Down
1 change: 1 addition & 0 deletions addon/templates/components/ilios-calendar-single-event.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{{courseTitle}} - <em>{{sessionTitle}}</em>
</h1>
<div class='ilios-calendar-single-event-offered-at'>{{offeredAtPhrase}}</div>
<div class='ilios-calendar-single-event-location'>{{location}}</div>
{{#if taughtByPhrase}}
<div class='ilios-calendar-single-event-instructors'>{{taughtByPhrase}}</div>
{{/if}}
Expand Down
1 change: 1 addition & 0 deletions tests/dummy/app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default Controller.extend({
courseTitle: 'Fake Event',
sessionTitle: 'Fake Event',
offeredAtPhrase: 'On ' + moment(event.startDate).format('dddd, MMMM Do YYYY, h:mm a'),
location: event.location,
taughtByPhrase: 'Taught By Barry Bods, Neil deGrasse Tyson',
sessionIs: 'Session is "lecture"',
courseObjectives: [
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1>Demo of ilios-calendar</h1>
{{#unless fakeSingleEvent}}
{{ilios-calendar
{{ilios-calendar
calendarEventsPromise=calendarEventsPromise
selectedView=selectedView
selectedDate=selectedDate
Expand All @@ -15,6 +15,7 @@
courseTitle=fakeSingleEvent.courseTitle
sessionTitle=fakeSingleEvent.sessionTitle
offeredAtPhrase=fakeSingleEvent.offeredAtPhrase
location=fakeSingleEvent.location
sessionIsPhrase=fakeSingleEvent.sessionIsPhrase
taughtByPhrase=fakeSingleEvent.taughtByPhrase
courseObjectives=fakeSingleEvent.courseObjectives
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ test('taughtBy does not display', function(assert) {

assert.ok(isEmpty(this.$('.ilios-calendar-single-event-instructors')));
});

test('setting location changes display', function(assert) {
assert.expect(1);
this.render(hbs`{{ilios-calendar-single-event location='Room 1b'
courseObjectives=courseObjectives
sessionObjectives=sessionObjectives
}}`);
assert.notEqual(this.$().text().trim().search(/Room 1b/), -1);
});

0 comments on commit f4c2183

Please sign in to comment.