planification.html.twig 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {% extends "@ChamiloTheme/Layout/layout_one_col.html.twig" %}
  2. {% set user_id = student_id == _u.id ? 0 : student_id %}
  3. {% block content %}
  4. {% autoescape false %}
  5. {{ toolbar }}
  6. <nav aria-label="...">
  7. <ul class="pager">
  8. <li class="previous">
  9. <a href="{{ _p.web_self ~ '?' ~ {"year": search_year - 1, "user": user_id }|url_encode }}">
  10. <span aria-hidden="true">&larr;</span> {{ search_year - 1 }}
  11. </a>
  12. </li>
  13. <li class="current">
  14. {{ search_year }}
  15. </li>
  16. <li class="next">
  17. <a href="{{ _p.web_self ~ '?' ~ {"year": search_year + 1, "user": user_id }|url_encode }}">
  18. {{ search_year + 1 }} <span aria-hidden="true">&rarr;</span>
  19. </a>
  20. </li>
  21. </ul>
  22. </nav>
  23. {% if sessions|length > 0 %}
  24. <div class="table-responsive" id="calendar-session-planification">
  25. <table class="table table-bordered table-condensed">
  26. <thead>
  27. <tr>
  28. <th class="col-session">{{ 'Session'|get_lang }}</th>
  29. {% for i in 1..52 %}
  30. <th class="col-week text-center" title="{{ 'WeekX'|get_lang|format(i) }}"><span>{{ i }}</span></th>
  31. {% endfor %}
  32. </tr>
  33. </thead>
  34. <tbody>
  35. {% for session in sessions %}
  36. <tr>
  37. <td class="col-session" title="{{ session.name }}">
  38. <a href="{{ _p.web ~ 'session/' ~ session.id ~ '/about/' }}">
  39. {{ session.name }}
  40. </a>
  41. </td>
  42. {% if session.start > 0 %}
  43. <td class="col-week" colspan="{{ session.start }}">&nbsp;</td>
  44. {% endif %}
  45. <td class="col-week text-center {{ session.start_in_last_year or session.no_start ? 'in_last_year' : '' }} {{ session.end_in_next_year or session.no_end ? 'in_next_year' : '' }}"
  46. colspan="{{ session.duration }}" title="{{ session.human_date }}"
  47. style="background-color: {{ colors[loop.index0] }}">
  48. <span>
  49. <span class="sr-only">{{ session.human_date }}</span>
  50. </span>
  51. </td>
  52. {% if session.duration + session.start < 52 %}
  53. <td class="col-week" colspan="{{ 52 - session.duration - session.start }}">&nbsp;</td>
  54. {% endif %}
  55. </tr>
  56. {% endfor %}
  57. </tbody>
  58. </table>
  59. </div>
  60. {% else %}
  61. <div class="alert alert-warning">
  62. {{ 'ThereIsNotStillASession'|get_lang }}
  63. </div>
  64. {% endif %}
  65. {% endautoescape %}
  66. {% endblock %}