src/Cms/FileBundle/Resources/views/Modal/includes/modal.html.twig line 1

Open in your IDE?
  1. <div class="modal__header">
  2.     <a class="btn btn-default btn-icon close" data-dismiss="modal" aria-label="Close">
  3.         <span aria-hidden="true">×</span>
  4.     </a>
  5.     <div class="modal__row">
  6.         {% if containers is defined %}
  7.             <div class="modal__header-left">
  8.                 <select class="select-chosen" data-placeholder="Select Department">
  9.                     <option{% if container is not defined or container is empty %} selected{% endif %} value=""></option>
  10.                     {% set grouping = null %}
  11.                     {% set groupingLabel = null %}
  12.                     {% for current in containers %}
  13.                         {% if grouping is not same as(constant('DISCR', current)) %}
  14.                             {% if grouping is not empty %}</optgroup>{% endif %}
  15.                             {% set grouping = constant('DISCR', current) %}
  16.                             {%  if grouping is same as('generic') %}
  17.                                 {% set groupingLabel = 'Websites' %}
  18.                             {% elseif grouping is same as('intranet') %}
  19.                                 {% set groupingLabel = 'Intranets' %}
  20.                             {% elseif grouping is same as ('personal') %}
  21.                                 {% set groupingLabel = 'Teacher Websites' %}
  22.                             {% elseif grouping is same as ('storage') %}
  23.                                 {% set groupingLabel = 'File Storage' %}
  24.                             {% else %}
  25.                                 {% set groupingLabel = 'Departments' %}
  26.                             {% endif %}
  27.                             <optgroup label="{{ groupingLabel }}">
  28.                         {% endif %}
  29.                         <option{% if container is defined and container is not empty and current is same as(container) %} selected{% endif %} value="{{
  30.                             curpath(
  31.                                 routes.container,
  32.                                 {
  33.                                     containerId: current.id
  34.                                 }
  35.                             )
  36.                         }}">{{ ui_container_indent(current) }}</option>
  37.                     {% endfor %}
  38.                     </optgroup>
  39.                 </select>
  40.                 {% inline_script %}
  41.                     <script>
  42.                         $('[data-campussuite-modals-content] .modal__header .modal__header-left > .select-chosen')
  43.                             // chosen spacing fix
  44.                             .on('change chosen:ready', function(e, params) {
  45.                                 (( ! params || ! params.chosen) ? $(e.currentTarget).data('chosen') : params.chosen)
  46.                                     .container
  47.                                     .find('> .chosen-single > span, > .chosen-choices > .search-choice > span')
  48.                                     .each(function (index, elem) {
  49.                                         var $elem = $(elem);
  50.                                         $elem.text($elem.text().trim());
  51.                                     });
  52.                             })
  53.                             .chosen({
  54.                                 width: '100%',
  55.                                 disable_search: true,
  56.                                 search_contains: true
  57.                             })
  58.                             .on('change', function(e, data) {
  59.                                 $(this).trigger('campussuite.modals.navigate', data.selected);
  60.                             })
  61.                         ;
  62.                     </script>
  63.                 {% endinline %}
  64.             </div>
  65.         {% endif %}
  66.         <div class="modal__header-right">
  67.             {% block header_right %}{% endblock %}
  68.         </div>
  69.     </div>
  70.     {% block subheader %}{% endblock %}
  71. </div>
  72. {% block controls %}
  73.     <div class="modal__controls">
  74.         <div class="modal__row">
  75.             <div class="modal__breadcrumbs">
  76.                 {% block crumbs %}{% endblock %}
  77.             </div>
  78.             <div class="modal__actions">
  79.                 {% block actions %}{% endblock %}
  80.             </div>
  81.         </div>
  82.     </div>
  83. {% endblock %}
  84. <div class="modal__body">
  85.     {% block body %}{% endblock %}
  86.     <script type="text/javascript">
  87.         $(function (e) {
  88.             $('[data-toggle="dropdown"]').dropdown();
  89.         });
  90.     </script>
  91. </div>