src/ApplicationBundle/Resources/views/framework/cp_module_layout.html.twig line 1

Open in your IDE?
  1. {#
  2.   framework/cp_module_layout.html.twig
  3.   ══════════════════════════════════════════════════════════════════════════════
  4.   Generic cp-shell MODULE layout (sidebar + topbar + content). One shell for every
  5.   module — a module extends this, sets its identity vars, and fills the blocks.
  6.   A module layout (e.g. @Purchase/layouts/purchase_layout.html.twig) does:
  7.       {% extends '@Application/framework/cp_module_layout.html.twig' %}
  8.       {% set module_brand   = 'Purchasing' %}
  9.       {% set module_context = 'Procure to Pay' %}
  10.       {% set module_icon    = 'shopping_cart' %}
  11.       {% set module_accent  = '#2e7d68' %}       (one hex re-accents the whole module)
  12.       {% set module_accent_hover = '#25624f' %}
  13.       {% set module_accent_dim   = 'rgba(46,125,104,.10)' %}
  14.       (block) sidebar_nav …module nav links… (endblock)
  15.   …and each PAGE extends the module layout and fills the body block.
  16.   Blocks: eyebrow · page_heading · topbar_actions · sidebar_nav · sidebar_footer · body · page_scripts
  17.   NOTE: codecovers_header loads the JS bundles, so proposal.js / approval / selectize
  18.   all keep working inside this shell. This layout is PRESENTATION only.
  19.   ══════════════════════════════════════════════════════════════════════════════
  20. #}
  21. {% include '@Application/codecovers_header.html.twig' %}
  22. {% include '@Application/framework/_cp_tokens.html.twig' %}
  23. {% include '@Application/framework/_cp_shell_css.html.twig' %}
  24. <div class="cp-app cp-scope">
  25. {% include '@Application/framework/_cp_topstrip.html.twig' %}
  26. <div class="cp-shell cp-scope"
  27.      style="--cp-accent:{{ module_accent|default('#1f5673') }};--cp-accent-hover:{{ module_accent_hover|default('#16465f') }};--cp-accent-dim:{{ module_accent_dim|default('rgba(31,86,115,.10)') }};">
  28.   {# ── Global module rail ── #}
  29.   {% include '@Application/framework/_cp_global_rail.html.twig' %}
  30.   {# ── Module sub-nav ── #}
  31.   <aside class="cp-sidebar">
  32.     <div class="cp-sidebar-brand">
  33.       <div class="cp-brand-icon"><i class="material-icons">{{ module_icon|default('widgets') }}</i></div>
  34.       <div class="cp-brand-name">{{ module_brand|default('Module') }}</div>
  35.       {% if module_context is defined and module_context %}<div class="cp-brand-context">{{ module_context }}</div>{% endif %}
  36.     </div>
  37.     <nav class="cp-sidebar-nav">{% block sidebar_nav %}{% endblock %}</nav>
  38.     <div class="cp-sidebar-footer">
  39.       {% block sidebar_footer %}
  40.         <a href="{{ path('dashboard') }}" class="cp-nav-link" style="font-size:12px;">
  41.           <span class="cp-nav-icon"><i class="material-icons" style="font-size:14px">arrow_back</i></span> <span>Back to ERP</span>
  42.         </a>
  43.       {% endblock %}
  44.     </div>
  45.   </aside>
  46.   {# ── Main column ── #}
  47.   <div class="cp-main">
  48.     <header class="cp-topbar">
  49.       <div>
  50.         <div class="cp-eyebrow">{% block eyebrow %}{{ module_brand|default('') }}{% endblock %}</div>
  51.         <h1 class="cp-title">{% block page_heading %}{{ page_title|default('') }}{% endblock %}</h1>
  52.       </div>
  53.       <div class="cp-topbar-actions">{% block topbar_actions %}{% endblock %}</div>
  54.     </header>
  55.     <main class="cp-content">
  56.       {% include '@Application/inc/notification/error_notification.html.twig' %}
  57.       {% include '@Application/inc/notification/success_notification.html.twig' %}
  58.       {% block body %}{% endblock %}
  59.     </main>
  60.   </div>
  61. </div>{# /.cp-shell #}
  62. </div>{# /.cp-app #}
  63. {% include '@Application/footer/footer_js_codecovers.html.twig' %}
  64. {% include '@Application/codecovers_footer.html.twig' %}
  65. {% block page_scripts %}{% endblock %}