standard_layout.html.twig 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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. {% set _preview = block('preview') %}
  8. {% set _form = block('form') %}
  9. {% set _show = block('show') %}
  10. {% set _list_table = block('list_table') %}
  11. {% set _list_filters = block('list_filters') %}
  12. {% set _side_menu = block('side_menu') %}
  13. {% set _content = block('content') %}
  14. {% set _title = block('title') %}
  15. {% set _breadcrumb = block('breadcrumb') %}
  16. <!DOCTYPE html>
  17. <html class="no-js">
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  20. {% block stylesheets %}
  21. <!-- jQuery code -->
  22. <link rel="stylesheet" href="{{ asset('bundles/sonatajquery/themes/flick/jquery-ui-1.8.16.custom.css') }}" type="text/css" media="all" />
  23. <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/bootstrap/bootstrap.min.css') }}" type="text/css" media="all" >
  24. <!-- base application asset -->
  25. <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/layout.css') }}" type="text/css" media="all">
  26. <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/colors.css') }}" type="text/css" media="all">
  27. {% endblock %}
  28. {% block javascripts %}
  29. <script src="{{ asset('bundles/sonatajquery/jquery-1.7.1.js') }}" type="text/javascript"></script>
  30. <script src="{{ asset('bundles/sonatajquery/jquery-ui-1.8.17.js') }}" type="text/javascript"></script>
  31. <script src="{{ asset('bundles/sonatajquery/jquery-ui-i18n.js') }}" type="text/javascript"></script>
  32. <script src="{{ asset('bundles/sonataadmin/bootstrap/js/bootstrap-tabs.js') }}" type="text/javascript"></script>
  33. <script src="{{ asset('bundles/sonataadmin/bootstrap/js/bootstrap-alerts.js') }}" type="text/javascript"></script>
  34. <script src="{{ asset('bundles/sonataadmin/bootstrap/js/bootstrap-modal.js') }}" type="text/javascript"></script>
  35. <script src="{{ asset('bundles/sonataadmin/bootstrap/js/bootstrap-twipsy.js') }}" type="text/javascript"></script>
  36. <script src="{{ asset('bundles/sonataadmin/bootstrap/js/bootstrap-popover.js') }}" type="text/javascript"></script>
  37. <script src="{{ asset('bundles/sonataadmin/bootstrap/js/bootstrap-scrollspy.js') }}" type="text/javascript"></script>
  38. <script src="{{ asset('bundles/sonataadmin/bootstrap/js/bootstrap-dropdown.js') }}" type="text/javascript"></script>
  39. <script src="{{ asset('bundles/sonataadmin/qtip/jquery.qtip-1.0.0-rc3.min.js') }}" type="text/javascript"></script>
  40. <script src="{{ asset('bundles/sonataadmin/jquery/jquery.form.js') }}" type="text/javascript"></script>
  41. <script src="{{ asset('bundles/sonataadmin/base.js') }}" type="text/javascript"></script>
  42. {% endblock %}
  43. <title>
  44. {% trans from 'SonataAdminBundle' %}Admin{% endtrans %}
  45. {% if _title is not empty %}
  46. {{ _title|raw }}
  47. {% else %}
  48. {% if action is defined %}
  49. -
  50. {% for label, uri in admin.breadcrumbs(action) %}
  51. {% if not loop.first %}
  52. &gt;
  53. {% endif %}
  54. {{ label }}
  55. {% endfor %}
  56. {% endif %}
  57. {% endif%}
  58. </title>
  59. </head>
  60. <body class="sonata-bc {% if _side_menu is empty %}sonata-ba-no-side-menu{% endif %}">
  61. {# initialize block value #}
  62. <div class="topbar" data-dropdown="dropdown" >
  63. <div class="topbar">
  64. <div class="topbar-inner">
  65. <div class="container-fluid">
  66. {% if admin_pool is defined %}
  67. {% block logo %}
  68. <a href="{{ url('sonata_admin_dashboard') }}" class="brand">
  69. <img src="{{ asset(admin_pool.titlelogo) }}" alt="{{ admin_pool.title }}" />
  70. {{ admin_pool.title }}
  71. </a>
  72. {% endblock %}
  73. <ul class="nav">
  74. {% block sonata_top_bar_nav %}
  75. {% for group in admin_pool.dashboardgroups %}
  76. <li class="dropdown">
  77. <a href="#" class="dropdown-toggle">{{ group.label|trans({}, group.label_catalogue) }}</a>
  78. <ul class="dropdown-menu">
  79. {% for admin in group.items %}
  80. {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
  81. <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
  82. {% endif %}
  83. {% endfor %}
  84. </ul>
  85. </li>
  86. {% endfor %}
  87. {% endblock %}
  88. </ul>
  89. <p class="pull-right">{% include admin_pool.getTemplate('user_block') %}</p>
  90. {% endif %}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="container-fluid">
  96. {% if _breadcrumb is not empty or action is defined %}
  97. <ul class="breadcrumb">
  98. {% if _breadcrumb is empty %}
  99. {% if action is defined %}
  100. {% for label, uri in admin.breadcrumbs(action) %}
  101. {% if not loop.last %}
  102. <li><a href="{{ uri }}">{{ label }}</a><span class="divider">/</span></li>
  103. {% else %}
  104. <li class="active">{{ label }}</li>
  105. {% endif %}
  106. {% endfor %}
  107. {% endif %}
  108. {% else %}
  109. {{ _breadcrumb|raw }}
  110. {% endif %}
  111. </ul>
  112. {% endif %}
  113. {% block notice %}
  114. {% for notice_level in ['success','error','info', 'warning'] %}
  115. {% set session_var = 'sonata_flash_' ~ notice_level %}
  116. {% if app.session.hasFlash(session_var) %}
  117. <div class="alert-message {{ notice_level }}">
  118. {{ app.session.flash(session_var) | trans([],'SonataAdminBundle') }}
  119. {#<a class="close" href="#">×</a>#}
  120. </div>
  121. {% endif %}
  122. {% endfor %}
  123. {% endblock %}
  124. <div style="float: right">
  125. {%block actions %}{% endblock %}
  126. </div>
  127. {% if _title is not empty or action is defined %}
  128. <div class="page-header">
  129. <h1>
  130. {% if _title is not empty %}
  131. {{ _title|raw }}
  132. {% elseif action is defined %}
  133. {% for label, uri in admin.breadcrumbs(action) %}
  134. {% if loop.last %}
  135. {{ label }}
  136. {% endif %}
  137. {% endfor %}
  138. {% endif%}
  139. </h1>
  140. </div>
  141. {% endif%}
  142. {% if _side_menu is not empty %}
  143. <div class="sidebar">
  144. <div class="well sonata-ba-side-menu">{{ _side_menu|raw }}</div>
  145. </div>
  146. {% endif %}
  147. <div class="content">
  148. {% if _preview is not empty %}
  149. <div class="sonata-ba-preview">{{ _preview|raw }}</div>
  150. {% endif %}
  151. {% if _content is not empty %}
  152. <div class="sonata-ba-content">{{ _content|raw }}</div>
  153. {% endif %}
  154. {% if _show is not empty %}
  155. <div class="sonata-ba-show">{{ _show|raw }}</div>
  156. {% endif %}
  157. {% if _form is not empty %}
  158. <div class="sonata-ba-form">{{ _form|raw }}</div>
  159. {% endif %}
  160. {% if _list_table is not empty or _list_filters is not empty %}
  161. <div class="sonata-ba-filter">
  162. {{ _list_filters|raw }}
  163. </div>
  164. <div class="sonata-ba-list">
  165. {{ _list_table|raw }}
  166. </div>
  167. {% endif %}
  168. {% block footer %}
  169. <div class="pull-right clearfix">
  170. <span class="label"><a href="http://sonata-project.org" rel="noreferrer" style="text-decoration: none; color: black">Sonata Project</a></span>
  171. </div>
  172. {% endblock %}
  173. </div>
  174. </div>
  175. </body>
  176. </html>