book_url doesn't come from settings

This commit is contained in:
kimth
2012-08-20 12:40:34 -04:00
parent 6a05a812c3
commit 987d7bcc29
2 changed files with 6 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
from django.conf import settings
from django.contrib.auth.decorators import login_required
from mitxmako.shortcuts import render_to_response
@@ -13,8 +14,10 @@ def index(request, course_id, book_index, page=0):
textbook = course.textbooks[int(book_index)]
table_of_contents = textbook.table_of_contents
book_url = settings.BOOK_URL
return render_to_response('staticbook.html',
{'page': int(page), 'course': course,
{'page': int(page), 'course': course, 'book_url': book_url,
'table_of_contents': table_of_contents,
'staff_access': staff_access})

View File

@@ -32,7 +32,7 @@ function goto_page(n) {
if(n<10) {
prefix="00";
}
$("#bookpage").attr("src","${ settings.BOOK_URL }p"+prefix+n+".png");
$("#bookpage").attr("src","${ book_url }p"+prefix+n+".png");
$.cookie("book_page", n, {'expires':3650, 'path':'/'});
};
@@ -113,7 +113,7 @@ $("#open_close_accordion a").click(function(){
</ul>
</nav>
<img id="bookpage" src="${ settings.BOOK_URL }p${ "%03i"%(page) }.png">
<img id="bookpage" src="${ book_url }p${ "%03i"%(page) }.png">
</section>
</section>
</div>