assign_members.tpl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {% extends app.template_style ~ "/layout/layout_1_col.tpl" %}
  2. {% block content %}
  3. <script>
  4. $(document).ready(function() {
  5. $('.inputAction').on('click', function() {
  6. $isChecked = $(this).is(":checked");
  7. var idParts = $(this).attr('id').split('_');
  8. var userId = idParts[1];
  9. var juryMemberId = idParts[2];
  10. if ($isChecked) {
  11. url = '{{ _p.public_web }}admin/jury_president/assign-user/'+ userId +'/'+juryMemberId;
  12. } else {
  13. url = '{{ _p.public_web }}admin/jury_president/remove-user/'+ userId +'/'+juryMemberId;
  14. }
  15. $.ajax(url);
  16. });
  17. });
  18. </script>
  19. {% if has_students == false %}
  20. <a class="btn" href="{{ url('jury_president.controller:autoAssignUsersAction', {'juryId' : jury.id }) }}">Asignar al azar</a>
  21. <hr>
  22. {% endif %}
  23. <form>
  24. <table class="table table-bordered">
  25. <tbody>
  26. <tr>
  27. <td>Revisar</td>
  28. {% for member in members %}
  29. {% if _u.user_id == member.user.userId %}
  30. <td class="hover">
  31. {% else %}
  32. <td>
  33. {% endif %}
  34. {# member.user.userId #}
  35. {% if member.role.role == 'ROLE_JURY_PRESIDENT' %}
  36. P{{ loop.index }}
  37. {% elseif member.role.role == 'ROLE_JURY_MEMBER' %}
  38. M{{ loop.index -1}}
  39. {% else %}
  40. S{{ loop.index -1}}
  41. {% endif %}
  42. </td>
  43. {% endfor %}
  44. <td>Mi estado</td>
  45. <td>Estado global (Min {{ considered_evaluated }} evaluados)</td>
  46. </tr>
  47. {% for attempt in attempts %}
  48. <tr>
  49. <td>
  50. Estudiante #{{ attempt.user.getUserId }} ({{ attempt.exeId }})
  51. </td>
  52. {% for member in members %}
  53. {% if _u.user_id == member.user.userId %}
  54. {% set memberHover = 'hover' %}
  55. {% else %}
  56. {% set memberHover = '' %}
  57. {% endif %}
  58. {% if relations[attempt.exeId][attempt.user.getUserId][member.user.userId] %}
  59. {% set checkedSuccess = 'class="success"' %}
  60. {% set disabled = 'disabled' %}
  61. {% else %}
  62. {% set checkedSuccess = '' %}
  63. {% set disabled = '' %}
  64. {% endif %}
  65. <td class="{{ memberHover }}">
  66. {% set studentList = students_by_member[member.userId] %}
  67. {% if attempt.user.getUserId in studentList %}
  68. {% set checked = 'checked="checked"' %}
  69. {% else %}
  70. {% set checked = '' %}
  71. {% endif %}
  72. <div {{ checkedSuccess }}>
  73. <input {{ disabled }} class="inputAction" {{ checked }} id="check_{{ attempt.user.getUserId }}_{{ member.id }}" type="checkbox">
  74. </div>
  75. </td>
  76. {% endfor %}
  77. <td>
  78. {% if my_student_status[attempt.exeId][attempt.user.getUserId] %}
  79. <a href="#" class="btn btn-success disabled">Evaluado</a>
  80. {% else %}
  81. {% if attempt.user.getUserId in students_by_member[_u.user_id] %}
  82. <a href="{{ url('jury_member.controller:scoreAttemptAction', { 'exeId': attempt.getExeId, 'juryId' : jury.id }) }}" class="btn btn-warning">
  83. Evaluar
  84. </a>
  85. {% else %}
  86. <a href="#" class="btn disabled">No asignado</a>
  87. {% endif %}
  88. {% endif %}
  89. </td>
  90. <td>
  91. {% if global_student_status[attempt.user.getUserId] %}
  92. <a href="#" class="btn btn-success disabled">Completo</a>
  93. {% else %}
  94. <a href="#" class="btn btn-danger disabled">Incompleto</a>
  95. {% endif %}
  96. </td>
  97. </tr>
  98. {% endfor %}
  99. </tbody>
  100. </table>
  101. </form>
  102. <hr>
  103. <a class="btn" href="">Cierre de proceso</a>
  104. {% endblock %}