templates/child/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{% trans %}Child index{%endtrans%}{% endblock %}
  3. {% block body %}
  4. <h1>{% trans %}Child index{% endtrans %}</h1>
  5. <div class="table-scrollable">
  6. <table>
  7. <thead>
  8. <tr>
  9. <th>{% trans %}Id{% endtrans %}</th>
  10. <th>{% trans %}Child's name{% endtrans %}</th>
  11. <th>{% trans %}Birth date{% endtrans %}</th>
  12. <th>{% trans %}Birth place{% endtrans %}</th>
  13. <th>{% trans %}Sex{% endtrans %}</th>
  14. <th>{% trans %}Father's name{% endtrans %}</th>
  15. <th>{% trans %}Mother's name{% endtrans %}</th>
  16. <th>{% trans %}Other Contact{% endtrans %}</th>
  17. <th>{% trans %}actions{% endtrans %}</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  22. {% for child in children %}
  23. {% if is_granted('ROLE_CEC') or is_granted('ROLE_SCEC') or is_granted('ROLE_CEC_OFFICER') or is_granted('ROLE_CEC_SECRETARY') %}
  24. {% if (child.hospital.municipality is defined) %}
  25. {% if child.hospital.municipality == app.user.municipality %}
  26. <tr>
  27. <td>{{ child.id }}</td>
  28. <td>{{ child.nameOfTheChild }}</td>
  29. <td>{{ child.dateOfBirth ? child.dateOfBirth|date('Y-m-d H:i:s') : '' }}</td>
  30. <td>{{ child.placeOfBirth }}</td>
  31. <td>{{ child.sex }}</td>
  32. <td>{{ child.nameOfTheFather }}</td>
  33. <td>{{ child.nameOfTheMother }}</td>
  34. <td>{{ child.otherContact }}</td>
  35. <td>
  36. <a href="{{ path('child_show', {'id': child.id}) }}">{% trans %}show{% endtrans %}</a>
  37. <a href="{{ path('child_edit', {'id': child.id}) }}">{% trans %}edit{% endtrans %}</a>
  38. </td>
  39. </tr>
  40. {% endif %}
  41. {% endif %}
  42. {% endif %}
  43. {% if is_granted('ROLE_HOSPITAL') %}
  44. {% if child.hospital == app.user.hospital %}
  45. <tr>
  46. <td>{{ child.id }}</td>
  47. <td>{{ child.nameOfTheChild }}</td>
  48. <td>{{ child.dateOfBirth ? child.dateOfBirth|date('Y-m-d H:i:s') : '' }}</td>
  49. <td>{{ child.placeOfBirth }}</td>
  50. <td>{{ child.sex }}</td>
  51. <td>{{ child.nameOfTheFather }}</td>
  52. <td>{{ child.nameOfTheMother }}</td>
  53. <td>{{ child.otherContact }}</td>
  54. <td>
  55. <a href="{{ path('child_show', {'id': child.id}) }}" class="fa fa-eye">{% trans %}show{% endtrans %}</a>
  56. <!--a href="{{ path('child_edit', {'id': child.id}) }}">edit</a-->
  57. </td>
  58. </tr>
  59. {% endif %}
  60. {% endif %}
  61. {% if is_granted('ROLE_PAYS') or is_granted('ROLE_REGION') or is_granted('ROLE_MIN') %}
  62. <tr>
  63. <td>{{ child.id }}</td>
  64. <td>{{ child.nameOfTheChild }}</td>
  65. <td>{{ child.dateOfBirth ? child.dateOfBirth|date('Y-m-d H:i:s') : '' }}</td>
  66. <td>{{ child.placeOfBirth }}</td>
  67. <td>{{ child.sex }}</td>
  68. <td>{{ child.nameOfTheFather }}</td>
  69. <td>{{ child.nameOfTheMother }}</td>
  70. <td>{{ child.otherContact }}</td>
  71. <td>
  72. <a href="{{ path('child_show', {'id': child.id}) }}">{% trans %}show{% endtrans %}</a>
  73. <a href="{{ path('child_edit', {'id': child.id}) }}">{% trans %}edit{% endtrans %}</a>
  74. </td>
  75. </tr>
  76. {% endif %}
  77. {% else %}
  78. <tr>
  79. <td colspan="22">{% trans %} no records found{% endtrans %}</td>
  80. </tr>
  81. {% endfor %}
  82. {% endif %}
  83. </tbody>
  84. </table>
  85. </div>
  86. <a href="{{ path('child_new') }}">{% trans %} Create new {% endtrans %}</a>
  87. {% endblock %}