<!--

    Copyright © 2016-2017 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<section layout='row' class="tb-entity-filter">
    <section layout="row" flex="70">
        <section flex layout="column" layout-align="center start">
            <div ng-if="model.type">{{ types.aliasFilterType[model.type].name | translate }}</div>
            <md-button ng-if="!model.type"
                       ng-disabled="loading" class="md-primary"
                       ng-click="createFilter($event)"
                       aria-label="{{ 'alias.create-entity-filter' | translate }}">
                <md-icon aria-label="{{ 'alias.create-entity-filter' | translate }}"
                         class="material-icons">
                    add
                </md-icon>
                {{ 'alias.create-entity-filter' | translate }}
            </md-button>
        </section>
        <md-button ng-if="model.type" ng-disabled="loading" class="md-icon-button md-primary"
                   style="min-width: 40px;"
                   ng-click="editFilter($event)"
                   aria-label="{{ 'alias.edit-entity-filter' | translate }}">
            <md-tooltip md-direction="top">
                {{ 'alias.edit-entity-filter' | translate }}
            </md-tooltip>
            <md-icon aria-label="{{ 'alias.edit-entity-filter' | translate }}"
                     class="material-icons">
                edit
            </md-icon>
        </md-button>
    </section>
    <section class="tb-filter-switch" layout="column" flex="30" layout-align="center center">
        <label ng-if="!hideLabels" class="tb-small filter-label" translate>alias.resolve-multiple</label>
        <md-switch class="filter-switch" ng-model="model.resolveMultiple" aria-label="resolve-multiple-switcher">
        </md-switch>
    </section>
</section>
