ui/twig/special/topbar.html.twig line 1

Open in your IDE?
  1. <script type="text/javascript">
  2.     ;(function(window, document, $, undefined) {
  3.         window.head.load('{{ assett('bootstrap::/dist/js/bootstrap.min.js') }}');
  4.         window.head.load('{{ assett('chosen::/chosen.jquery.min.js') }}');
  5.         window.head.load('/ui/css/theme-topbar.css');
  6.         window.head.load('{{ assett('chosen::/chosen.min.css') }}');
  7.     })(window, document, jQuery);
  8. </script>
  9. <div id="cs-theme-header">
  10.     <div class="cs-topbar-nav-wrap">
  11.         <div class="cs-theme-tb-brand">
  12.             {# SCHOOLNOW #}
  13.             {% if _globals.container and _globals.container.isSchoolNow() %}
  14.                 <a href="{{- url('app.schoolnow.dashboard.default.main') -}}" class="cs-brand">
  15.                     <em class="fa fa-home cs-brand-icon" aria-hidden="true" title="Return to dashboard"></em>
  16.                 </a>
  17.             {% else %}
  18.                 <a href="{{- url(
  19.                     'cms.container.dashboard.dashboard.index'
  20.                 )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}" class="cs-brand">
  21.                     <em class="fa fa-home cs-brand-icon" aria-hidden="true" title="Return to dashboard"></em>
  22.                 </a>
  23.             {% endif %}
  24.         </div>
  25.         <ul class="cs-topbar-nav pull-left">
  26.             {% if _globals.thing is not null %}
  27.                 {% if ui_is_locked(_globals.thing, _globals.mimic) %}
  28.                     <li class="locked">
  29.                         <a href="#" disabled>
  30.                             <em class="csi icon-lock"></em>
  31.                             {{ _globals.thing.lockedBy.displayName }}
  32.                         </a>
  33.                     </li>
  34.                 {% elseif ui_is_shared(_globals.thing) %}
  35.                     <li class="locked">
  36.                         <a href="#" disabled>
  37.                             <em class="csi icon-lock"></em>
  38.                             Shared
  39.                         </a>
  40.                     </li>
  41.                 {% elseif ui_is_synced(_globals.thing) %}
  42.                     <li class="locked">
  43.                         <a href="#" disabled>
  44.                             <em class="csi icon-lock"></em>
  45.                             Synced
  46.                         </a>
  47.                     </li>
  48.                 {% else %}
  49.                     {# SCHOOLNOW #}
  50.                     {% if _globals.module and _globals.module.isSchoolNow(_globals.container) %}
  51.                         <li>
  52.                             <a href="{{- path('app.app.dashboard.websites.content.%s.update'|format(_globals.thing.discr), {
  53.                                 object: _globals.thing.id,
  54.                                 jump: app.request.uri,
  55.                             }) -}}">
  56.                                 <em class="csi icon-pencil"></em>
  57.                                 Edit {{ 'cms.frontend.topbar.labels.modules.%s.singular'|format(_globals.module.key)|trans }}
  58.                             </a>
  59.                         </li>
  60.                     {% else %}
  61.                         <li>
  62.                             <a href="{{- url(
  63.                                 'campussuite.cms.module.dashboard.content.modify_conflicts',
  64.                                 {
  65.                                     container: _globals.thing.container.id,
  66.                                     module: _globals.module.key,
  67.                                     proxy: _globals.thing.id,
  68.                                     redirectTo: app.request.uri
  69.                                 }
  70.                             )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  71.                                 <em class="csi icon-pencil"></em>
  72.                                 Edit {{ 'cms.frontend.topbar.labels.modules.%s.singular'|format(_globals.module.key)|trans }}
  73.                             </a>
  74.                         </li>
  75.                     {% endif %}
  76.                 {% endif %}
  77.             {% endif %}
  78.             <li>
  79.                 <a class="dropdown-toggle" href="#" data-toggle="dropdown">
  80.                     <em class="csi icon-chevron-down"></em>
  81.                 </a>
  82.                 <ul class="dropdown-menu">
  83.                     {% if _globals.container is not null %}
  84.                         <li>
  85.                             <a href="{{- url(
  86.                             'cms.navigation.default.edit',
  87.                             {
  88.                                 containerId: _globals.container.id,
  89.                                 redirectTo: app.request.uri
  90.                             }
  91.                             )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  92.                                 {# <em class="icon icon-lined-list-main"></em> #}
  93.                                 Edit Navigation
  94.                             </a>
  95.                         </li>
  96.                     {% endif %}
  97.                     {% if _globals.module is not null %}
  98.                         {# SCHOOLNOW #}
  99.                         {% if _globals.module and _globals.module.isSchoolNow(_globals.container) %}
  100.                             {% for cls in _globals.thingClasses %}
  101.                                 <li>
  102.                                     <a href="{{- path('app.app.dashboard.websites.content.%s.list'|format(constant(cls ~ '::DISCR'))) -}}">
  103.                                         {# <em class="icon icon-{% if _globals.module.key is same as('page') %}lined-page-b{% else %}lined-module-b{% endif %}"></em> #}
  104.                                         View {{ 'cms.frontend.topbar.labels.modules.%s.plural'|format(_globals.module.key)|trans }}
  105.                                     </a>
  106.                                 </li>
  107.                             {% endfor %}
  108.                         {% else %}
  109.                             <li>
  110.                                 <a href="{{- url(
  111.                                     'campussuite.cms.module.dashboard.content.settings',
  112.                                     {
  113.                                         container: _globals.container.id,
  114.                                         module: _globals.module.key
  115.                                     }
  116.                                 )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  117.                                     {{ _globals.module.name }} Settings
  118.                                 </a>
  119.                             </li>
  120.                             <li>
  121.                                 <a href="{{- url(
  122.                                 'campussuite.cms.module.dashboard.content.proxy_list',
  123.                                 {
  124.                                     container: _globals.container.id,
  125.                                     module: _globals.module.key
  126.                                 }
  127.                                 )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  128.                                     {# <em class="icon icon-{% if _globals.module.key is same as('page') %}lined-page-b{% else %}lined-module-b{% endif %}"></em> #}
  129.                                     View {{ 'cms.frontend.topbar.labels.modules.%s.plural'|format(_globals.module.key)|trans }}
  130.                                 </a>
  131.                             </li>
  132.                         {% endif %}
  133.                     {% endif %}
  134.                     {% if _globals.container is not null %}
  135.                         <li>
  136.                             <a href="{{- url(
  137.                             'cms.container.dashboard.container.view',
  138.                             {
  139.                                 containerId: _globals.container.id
  140.                             }
  141.                             )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  142.                                 {# <em class="icon icon-lined-folder-front-b"></em> #}
  143.                                 Current Department
  144.                             </a>
  145.                         </li>
  146.                     {% endif %}
  147.                     {% if _globals.thing is not null and not ui_is_shared(_globals.thing) and not ui_is_synced(_globals.thing) %}
  148.                         {# SCHOOLNOW #}
  149.                         {% if _globals.module and _globals.module.isSchoolNow(_globals.container) %}
  150.                             {# no history currently in school now #}
  151.                         {% else %}
  152.                             <li>
  153.                                 <a href="{{- url(
  154.                                     'campussuite.cms.module.dashboard.content.history_list',
  155.                                     {
  156.                                         container: _globals.container.id,
  157.                                         module: _globals.module.key,
  158.                                         proxy: _globals.thing.id
  159.                                     }
  160.                                 )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  161.                                     {# <em class="icon icon-lined-history-b"></em> #}
  162.                                     {{ 'cms.frontend.topbar.labels.modules.%s.singular'|format(_globals.module.key)|trans }} History
  163.                                 </a>
  164.                             </li>
  165.                         {% endif %}
  166.                     {% endif %}
  167.                     {% if _globals.thing is not null and ui_is_shareable(_globals.thing) %}
  168.                         {# SCHOOLNOW #}
  169.                         {% if _globals.module and _globals.module.isSchoolNow(_globals.container) %}
  170.                             {# no sharing in schoolnow... #}
  171.                         {% else %}
  172.                             <li>
  173.                                 <a href="{{- url(
  174.                                     'campussuite.cms.module.dashboard.content.proxy_share',
  175.                                     {
  176.                                         container: _globals.container.id,
  177.                                         module: _globals.module.key,
  178.                                         proxy: _globals.thing.id,
  179.                                         redirectTo: app.request.uri
  180.                                     }
  181.                                 )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  182.                                     {# <em class="icon icon-lined-folder-front-share-b"></em> #}
  183.                                     Share {{ 'cms.frontend.topbar.labels.modules.%s.singular'|format(_globals.module.key)|trans }}
  184.                                 </a>
  185.                             </li>
  186.                         {% endif %}
  187.                     {% endif %}
  188.                 </ul>
  189.             </li>
  190.             {% if _globals.thing is not null and _globals.socialSupport is same as(true) %}
  191.                 <li>
  192.                     <a href="{{- url(
  193.                         'products.smm.dashboard.default.create',
  194.                         {
  195.                             link: app.request.uri,
  196.                             redirectTo: app.request.uri
  197.                         }
  198.                     )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  199.                         <em class="fa fa-share-alt" aria-hidden="true" title="Share {{ 'cms.frontend.topbar.labels.modules.%s.singular'|format(_globals.module.key)|trans }}"></em>
  200.                     </a>
  201.                 </li>
  202.                 {# SCHOOLNOW #}
  203.                 {% if _globals.module and _globals.module.key is same as('calendar') and _globals.module.isSchoolNow(_globals.tenant) %}
  204.                     <li>
  205.                         <a href="{{- url(
  206.                             'app.schoolnow.dashboard.default.create',
  207.                             {
  208.                                 event: _globals.thing.id,
  209.                                 jump: app.request.uri,
  210.                             }
  211.                         ) -}}">
  212.                             <em class="fa fa-bullhorn" aria-hidden="true" title="Promote {{ 'cms.frontend.topbar.labels.modules.%s.singular'|format(_globals.module.key)|trans }}"></em>
  213.                         </a>
  214.                     </li>
  215.                 {% endif %}
  216.             {% endif %}
  217.         </ul>
  218.         <div class="pull-right">
  219.             {% if app.environment is same as('dev') or app.request.secure %}
  220.                 <ul class="cs-topbar-nav pull-left">
  221.                     <li class="cs-topbar__li-create">
  222.                         <a href="#" data-toggle="modal" data-target="#modal-create" data-backdrop="static" data-keyboard="true">
  223.                             + Add
  224.                         </a>
  225.                         {% include '@ui/create/modals/full.html.twig' with {
  226.                             htmlId: 'modal-create',
  227.                             ajax: url('cms.container.dashboard.dashboard.create_modal', {
  228.                                 department: _globals.container.id
  229.                             })|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard),
  230.                         } %}
  231.                     </li>
  232.                     <li class="cs-topbar__li-recent">
  233.                         <a href="#" data-toggle="modal" data-target="#modal-recent" data-backdrop="static" data-keyboard="true">
  234.                             Recent
  235.                         </a>
  236.                         {% include '@ui/create/modals/full.html.twig' with {
  237.                             htmlId: 'modal-recent',
  238.                             ajax: url('cms.container.dashboard.dashboard.recents_modal', {})|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard),
  239.                         } %}
  240.                     </li>
  241.                     <li class="cs-topbar__li-help">
  242.                             <a href="#" data-toggle="modal" data-target="#modal-help" data-backdrop="static" data-keyboard="true">
  243.                             Help
  244.                         </a>
  245.                         {% include '@ui/create/modals/full.html.twig' with {
  246.                             htmlId: 'modal-help',
  247.                             ajax: url('cms.container.dashboard.dashboard.help_modal', {})|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard)
  248.                         } %}
  249.                     </li>
  250.                 </ul>
  251.             {% endif %}
  252.             <div class="cs-user-controls pull-right">
  253.                 <a class="cs-user-details dropdown-toggle" href="#" data-toggle="dropdown">
  254.                     <div class="cs-user-pic">
  255.                         {% embed '@ui/common/images/avatar.html.twig' with {
  256.                             account: _globals.mimic
  257.                         } %}{% endembed %}
  258.                     </div>
  259.                     <em class="csi icon-chevron-down"></em>
  260.                 </a>
  261.                 <ul class="dropdown-menu">
  262.                     <li>
  263.                         <a href="{{- url(
  264.                             'platform.security.dashboard.profile.view'
  265.                         )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  266.                             {# <em class="icon icon-lined-avatar"></em> #}
  267.                             {{ 'usermenu.account'|trans }}
  268.                         </a>
  269.                     </li>
  270.                     <li>
  271.                         <a href="{{- url(
  272.                             'cms.container.dashboard.dashboard.index'
  273.                         )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  274.                             {# <em class="icon icon-lined-dashboard"></em> #}
  275.                             {{ 'usermenu.dashboard'|trans }}
  276.                         </a>
  277.                     </li>
  278.                     <li>
  279.                         <a href="https://help.schoolnow.com/hc/en-us/requests/new" target="_blank">
  280.                             {# <em class="icon icon-lined-help"></em> #}
  281.                             Support
  282.                         </a>
  283.                     </li>
  284.                     <li>
  285.                         <a href="#">
  286.                             {# <em class="icon icon-lined-help"></em> #}
  287.                             Knowledge Base
  288.                         </a>
  289.                     </li>
  290.                     <li>
  291.                         <a href="{{- url(
  292.                             'cms.container.dashboard.container.index_personal'
  293.                         )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  294.                             {# <em class="icon icon-lined-profile-card"></em> #}
  295.                             <span>{{ 'usermenu.personal.sites'|trans }}</span>
  296.                         </a>
  297.                     </li>
  298.                     <li>
  299.                         <a href="{{- url(
  300.                             'app.platform.security.logout'
  301.                         )|regex('/^https?:\\/\\/[^\\/]+/', _globals.pathDashboard) -}}">
  302.                             {# <em class="csi icon-sign-out"></em> #}
  303.                             {{ 'usermenu.logout'|trans }}
  304.                         </a>
  305.                     </li>
  306.                 </ul>
  307.             </div>
  308.         </div>
  309.     </div>
  310. </div>