dashboard.html.twig 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% extends base_template %}
  8. {% block title %}{{ 'title_dashboard'|trans({}, 'SonataAdminBundle') }}{% endblock%}
  9. {% block breadcrumb %}{% endblock %}
  10. {% block content %}
  11. {{ sonata_block_render_event('sonata.admin.dashboard.top', { 'admin_pool': admin_pool }) }}
  12. {% if blocks.top|length > 0 %}
  13. {% set class = 'col-md-' ~ 12 // blocks.top|length %}
  14. <div class="row">
  15. {% for block in blocks.top %}
  16. <div class="{{ class }}">
  17. {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
  18. </div>
  19. {% endfor %}
  20. </div>
  21. {% endif %}
  22. <div class="row">
  23. {% set has_center = false %}
  24. <div class="{% if blocks.center|length > 0 %}col-md-3{% else %}col-md-6{% endif %}">
  25. {% for block in blocks.left %}
  26. {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
  27. {% endfor %}
  28. </div>
  29. {% if blocks.center|length > 0 %}
  30. <div class="col-md-4">
  31. {% for block in blocks.center %}
  32. {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
  33. {% endfor %}
  34. </div>
  35. {% endif %}
  36. <div class="{% if blocks.center|length > 0 %}col-md-4{% else %}col-md-6{% endif %}">
  37. {% for block in blocks.right %}
  38. {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
  39. {% endfor %}
  40. </div>
  41. </div>
  42. {% if blocks.bottom|length > 0 %}
  43. {% set class = 'col-md-' ~ 12 // blocks.bottom|length %}
  44. <div class="row">
  45. {% for block in blocks.bottom %}
  46. <div class="{{ class }}">
  47. {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
  48. </div>
  49. {% endfor %}
  50. </div>
  51. {% endif %}
  52. {{ sonata_block_render_event('sonata.admin.dashboard.bottom', { 'admin_pool': admin_pool }) }}
  53. {% endblock %}