themes/bases/Campussuite2015/widgets/AlertBanner/build/tpl.html.twig line 1

Open in your IDE?
  1. {% if items|length > 0 %}
  2.     <div class="cs-alert-banner">
  3.         <div class="cs-alert-banner__wrap cs-alert-banner__wrap--{{- first_of({
  4.             'informative': (items[0].data.level is same as(constant('LEVELS__INFORMATIVE', items[0].data))),
  5.             'important': (items[0].data.level is same as(constant('LEVELS__IMPORTANT', items[0].data))),
  6.             'urgent': (items[0].data.level is same as(constant('LEVELS__URGENT', items[0].data)))
  7.         }, 'informative') }}">
  8.             <div class="cs-alert-banner__content owl-carousel">
  9.                 {% for item in items %}
  10.                     <div class="cs-alert-banner__item cs-alert-banner__item--{{- first_of({
  11.                         'informative': (item.data.level is same as(constant('LEVELS__INFORMATIVE', item.data))),
  12.                         'important': (item.data.level is same as(constant('LEVELS__IMPORTANT', item.data))),
  13.                         'urgent': (item.data.level is same as(constant('LEVELS__URGENT', item.data)))
  14.                     }, 'informative') }} cs-owl-carousel-li">
  15.                         <p class="cs-alert-banner__msg">
  16.                             <a href="{{ moduleItemUrl(item) }}"{% if moduleItemLinkNewWindow(item) %} target="_blank"{% endif %}>
  17.                                 <span>
  18.                                     {%- if item.data.level is not same as(constant('LEVELS__INFORMATIVE', item.data)) %}
  19.                                         <img
  20.                                             class="cs-alert-banner__item-image"
  21.                                             src="{{- first_of({
  22.                                                 (((_editor) ? _globals.pathDashboard : '')~'/ui/themes/alert-important-icon-white.svg'): (item.data.level is same as(constant('LEVELS__IMPORTANT', item.data))),
  23.                                                 (((_editor) ? _globals.pathDashboard : '')~'/ui/themes/alert-urgent-icon-white.svg'): (item.data.level is same as(constant('LEVELS__URGENT', item.data)))
  24.                                             }) -}}"
  25.                                             alt=""
  26.                                         />
  27.                                     {% endif -%}
  28.                                     {{ item.data.title }}
  29.                                     {% if not _editor and item in popups and app.request.cookies.has('campussuiteAccountUid') %}
  30.                                         <em data-popup="{{ _htmlId }}__modals__{{ item.id }}-{{ item.touchedAt|date('U') }}">(View pop-up)</em>
  31.                                     {% endif %}
  32.                                 </span>
  33.                             </a>
  34.                         </p>
  35.                     </div>
  36.                 {% endfor %}
  37.             </div>
  38.         </div>
  39.         {% if popups|length > 0 and not _editor %}
  40.             <div class="cs-alert-banner__modals">
  41.                 {% for popup in popups %}
  42.                     <div class="modal cs-alert-modal cs-alert-modal--{{- first_of({
  43.                         'informative': (popup.data.level is same as(constant('LEVELS__INFORMATIVE', popup.data))),
  44.                         'important': (popup.data.level is same as(constant('LEVELS__IMPORTANT', popup.data))),
  45.                         'urgent': (popup.data.level is same as(constant('LEVELS__URGENT', popup.data)))
  46.                     }, 'informative') }}" tabindex="-1" role="dialog" data-backdrop="static" data-remote="false" data-popup="{{ popup.id }}-{{ popup.touchedAt|date('U') }}" id="{{ _htmlId }}__modals__{{ popup.id }}-{{ popup.touchedAt|date('U') }}">
  47.                         <div class="modal-dialog" role="document">
  48.                             <div class="modal-content">
  49.                                 <div class="modal-body">
  50.                                     {%- if popup.data.level is not same as(constant('LEVELS__INFORMATIVE', popup.data)) %}
  51.                                         <img
  52.                                             class="cs-alert-modal__image"
  53.                                             src="{{- first_of({
  54.                                                 (((_editor) ? _globals.pathDashboard : '')~'/ui/themes/alert-important-icon-yellow.svg'): (popup.data.level is same as(constant('LEVELS__IMPORTANT', popup.data))),
  55.                                                 (((_editor) ? _globals.pathDashboard : '')~'/ui/themes/alert-urgent-icon-red.svg'): (popup.data.level is same as(constant('LEVELS__URGENT', popup.data)))
  56.                                             }) -}}"
  57.                                             alt=""
  58.                                         />
  59.                                     {% endif %}
  60.                                     <h1 class="modal-title">{{ popup.data.title }}</h1>
  61.                                     {% if _widget.popupTruncation is defined and _widget.popupTruncation <= 0 %}
  62.                                         {{ popup.data.content|raw }}
  63.                                     {% else %}
  64.                                         <p>
  65.                                             {% if popup.data.abstract is not empty %}
  66.                                                 {{ popup.data.abstract }}
  67.                                             {% else %}
  68.                                                 {{ cms_abstract(null, popup.data.content, _widget.popupTruncation|default(300)) }}
  69.                                             {% endif %}
  70.                                         </p>
  71.                                         <a class="cs-btn cs-btn-{{- first_of({
  72.                                             'informative': (popup.data.level is same as(constant('LEVELS__INFORMATIVE', popup.data))),
  73.                                             'important': (popup.data.level is same as(constant('LEVELS__IMPORTANT', popup.data))),
  74.                                             'urgent': (popup.data.level is same as(constant('LEVELS__URGENT', popup.data)))
  75.                                         }, 'informative') }}" data-dismiss="modal" href="{{ moduleItemUrl(popup) }}"{% if moduleItemLinkNewWindow(popup) %} target="_blank"{% endif %}>More information</a>
  76.                                     {% endif %}
  77.                                     <button type="button" class="text-link" data-dismiss="modal">Close message</button>
  78.                                 </div>
  79.                             </div>
  80.                         </div>
  81.                     </div>
  82.                 {% endfor %}
  83.             </div>
  84.         {% endif %}
  85.     </div>
  86. {% elseif items|length == 0 and _editing %}
  87.     <div class="cs-alert-banner">
  88.         <div class="cs-alert-banner__wrap">
  89.             <div class="cs-alert-banner__content owl-carousel">
  90.                 <div class="cs-alert-banner__item cs-alert-banner__item-bg--danger cs-owl-carousel-li">
  91.                     <p class="cs-alert-banner__msg">
  92.                         <a href="#">
  93.                             <span>This is the alert banner placeholder and will not be displayed in the public view.</span>
  94.                         </a>
  95.                     </p>
  96.                 </div>
  97.             </div>
  98.         </div>
  99.     </div>
  100. {% endif %}