report.tpl 2.3 KB

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