Commits

Artur Barseghyan committed ad27b8d Draft

fix the template js errors

  • Participants
  • Parent commits 8c14f27
  • Tags 0.3

Comments (0)

Files changed (1)

src/sirep/templates/sirep/view.html

 {% endblock %}
 
 {% block extrahead %}
-    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
+    <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
     <script src="{% static 'admin/js/core.js' %}"></script>
-    <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
-    <script>function gettext(txt){ return txt}</script>
+    <script src="{% static 'admin/js/jquery.js' %}"></script>
+    <script src="{% static 'admin/js/jquery.init.js' %}"></script>
     <script>
-        $(document).ready(function() {
-            $('#generate-csv-report, #generate-csv-report-current-page').click(function() {
-                $('.report-loading').height($(window).height());
-                $('.report-loading').show();
+        django.jQuery(document).ready(function() {
+            django.jQuery('#generate-csv-report, #generate-csv-report-current-page').click(function() {
+                django.jQuery('.report-loading').height(django.jQuery(window).height());
+                django.jQuery('.report-loading').show();
             });
 
-            $('.report-loading').click(function() {
-                $('.report-loading').hide();
+            django.jQuery('.report-loading').click(function() {
+                django.jQuery('.report-loading').hide();
             });
 
-            $('#apply-filtering-to-current-page').click(function() {
-                window.location = "{{ request.path }}?" + $('.report-form').serialize();
+            django.jQuery('#apply-filtering-to-current-page').click(function() {
+                window.location = "{{ request.path }}?" + django.jQuery('.report-form').serialize();
                 return;
             });
         });
 
   <div id="content-main">
     {% block object-tools %}{% endblock %}
-        
-    <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">      
+
+    <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
       {% block result_list %}
       <div id="changelist" class="filtered">
-			<table style="width: 102% !important;">	
+			<table style="width: 102% !important;">
 				<thead>
                     <tr>
                         {% for head in report.get_headers %}
                             <th style="width:auto; color: #000; font-weight: bold;">{#<a href="javascript:;">#}{{ head }}{#</a>#}</th>
                         {% endfor %}
                     </tr>
-				</thead>			
+				</thead>
 			{% for row in report.items %}
 				<tr class="row{% if forloop.counter0|divisibleby:'2' %}1{%else%}2{% endif %}">
                     {%for val in row %}
                         <td colspan="{{ report.header_count }}" style="text-align: left;"><strong>{{val}}</strong></td>
                     {% endfor %}
-				</tr>                			
-			{% endfor %}			
+				</tr>
+			{% endfor %}
 			</table>
 
             <ul class="reporting-pagination">
             {% if report.has_next and report.next %}<li><a href="{{ request.path }}?{{ GET_PARAM_PAGE }}={{ report.next }}&amp;{{ request.GET.urlencode|strip_page_param }}" rel="next">{% trans "Next page" %}</a></li>{% endif %}
             </ul>
       </div>
-      {% endblock %}     
+      {% endblock %}
     </div>
   </div>
 {% endblock %}