progress.html.twig 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {% autoescape false %}
  2. {% if data is not empty %}
  3. {% set tutor = is_granted('ROLE_TEACHER') %}
  4. <div id="course-progress" class="thematic">
  5. <div class="row">
  6. <div class="col-md-12">
  7. <div class="bar-progress">
  8. <div class="float-right">
  9. <div class="score-progress">
  10. <h3>{{ 'Progress' | get_lang }}: <span id="div_result">{{ score_progress }}</span> %</h3>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="table-responsive">
  15. <table width="100%" class="table">
  16. <thead>
  17. <tr>
  18. <th scope="col" style="width: 35%">{{ 'Thematic' | get_lang }}</th>
  19. <th scope="col" style="width: 40%">{{ 'ThematicPlan' | get_lang }}</th>
  20. <th scope="col" style="width: 25%">{{ 'ThematicAdvance' | get_lang }}</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. {% for item in data %}
  25. <tr>
  26. <td id="id-thematic-{{ item.id }}">
  27. {% if session_star is empty %}
  28. <h5>{{ item.title }}</h5>
  29. {% else %}
  30. <h5>{{ item.title }} {{ session_star }}</h5>
  31. {% endif %}
  32. {{ item.content }}
  33. <div class="btn-group btn-group-sm">
  34. {{ item.toolbar }}
  35. </div>
  36. </td>
  37. <td>
  38. {% if tutor %}
  39. <div class="float-right">
  40. <a title="{{ 'EditThematicPlan' | get_lang }}" href="index.php?{{ _p.web_cid_query }}&origin=thematic_details&action=thematic_plan_list&thematic_id={{ item.id }}&width=700&height=500'" class="btn btn-outline-secondary btn-sm">
  41. <i class="fas fa-pencil-alt"></i>
  42. </a>
  43. </div>
  44. {% endif %}
  45. <div class="thematic_plan_{{ item.id }}">
  46. {% if item.thematic_plan is empty %}
  47. <div class="alert-thematic">
  48. <div class="alert alert-info" role="alert">{{ 'StillDoNotHaveAThematicPlan' | get_lang }}</div>
  49. </div>
  50. {% else %}
  51. {% for subitem in item.thematic_plan %}
  52. <h5>{{ subitem.title }}</h5>
  53. {{ subitem.description }}
  54. {% endfor %}
  55. {% endif %}
  56. </div>
  57. </td>
  58. <td>
  59. {% if tutor %}
  60. <div class="float-right">
  61. <a title="{{ 'NewThematicAdvance' | get_lang }}" href="index.php?{{ _p.web_cid_query }}&action=thematic_advance_add&thematic_id={{ item.id }}" class="btn btn-outline-secondary btn-sm">
  62. <i class="fa fa-plus-circle" aria-hidden="true"></i>
  63. </a>
  64. </div>
  65. {% endif %}
  66. <div class="thematic-advance">
  67. <table width="100%" class="table">
  68. {% if item.thematic_advance is not empty %}
  69. {% for advance in item.thematic_advance %}
  70. <tr>
  71. <td style="width: 90%" class="thematic_advance_content" id="thematic_advance_content_id_{{ advance.id }}">
  72. <div id="thematic_advance_{{ advance.id }}">
  73. <strong>{{ advance.start_date | format_date }}</strong>
  74. {{ advance.content }}
  75. </div>
  76. {% if tutor %}
  77. <div class="toolbar-actions">
  78. <div id="thematic_advance_tools_{{ advance.id }}" class="thematic_advance_actions">
  79. <div class="btn-group btn-group-sm">
  80. <a class="btn btn-default btn-sm" href="index.php?{{ _p.web_cid_query }}&action=thematic_advance_edit&thematic_id={{ item.id }}&thematic_advance_id={{ advance.id }}" title="{{ 'Edit' |get_lang }}">
  81. <i class="fa fa-pencil" aria-hidden="true"></i>
  82. </a>
  83. <a class="btn btn-default btn-sm" onclick="javascript:if(!confirm('{{ 'AreYouSureToDelete' | get_lang }}')) return false;" href="index.php?{{ _p.web_cid_query }}&action=thematic_advance_delete&thematic_id={{ item.id }}&thematic_advance_id={{ advance.id }}" title="{{ 'Delete' |get_lang }}">
  84. <i class="fa fa-trash" aria-hidden="true"></i>
  85. </a>
  86. </div>
  87. </div>
  88. </div>
  89. {% endif %}
  90. </div>
  91. </td>
  92. {% if advance.done_advance == 1 %}
  93. {% set color = "background-color:#E5EDF9;" %}
  94. {% else %}
  95. {% set color = "background-color:#FFFFFF;" %}
  96. {% endif %}
  97. {% if tutor %}
  98. <td style="width: 10%; {{ color }}" id="td_done_thematic_{{ advance.id }}">
  99. {% set check = "" %}
  100. {% if item.last_done == advance.id %}
  101. {% set check = "checked" %}
  102. {% endif %}
  103. <input type="radio" class="done_thematic" id="done_thematic_{{ advance.id }}" name="done_thematic" value="{{ advance.id }}" {{ check }} onclick="update_done_thematic_advance(this.value)">
  104. {% else %}
  105. </td>
  106. {% endif %}
  107. </tr>
  108. {% endfor %}
  109. {% else %}
  110. <div class="alert alert-info" role="alert">{{ 'ThereIsNoAThematicAdvance' | get_lang }}</div>
  111. {% endif %}
  112. </table>
  113. </div>
  114. </td>
  115. </tr>
  116. {% endfor %}
  117. </tbody>
  118. </table>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. {% else %}
  124. <div class="alert alert-info" role="alert">{{ 'There is no thematic section' | get_lang }}</div>
  125. {% if is_allowed_to_edit %}
  126. <div id="no-data-view" class="tool-view">
  127. <h2>{{ "Educational programming"|trans }}</h2>
  128. <img src="{{ "course_progress.png"|icon(64) }}" width="64" height="64">
  129. <div class="controls">
  130. <a href="{{ _p.web_self }}?{{ _p.web_cid_query ~ "&action=thematic_add" ~ token }}" class="btn btn-outline-primary">
  131. {{ "Add thematic"|trans }}
  132. </a>
  133. </div>
  134. </div>
  135. {% endif %}
  136. {% endif %}
  137. {% endautoescape %}