{% endblock %}
{% block pagescripts %}
-<script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
-
-<script>
-$(document).ready(function() {
- // If there were form errors, open the form and jump to it
- var jump_to_form = {% if jump_to_form %}true{% else%}false{% endif %};
- if (jump_to_form) {
- $("#add-course-form").show();
- $('#add-course-btn').hide();
- document.getElementById('add-course-form').scrollIntoView(true);
- }
+ <script>
+ // If there were form errors, open the form and jump to it
+ var jump_to_form = {% if jump_to_form %}true{% else%}false{% endif %};
+ var json_school_list = "{% url 'json_school_list' %}"
+ var json_school_course_list = "{% url 'json_school_course_list' %}"
+ var json_school_course_instructor_list = "{% url 'json_school_course_instructor_list' %}"
+ var csrf_token = "{{ csrf_token }}";
+ </script>
+ <script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
+ <script src="{{ STATIC_URL }}js/course.js"></script>
+ <script src="{{ STATIC_URL }}js/add-course.js"></script>
+ <script src="{{ STATIC_URL }}js/course-list.js"></script>
+{% endblock %}
++<<<<<<< HEAD
+{% block bodyscripts %}
+ <script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
+ <script src="{{ STATIC_URL }}js/jquery.backstretch.min.js"></script>
+ <script>
+ $("#splash").backstretch("{{ STATIC_URL }}img/banner.jpg");
+ </script>
++=======
+ // load dataTable for course data
+ $('#data_table_list').dataTable({
+ // remove the default filter label
+ 'oLanguage': {
+ 'sSearch': '',
+ },
+ // we will set column widths explicitly
+ 'bAutoWidth': false,
+ // don't provide a option for the user to change the table page length
+ 'bLengthChange': false,
+ // sepcify the number of rows in a page
+ 'iDisplayLength': 20,
+ // Position the filter bar at the top
+ 'sDom': '<"top"f>rt<"bottom"p><"clear">',
+ // Specify options for each column
+ "aoColumnDefs": [
+ {
+ // 4th element: thanks
+ "aTargets": [ 6 ],
+ "bSortable": true,
+ "bVisible": true,
+ "aDataSort": [ 3 ]
+ },
+ {
+ // 3rd element: notes
+ "aTargets": [ 5 ],
+ "bSortable": true,
+ "bVisible": true,
+ "aDataSort": [ 2 ]
+ },
+ {
+ // 2nd element: date
+ "aTargets": [ 4 ],
+ "bSortable": true,
+ "bVisible": true,
+ "aDataSort": [ 1 ]
+ },
+ {
+ // 1st element: "sort by" label
+ "aTargets": [ 0 ],
+ "bSortable": false,
+ "bVisible": true
+ }
+ ],
+ // Initial sorting
+ 'aaSorting': [[6,'desc']]
+ });
+ $('.dataTables_filter input').attr("placeholder", "search courses");
+ // TODO: can't prepend html to .dataTables_filter input html for fontawesome search icon
+ });
+ </script>
++>>>>>>> master
{% endblock %}
{% block content %}