teacher_time_report.tpl 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {% extends template ~ "/layout/main.tpl" %}
  2. {% block body %}
  3. <script>
  4. $(document).on('ready', function () {
  5. $('#course').on('change', function () {
  6. $('#session').prop('selectedIndex', 0);
  7. $('#teacher').prop('selectedIndex', 0);
  8. });
  9. $('#session').on('change', function () {
  10. $('#course').prop('selectedIndex', 0);
  11. $('#teacher').prop('selectedIndex', 0);
  12. });
  13. $('#teacher').on('change', function () {
  14. $('#course').prop('selectedIndex', 0);
  15. $('#session').prop('selectedIndex', 0);
  16. });
  17. $('#daterange').on('apply.daterangepicker', function (ev, picker) {
  18. $('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
  19. $('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
  20. }).on('cancel.daterangepicker', function (ev, picker) {
  21. $('#daterange, [name="from"], [name="until"]').val('');
  22. });
  23. });
  24. </script>
  25. <div class="col-md-12">
  26. <div class="actions">
  27. <span class="pull-right">
  28. <a href="{{ _p.web_self }}?export=pdf&from={{ selectedFrom }}&until={{ selectedUntil }}&course={{ selectedCourse }}&session={{ selectedSession }}&teacher={{ selectedTeacher }}">
  29. <img src="{{ _p.web_img }}icons/32/pdf.png" title="{{ 'ExportToPDF' | get_lang }}">
  30. </a>
  31. <a href="{{ _p.web_self }}?export=xls&from={{ selectedFrom }}&until={{ selectedUntil }}&course={{ selectedCourse }}&session={{ selectedSession }}&teacher={{ selectedTeacher }}">
  32. <img src="{{ _p.web_img }}icons/32/export_excel.png" title="{{ 'ExportExcel' | get_lang }}">
  33. </a>
  34. </span>
  35. </div>
  36. <h1 class="page-header">{{ 'TeacherTimeReport' | get_lang }}</h1>
  37. {{ form }}
  38. <h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2>
  39. <table class="table">
  40. <thead>
  41. <tr>
  42. {% if withFilter %}
  43. <th>{{ 'Session' | get_lang }}</th>
  44. <th>{{ 'Course' | get_lang }}</th>
  45. {% endif %}
  46. <th>{{ 'Coach' | get_lang }}</th>
  47. <th>{{ 'TotalTime' | get_lang }}</th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. {% for row in rows %}
  52. <tr>
  53. {% if withFilter %}
  54. <td>{{ row.session ? row.session.name : '&nbsp' }}</td>
  55. <td>{{ row.course.name }}</td>
  56. {% endif %}
  57. <td>{{ row.coach.completeName }} ({{ row.coach.username}})</td>
  58. <td>{{ row.totalTime }}</td>
  59. </tr>
  60. {% endfor %}
  61. </tbody>
  62. </table>
  63. </div>
  64. {% endblock %}