report.tpl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. <th>{{ 'Actions'|get_lang }}</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. {% for user in user_list %}
  19. <tr id="row-{{ user.id }}">
  20. <td>{{ user.first_name }}</td>
  21. <td>{{ user.last_name }}</td>
  22. {% if show_email %}
  23. <td>{{ user.email }}</td>
  24. {% endif %}
  25. <td class="text-center">{{ user.lp_time }}</td>
  26. <td class="text-right">{{ user.lp_progress }}</td>
  27. <td class="text-right">{{ user.lp_score }}</td>
  28. <td class="text-center">{{ user.lp_last_connection }}</td>
  29. <td>
  30. <button class="btn btn-primary btn-sm" data-id="{{ user.id }}">{{ 'Details'|get_lang }}</button>
  31. </td>
  32. </tr>
  33. <tr class="hide"></tr>
  34. {% endfor %}
  35. </tbody>
  36. </table>
  37. </div>
  38. <script>
  39. $(document).on('ready', function () {
  40. $('tr td button').on('click', function (e) {
  41. e.preventDefault();
  42. var self = $(this);
  43. var userId = self.data('id') || 0;
  44. var trHead = self.parents('tr');
  45. var trDetail = trHead.next();
  46. if (self.is('.active')) {
  47. self.removeClass('active');
  48. trDetail.html('').addClass('hide');
  49. } else {
  50. self.addClass('active');
  51. var newTD = $('<td>', {
  52. colspan: 7
  53. });
  54. 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 () {
  55. newTD.appendTo(trDetail);
  56. });
  57. trDetail.removeClass('hide');
  58. }
  59. });
  60. });
  61. </script>