index.html.twig 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Article index{% endblock %}
  3. {% block body %}
  4. <h1>Article index</h1>
  5. <table class="table">
  6. <thead>
  7. <tr>
  8. <th>Id</th>
  9. <th>Title</th>
  10. <th>PublicationDate</th>
  11. <th>actions</th>
  12. </tr>
  13. </thead>
  14. <tbody>
  15. {% for article in articles %}
  16. {% if is_granted('edit', article) %}
  17. <tr>
  18. <td>{{ article.id }}</td>
  19. <td>{{ article.title }}</td>
  20. <td>{{ article.publicationDate ? article.publicationDate|date('Y-m-d H:i:s') : '' }}</td>
  21. <td>
  22. {% if is_granted('view', article) %}
  23. <a href="{{ path('app_article_show', {'id': article.id}) }}">show</a>
  24. {% endif %}
  25. {% if is_granted('edit', article) %}
  26. <a href="{{ path('app_article_edit', {'id': article.id}) }}">edit</a>
  27. {% endif %}
  28. </td>
  29. </tr>
  30. {% endif %}
  31. {% else %}
  32. <tr>
  33. <td colspan="4">no records found</td>
  34. </tr>
  35. {% endfor %}
  36. </tbody>
  37. </table>
  38. <a href="{{ path('app_article_new') }}">Create new</a>
  39. {% endblock %}