{% set avatar = _args.avatar %}
{% set displayName = _args.displayName %}
{% do dom_scripts_top([
'https://honeycomb.style/js/honeycomb.js',
]) %}
{% set mainItems = [
(cms.tenant.products.checkAnyFlag('SCHOOLNOW__BASE')) ? {
title: 'Home',
link: path('app.schoolnow.dashboard.default.main'),
active: (app.request.attributes.get('_route') starts with 'app.schoolnow.'),
} : null,
maybe_granted('@app.notifications.access') ? {
title: 'Messages',
link: path('app.notifications.dashboard.default.main'),
active: (app.request.attributes.get('_route') starts with 'app.notifications.'),
} : null,
{
title: 'Website',
link: path('app.app.dashboard.websites.default.main'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.websites.'),
},
]|filter((item) => item is not empty and (not item.permission is defined or is_granted(item.permission))) %}
{% set settingsItems = [
{
header: 'Account set-up',
permission: 'app.schools.admin',
items: [
{
title: 'Schools',
link: path('app.app.dashboard.settings.schools.list'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.settings.schools.'),
icon: 'school',
},
{
title: 'Branding',
link: path('app.app.dashboard.settings.branding.list'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.settings.branding.'),
icon: 'building',
},
{
title: 'Mobile App',
link: path('app.app.dashboard.settings.mobile.list'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.settings.mobile.'),
icon: 'phone',
},
{
title: 'Accessibility',
link: path('products.ada.dashboard.default.main'),
active: (app.request.attributes.get('_route') starts with 'products.ada.'),
icon: "accessibility",
},
],
},
{
header: 'Users and groups',
permission: 'app.security.admin',
items: [
{
title: 'User accounts',
link: path('app.app.dashboard.settings.accounts.main'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.settings.accounts.'),
icon: 'users',
},
{
title: 'Groups',
link: path('app.app.dashboard.settings.groups.main'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.settings.groups.'),
icon: 'user-group',
},
{
title: 'Roles',
link: path('app.app.dashboard.settings.roles.main'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.settings.roles.'),
icon: 'eye',
},
],
},
{
header: 'Messages',
permission: 'app.notifications.automations.admin',
items: [
{
title: 'Auto Notices',
link: path('app.app.dashboard.settings.automations.main'),
active: (app.request.attributes.get('_route') starts with 'app.app.dashboard.settings.automations.'),
icon: 'bolt',
},
],
},
{
header: 'Social media',
permission: 'app.social.admin',
items: [
{
title: 'Connections',
link: path('cms.tenant.dashboard.social.main'),
active: (app.request.attributes.get('_route') starts with 'cms.tenant.dashboard.social'),
icon: 'share-alt',
},
],
},
{
header: null,
items: [
is_granted('campussuite.cms.me.sites') ? {
title: 'Teacher Websites',
link: path('cms.container.dashboard.container.index_personal'),
icon: 'page',
} : null,
]
},
{
header: null,
items: [
cms.impersonatedAccount is empty ? {
title: 'Logout',
link: path('app.platform.security.logout'),
color: 'danger',
icon: 'log-out',
} : {
title: 'Stop Impersonation',
link: path('app.schoolnow.dashboard.default.main', { _switch_user: '_exit' }),
color: 'danger',
icon: 'log-out',
},
],
},
]|filter((item) => item is not empty and (not item.permission is defined or is_granted(item.permission))) %}
{% embed 'hc/header.html.twig' with {
logoLink: (cms.tenant.products.checkAnyFlag('SCHOOLNOW__BASE'))
? path('app.schoolnow.dashboard.default.main')
: null,
} %}
{% block mainMenu %}
{% include 'hc/header-menu-main.html.twig' with {
items: mainItems,
} %}
{% endblock %}
{% block settingsMenu %}
{% include 'hc/button.html.twig' with {
button: 'button',
text: 'Help',
sidepanel: 'topbar-help',
styles: 'primary brand',
attr: {
class: 'mr-3',
},
icon: {
glyph: 'support',
color: 'solid',
varinat: 'contrast',
}
} %}
{% embed 'hc/dropdown.html.twig' with {
separator: 'left',
items: settingsItems,
variant: 'account'
} %}
{% block toggle %}
{% embed 'hc/button-button.html.twig' with {
icon: true,
dropdown: {
caret: true,
},
} %}
{% block content %}
{% if avatar %}
{% include 'hc/avatar.html.twig' with {
image: avatar
} %}
{% else %}
{% include 'hc/icon.html.twig' with {
glyph: 'user',
variant: 'contrast',
} %}
{% endif %}
{% endblock %}
{% endembed %}
{% endblock %}
{% block content %}
{% embed 'hc/dropdown-menu.html.twig' with {
variant: variant,
items: items
} %}
{% block header %}
{% include 'hc/header-menu-session.html.twig' with {
variant: 'active',
avatar: avatar,
displayName: displayName,
profileLink: path('app.app.dashboard.settings.profiles.view'),
} %}
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% endblock %}
{% block mobileMenu %}
{% include 'hc/button.html.twig' with {
button: 'button',
sidepanel: 'topbar-help',
styles: 'primary brand ',
attr: {
class: 'mr-3',
},
icon: {
glyph: 'support',
color: 'solid',
varinat: 'contrast',
}
} %}
{% embed 'hc/dropdown.html.twig' with {
items: [{header:null, items: mainItems}],
mobile: true,
caret: false,
icon: {
glyph: 'menu',
variant: 'contrast',
}
} %}
{% endembed %}
{% embed 'hc/dropdown.html.twig' with {
separator: 'left',
items: settingsItems,
variant: 'account',
} %}
{% block toggle %}
{% embed 'hc/button-button.html.twig' with {
icon: true,
dropdown: {
caret: true,
},
} %}
{% block content %}
{% if avatar %}
{% include 'hc/avatar.html.twig' with {
image: avatar
} %}
{% else %}
{% include 'hc/icon.html.twig' with {
glyph: 'user',
variant: 'contrast',
} %}
{% endif %}
{% endblock %}
{% endembed %}
{% endblock %}
{% block content %}
{% embed 'hc/dropdown-menu.html.twig' with {
variant: variant,
items: items,
mobile: true,
} %}
{% block header %}
{% include 'hc/header-menu-session.html.twig' with {
variant: 'active',
avatar: avatar,
displayName: displayName,
profileLink: path('app.app.dashboard.settings.profiles.view'),
} %}
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}