Merge branch 'master' into redesign
authorCharles Connell <charles@connells.org>
Mon, 24 Mar 2014 19:42:28 +0000 (15:42 -0400)
committerCharles Connell <charles@connells.org>
Mon, 24 Mar 2014 19:43:41 +0000 (15:43 -0400)
Conflicts:
karmaworld/templates/courses/course_list.html
karmaworld/templates/courses/course_list_entry.html

1  2 
karmaworld/templates/courses/course_list.html

index ce0463e3fcdc77eb4d372eed1ab9456f076bef34,8ae1ab97eaf786bd87d28e2e27abccbccddc9cd1..78f0be360ae00cb038ee13218eebcd0584696cab
  {% 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 %}