From b41d23747a438f7ffd36bde752cb1db7decc16b4 Mon Sep 17 00:00:00 2001 From: Frances Botsford Date: Mon, 1 Jul 2013 15:07:52 -0400 Subject: [PATCH] PDF Textbooks: implemented "View Live" link --- cms/static/js/views/textbook.js | 5 ++++- cms/templates/js/show-textbook.underscore | 2 +- cms/templates/textbooks.html | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cms/static/js/views/textbook.js b/cms/static/js/views/textbook.js index b9fabae6f2..9d83df0de2 100644 --- a/cms/static/js/views/textbook.js +++ b/cms/static/js/views/textbook.js @@ -12,7 +12,10 @@ CMS.Views.ShowTextbook = Backbone.View.extend({ "click .hide-chapters": "hideChapters" }, render: function() { - this.$el.html(this.template(this.model.attributes)); + var attrs = $.extend({}, this.model.attributes); + attrs.bookindex = this.model.collection.indexOf(this.model); + attrs.course = window.section.attributes; + this.$el.html(this.template(attrs)); return this; }, editTextbook: function(e) { diff --git a/cms/templates/js/show-textbook.underscore b/cms/templates/js/show-textbook.underscore index 4954793129..1767340723 100644 --- a/cms/templates/js/show-textbook.underscore +++ b/cms/templates/js/show-textbook.underscore @@ -34,7 +34,7 @@