src/Products/NotificationsBundle/Resources/views/base.html.twig line 1

Open in your IDE?
  1. {% extends '@ui2022/schoolnow/page--wide.html.twig' %}
  2. {# TODO: REMOVE - style for basic hc header #}
  3. {% do dom_html_attr_set_class('hc-header') %}
  4. {% do dom_styles([
  5.     'https://honeycomb.style/css/honeycomb.css',
  6.     '/hc/css/custom.css',
  7. ]) %}
  8. {% do include('@ProductsNotifications/_assets.html.twig') %}
  9. {% do include('@ProductsNotifications/_assets_tracking.html.twig') %}
  10. {% block topbar %}
  11.     {% include 'topbar.html.twig' with {
  12.         avatar: (app.user.systemProfile.hasAvatar)
  13.         ? s3_entity(app.user, '/avatar/thumb')
  14.         : null,
  15.         displayName: app.user.displayName
  16.     } %}
  17. {% endblock %}
  18. {% block navbar %}
  19.     {% include '@ui2022/schoolnow/side__menu.html.twig' with {
  20.         avatar: (app.user.systemProfile.hasAvatar)
  21.             ? s3_entity(app.user, '/avatar/thumb')
  22.             : '/ui2022/images/avatar.png',
  23.         name: app.user.displayName,
  24.         items: [
  25.             {
  26.                 title: 'Dashboard',
  27.                 icon: 'icon-dash-board',
  28.                 link: path('app.notifications.dashboard.default.main'),
  29.                 active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.default.'),
  30.             },
  31.             maybe_granted(['app.notifications.messaging.general', 'app.notifications.messaging.urgent']) ? {
  32.                 title: 'Messages',
  33.                 icon: 'icon-message-plane',
  34.                 link: path('app.notifications.dashboard.messages.main'),
  35.                 active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.messages.'),
  36.             } : null,
  37.             {
  38.                 title: 'Contacts',
  39.                 icon: 'icon-userlist',
  40.                 link: path('app.notifications.dashboard.profiles.main'),
  41.                 active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.profiles.'),
  42.                 permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  43.                 items: [
  44.                     {
  45.                         title: 'Parents',
  46.                         link: path('app.notifications.dashboard.profiles.main', {
  47.                             'query[filter]': 'family',
  48.                         }),
  49.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.profiles.') and app.request.query.get('query')['filter']|default(null) is same as('family'),
  50.                         permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  51.                     },
  52.                     {
  53.                         title: 'Staff',
  54.                         link: path('app.notifications.dashboard.profiles.main', {
  55.                             'query[filter]': 'staff',
  56.                         }),
  57.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.profiles.') and app.request.query.get('query')['filter']|default(null) is same as('staff'),
  58.                         permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  59.                     },
  60.                     {
  61.                         title: 'Community',
  62.                         link: path('app.notifications.dashboard.profiles.main', {
  63.                         'query[filter]': 'community',
  64.                         permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  65.                     }),
  66.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.profiles.') and app.request.query.get('query')['filter']|default(null) is same as('community'),
  67.                         permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  68.                     },
  69.                     {
  70.                         title: 'Students',
  71.                         link: path('app.notifications.dashboard.students.main'),
  72.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.students.'),
  73.                         permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  74.                     },
  75.                 ],
  76.             },
  77.             maybe_granted('app.notifications.lists.admin') ? {
  78.                 title: 'Lists',
  79.                 icon: 'icon-templates',
  80.                 link: path('app.notifications.dashboard.lists.main'),
  81.                 active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.lists.'),
  82.             } : null,
  83.             {
  84.                 title: 'Reports',
  85.                 icon: 'icon-contacts',
  86.                 link: path('app.notifications.dashboard.reports.main'),
  87.                 active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.reports.'),
  88.                 permission: '@app.notifications.access',
  89.                 items: [
  90.                     {
  91.                         title: 'SIS Records',
  92.                         link: path('app.notifications.dashboard.sis.main'),
  93.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.sis.'),
  94.                         permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  95.                     },
  96.                     {
  97.                         title: 'Logs',
  98.                         link: path('app.notifications.dashboard.logs.main'),
  99.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.logs.'),
  100.                         permission: attributes_expression(['app.notifications.contacts.admin', 'app.notifications.contacts.view']),
  101.                     },
  102.                 ],
  103.             },
  104.             {
  105.                 title: 'Templates',
  106.                 icon: 'icon-reports',
  107.                 link: path('app.notifications.dashboard.templates.main'),
  108.                 active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.templates.'),
  109.                 permission: attributes_expression(['app.notifications.templates.admin', 'app.notifications.automations.admin']),
  110.             },
  111.             {
  112.                 title: 'Settings',
  113.                 icon: 'icon-settings',
  114.                 link: '#',
  115.                 active: (
  116.                     (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.settings.')
  117.                     or
  118.                     (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.onboarding.')
  119.                 ),
  120.                 permission: 'app.notifications.onboarding.admin',
  121.                 items: [
  122.                     is_granted('campussuite.root') ? {
  123.                         title: 'Onboarding',
  124.                         link: path('app.notifications.dashboard.onboarding.default.main'),
  125.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.onboarding.default.'),
  126.                         permission: 'app.notifications.onboarding.admin',
  127.                     } : null,
  128.                     (false) ? {
  129.                         title: 'Phone Number',
  130.                         link: path('app.notifications.dashboard.onboarding.phones.main'),
  131.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.onboarding.phones.'),
  132.                         permission: 'app.notifications.onboarding.admin',
  133.                     } : null,
  134.                     {
  135.                         title: 'Voice Caller IDs',
  136.                         link: path('app.notifications.dashboard.onboarding.caller_ids.main'),
  137.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.onboarding.caller_ids.'),
  138.                         permission: 'app.notifications.onboarding.admin',
  139.                     },
  140.                     {
  141.                         title: 'Email Domains',
  142.                         link: path('app.notifications.dashboard.onboarding.domains.main'),
  143.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.onboarding.domains.'),
  144.                         permission: 'app.notifications.onboarding.admin',
  145.                     },
  146.                     {
  147.                         title: 'Email Suppressions',
  148.                         link: path('app.notifications.dashboard.onboarding.email_suppression.main'),
  149.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.onboarding.email_suppression.'),
  150.                         permission: 'app.notifications.onboarding.admin',
  151.                     },
  152.                     is_granted('campussuite.root') ? {
  153.                         title: 'Notifications Config',
  154.                         link: path('app.notifications.dashboard.onboarding.notifications_config.main'),
  155.                         active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.onboarding.notifications_config.'),
  156.                         permission: 'app.notifications.onboarding.admin',
  157.                     } : null,
  158.                     is_granted('campussuite.root') ? {
  159.                         title: 'DEBUG',
  160.                         link: path('app.notifications.dashboard.onboarding.default.debugging'),
  161.                         active: (app.request.attributes.get('_route') is same as('app.notifications.dashboard.onboarding.default.debugging')),
  162.                         permission: 'app.notifications.onboarding.admin',
  163.                     } : null,
  164.                 ],
  165.             },
  166.             {
  167.                 title: 'Auto Notices',
  168.                 icon: 'icon-gear',
  169.                 link: '#',
  170.                 active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.automations.'),
  171.                 permission: attributes_expression(['app.notifications.automations.admin', 'app.notifications.messaging.general', 'app.notifications.messaging.urgent']),
  172.                 items: [
  173.                 {
  174.                     title: 'General',
  175.                     link: path('app.notifications.dashboard.automations.invocation_list', {type: 'general'}),
  176.                     active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.automations.invocation_list') and app.request.attributes.get('type') is same as('general'),
  177.                     permission: attributes_expression(['app.notifications.automations.admin', 'app.notifications.messaging.general', 'app.notifications.messaging.urgent']),
  178.                 },
  179.                 {
  180.                     title: 'Attendance',
  181.                     link: path('app.notifications.dashboard.automations.invocation_list', {type: 'attendance'}),
  182.                     active: (app.request.attributes.get('_route') starts with 'app.notifications.dashboard.automations.invocation_list') and app.request.attributes.get('type') is same as('attendance'),
  183.                     permission: attributes_expression(['app.notifications.automations.admin', 'app.notifications.messaging.general', 'app.notifications.messaging.urgent']),
  184.                 },
  185.             ],
  186.             },
  187.             is_granted('campussuite.root') ? {
  188.                 title: 'Portal',
  189.                 icon: 'fas fa-rocket',
  190.                 link: path('app.notifications.portal.login.login'),
  191.                 target: '_blank',
  192.             } : null,
  193.         ],
  194.     } %}
  195. {% endblock %}
  196. {% block modals %}
  197.     {{ parent() }}
  198.     {% embed '@ui2022/schoolnow/modal--sidepanel.html.twig' with {
  199.         attr: {
  200.             id: 'topbar-help',
  201.             class: 'sidepanel--help',
  202.         },
  203.     } %}
  204.         {% block header %}
  205.             <div class="sidepanel__head-left">
  206.                 <h2 class="text-an-demibold">Help Center</h2>
  207.             </div>
  208.             <div class="sidepanel__head--right">
  209.                 <img class="schoolnow-logo" src="/ui2022/images/logo_app_stack_white.svg" width="101" height="15.25" alt="" />
  210.             </div>
  211.         {% endblock %}
  212.     {% endembed %}
  213.     {% embed '@ui2022/schoolnow/modal--sidepanel.html.twig' with {
  214.         attr: {
  215.             id: 'sidepanel-setting',
  216.             class: 'setting-sidepanel',
  217.         },
  218.     } %}
  219.         {% block header %}
  220.             {% include '@ui2022/schoolnow/topbar__menu_user_header.html.twig' with { account: app.user } %}
  221.         {% endblock %}
  222.         {% block content %}
  223.             {% include '@App/dashboard/settings/navbar.html.twig'  with { topMenu: true } %}
  224.         {% endblock %}
  225.     {% endembed %}
  226.     <script type="text/javascript">
  227.         (function (window, document, $, undefined) {
  228.             $(function () {
  229.                 $('#topbar-help').on('show.cs.sidepanel', function (e) {
  230.                     $('#topbar-help .sidepanel__content')
  231.                         .html('<iframe width="100%" src="https://www-schoolnow-com.sandbox.hs-sites.com/schoolnew-home-page-2022?email={{- app.user.email -}}&slug={{- cms.tenant.slug -}}"></iframe>')
  232.                     ;
  233.                 });
  234.             });
  235.         })(window, document, jQuery);
  236.     </script>
  237. {% endblock %}