report.tpl 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <div class="table-responsive">
  2. <table class="table table-hover table-striped table-bordered">
  3. <thead>
  4. <tr>
  5. <th>{{ 'FirstName'|get_lang }}</th>
  6. <th>{{ 'LastName'|get_lang }}</th>
  7. {% if show_email %}
  8. <th>{{ 'Email'|get_lang }}</th>
  9. {% endif %}
  10. <th class="text-center">{{ 'ScormTime'|get_lang }}</th>
  11. <th class="text-right">{{ 'Progress'|get_lang }}</th>
  12. <th class="text-right">{{ 'ScormScore'|get_lang }}</th>
  13. <th class="text-center">{{ 'LastConnection'|get_lang }}</th>
  14. {% if not export %}
  15. <th>{{ 'Actions'|get_lang }}</th>
  16. {% endif %}
  17. </tr>
  18. </thead>
  19. <tbody>
  20. {% for user in user_list %}
  21. <tr id="row-{{ user.id }}">
  22. <td>{{ user.first_name }}</td>
  23. <td>{{ user.last_name }}</td>
  24. {% if show_email %}
  25. <td>{{ user.email }}</td>
  26. {% endif %}
  27. <td class="text-center">{{ user.lp_time }}</td>
  28. <td class="text-right">{{ user.lp_progress }}</td>
  29. <td class="text-right">{{ user.lp_score }}</td>
  30. <td class="text-center">{{ user.lp_last_connection }}</td>
  31. {% if not export %}
  32. <td>
  33. <button class="btn btn-primary btn-sm" data-id="{{ user.id }}">{{ 'Details'|get_lang }}</button>
  34. </td>
  35. {% endif %}
  36. </tr>
  37. <tr class="hide"></tr>
  38. {% endfor %}
  39. </tbody>
  40. </table>
  41. </div>
  42. <script>
  43. $(function() {
  44. $('tr td button').on('click', function (e) {
  45. e.preventDefault();
  46. var self = $(this);
  47. var userId = self.data('id') || 0;
  48. var trHead = self.parents('tr');
  49. var trDetail = trHead.next();
  50. if (self.is('.active')) {
  51. self.removeClass('active');
  52. trDetail.html('').addClass('hide');
  53. } else {
  54. self.addClass('active');
  55. var newTD = $('<td>', {
  56. colspan: 7
  57. });
  58. newTD.load('{{ _p.web_main ~ 'mySpace/lp_tracking.php?action=stats&extend_all=0&id_session=' ~ session_id ~ '&course=' ~ course_code ~ '&lp_id=' ~ lp_id ~ '&student_id=\' + userId + \'&origin=tracking_course&allow_extend=0' }} .table-responsive', function () {
  59. newTD.appendTo(trDetail);
  60. });
  61. trDetail.removeClass('hide');
  62. }
  63. });
  64. });
  65. </script>