<div class="modal__header">
<a class="btn btn-default btn-icon close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</a>
<div class="modal__row">
{% if containers is defined %}
<div class="modal__header-left">
<select class="select-chosen" data-placeholder="Select Department">
<option{% if container is not defined or container is empty %} selected{% endif %} value=""></option>
{% set grouping = null %}
{% set groupingLabel = null %}
{% for current in containers %}
{% if grouping is not same as(constant('DISCR', current)) %}
{% if grouping is not empty %}</optgroup>{% endif %}
{% set grouping = constant('DISCR', current) %}
{% if grouping is same as('generic') %}
{% set groupingLabel = 'Websites' %}
{% elseif grouping is same as('intranet') %}
{% set groupingLabel = 'Intranets' %}
{% elseif grouping is same as ('personal') %}
{% set groupingLabel = 'Teacher Websites' %}
{% elseif grouping is same as ('storage') %}
{% set groupingLabel = 'File Storage' %}
{% else %}
{% set groupingLabel = 'Departments' %}
{% endif %}
<optgroup label="{{ groupingLabel }}">
{% endif %}
<option{% if container is defined and container is not empty and current is same as(container) %} selected{% endif %} value="{{
curpath(
routes.container,
{
containerId: current.id
}
)
}}">{{ ui_container_indent(current) }}</option>
{% endfor %}
</optgroup>
</select>
{% inline_script %}
<script>
$('[data-campussuite-modals-content] .modal__header .modal__header-left > .select-chosen')
// chosen spacing fix
.on('change chosen:ready', function(e, params) {
(( ! params || ! params.chosen) ? $(e.currentTarget).data('chosen') : params.chosen)
.container
.find('> .chosen-single > span, > .chosen-choices > .search-choice > span')
.each(function (index, elem) {
var $elem = $(elem);
$elem.text($elem.text().trim());
});
})
.chosen({
width: '100%',
disable_search: true,
search_contains: true
})
.on('change', function(e, data) {
$(this).trigger('campussuite.modals.navigate', data.selected);
})
;
</script>
{% endinline %}
</div>
{% endif %}
<div class="modal__header-right">
{% block header_right %}{% endblock %}
</div>
</div>
{% block subheader %}{% endblock %}
</div>
{% block controls %}
<div class="modal__controls">
<div class="modal__row">
<div class="modal__breadcrumbs">
{% block crumbs %}{% endblock %}
</div>
<div class="modal__actions">
{% block actions %}{% endblock %}
</div>
</div>
</div>
{% endblock %}
<div class="modal__body">
{% block body %}{% endblock %}
<script type="text/javascript">
$(function (e) {
$('[data-toggle="dropdown"]').dropdown();
});
</script>
</div>