Commit a5ebe8c5 by Justin Riley

fix leanModal/collecstatic javascript issue

Turns out we can avoid the weird collectstatic issue (extra hash at end
of js filename) by not invoking leanModal from javascript at all.
Instead just use static namespace from 'static_content.html'
and put rel="leanModal" in the <a> DOM element that links to the modal
DOM tree via it's href attribute.
parent caeae2f2
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%namespace name='static' file='/static_content.html'/> <%namespace name='static' file='static_content.html'/>
% if is_staff: % if is_staff:
<% override_label = "On" if staff_release else "Off" %> <% override_label = "On" if staff_release else "Off" %>
<div aria-hidden="true" class="wrap-instructor-info"> <div aria-hidden="true" class="wrap-instructor-info">
<a class="instructor-info-action" href="#proctor_admin_${element_id}" id="proctor_admin">${_("Proctor Student Admin")}</a> <a class="instructor-info-action" href="#proctor_admin_${element_id}" id="proctor_admin" rel="leanModal">${_("Proctor Student Admin")}</a>
<a class="instructor-info-action" href="#proctor_release_${element_id}" id="proctor_override">${_("Proctor Override")}: <b>${_(override_label)}</b></a> <a class="instructor-info-action" href="#proctor_release_${element_id}" id="proctor_override">${_("Proctor Override")}: <b>${_(override_label)}</b></a>
</div> </div>
<hr/> <hr/>
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
</div> </div>
</section> </section>
<!--We should be using this but it's currently broken-->
<!--<script type="text/javascript" src="${static.url('js/vendor/jquery.leanModal.min.js')}"></script>-->
<script type="text/javascript" src="/static/js/vendor/jquery.leanModal.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
proctor_override = function(){ proctor_override = function(){
var data = {enabled: "${not staff_release}"}; var data = {enabled: "${not staff_release}"};
...@@ -38,7 +35,6 @@ proctor_override = function(){ ...@@ -38,7 +35,6 @@ proctor_override = function(){
}); });
} }
$('#proctor_override').click(proctor_override); $('#proctor_override').click(proctor_override);
$('#proctor_admin').leanModal();
$('#proctor_${element_id}_submit').click( function() { $('#proctor_${element_id}_submit').click( function() {
$.ajax({ $.ajax({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment