simplify and future proof pdf specific template variables
authorSeth Woodworth <seth@sethish.com>
Sat, 15 Jun 2013 00:41:11 +0000 (20:41 -0400)
committerSeth Woodworth <seth@sethish.com>
Sat, 15 Jun 2013 00:41:11 +0000 (20:41 -0400)
karmaworld/templates/notes/note_detail.html
karmaworld/templates/partial/pdfembed.html

index 352122b5e9e63642088ca7e816b848b72ba116a0..8c396e69d231a4027a3c41077234d475644cc8fa 100644 (file)
@@ -35,7 +35,7 @@
 
     </div><!-- /course_header -->
     <div id="note_container">
-      {% if  note.file_type == 'pdf' %}
+      {% if  pdf %}
         <!-- Add pdf.js -->
         <div class="row">
           <div class="twelve columns">
                 id="noteframe"
                 src="/pdfview/{{ note.id }}"
                 onload="autoResize('noteframe')"> </iframe>
-                <!--src="/pdfview?file={{ "http://"|urlencode }}{{ hostname|urlencode }}{{ note.note_file.url|urlencode }}"  -->
           </div>
         </div> <!-- .row -->
+
         {% comment %}
+        # TODO: embed and pass the url with this included when we fix the css integration issues
         {% include 'partial/pdfembed.html' %}
         {% endcomment %}
 
-      {% else %} {# note.filetype == 'pdf' #}
+      {% else %} {# if pdf #}
 
       <div class="row">
         <div class="eight columns centered body_copy">
index 2f5d65e2219d851f405e6a9cc20a87cb1a2076d9..475f448b692ddf7122122e19fd9df7139e41a909 100644 (file)
@@ -10,8 +10,7 @@
 {% endcomment %}
 
 <script>
-  //var DEFAULT_URL = '{{ note.note_file.url }}';
-  var DEFAULT_URL = '{{ object.note_file.url }}';
+  var DEFAULT_URL = '{{ pdf_path }}'
 </script>
 <script type="text/javascript" src="{{ STATIC_URL }}vendor/js/pdf.js"></script>
 <script src="{{ STATIC_URL }}vendor/js/viewer.js"></script>