teacher_time_report.tpl 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <script>
  2. $(function () {
  3. $('#course').on('change', function () {
  4. $('#session').prop('selectedIndex', 0);
  5. $('#teacher').prop('selectedIndex', 0);
  6. });
  7. $('#session').on('change', function () {
  8. $('#course').prop('selectedIndex', 0);
  9. $('#teacher').prop('selectedIndex', 0);
  10. });
  11. $('#teacher').on('change', function () {
  12. $('#course').prop('selectedIndex', 0);
  13. $('#session').prop('selectedIndex', 0);
  14. });
  15. $('#daterange').on('apply.daterangepicker', function (ev, picker) {
  16. $('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
  17. $('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
  18. }).on('cancel.daterangepicker', function (ev, picker) {
  19. $('#daterange, [name="from"], [name="until"]').val('');
  20. });
  21. });
  22. </script>
  23. {{ form }}
  24. <h3 class="page-header">{{ report_title }} <small>{{ report_sub_title }}</small></h3>
  25. <table class="table">
  26. <thead>
  27. <tr>
  28. {% if with_filter %}
  29. <th>{{ 'Session' | get_lang }}</th>
  30. <th>{{ 'Course' | get_lang }}</th>
  31. {% endif %}
  32. <th>{{ 'Coach' | get_lang }}</th>
  33. <th class="text-center">{{ 'TotalTime' | get_lang }}</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. {% for row in rows %}
  38. <tr>
  39. {% if with_filter %}
  40. <td>{{ row.session ? row.session.name : '&nbsp' }}</td>
  41. <td>{{ row.course.name }}</td>
  42. {% endif %}
  43. <td>{{ row.coach.complete_name }} ({{ row.coach.username}})</td>
  44. <td class="text-center">{{ row.total_time }}</td>
  45. </tr>
  46. {% endfor %}
  47. </tbody>
  48. </table>