planification.tpl 2.9 KB

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