<div class="bleveModal">

<div class="modal-header">
    <h3 class="modal-title">Custom Token Filter</h3>
</div>

<div class="modal-body">
    <div ng-show="errorMessage"
         class="alert alert-danger ng-cloak"
         role="alert"> {{errorMessage}}
    </div>

    <form class="form" role="form">
        <div class="form-group">
            <label for="tname">Name</label>
            <input ng-disabled="viewOnlyModal"
                   ng-model="name" type="text" class="form-control"
                   id="tname" placeholder="Name">
        </div>

        <div class="form-group">
            <label for="tokenfiltertype">Type</label>
            <div class="col-sm-12 input-group">
            <select ng-disabled="viewOnlyModal"
                    ng-change="tokenFilterTypeChange()"
                    ng-model="tokenfilter.type"
                    class="form-control"
                    id="tokenfiltertype">
                <option ng-repeat="tokenFilterTyp in tokenFilterTypes">{{tokenFilterTyp}}</option>
            </select>
            </div>
        </div>

        <div ng-show="tokenfilter.type" ng-include src="formpath"/>
    </form>
</div>

<div class="modal-footer">
    <button ng-if="viewOnlyModal" class="btn btn-default"
            ng-click="cancel()">Close</button>
    <button ng-if="!viewOnlyModal" class="btn btn-default"
            ng-click="cancel()">Cancel</button>
    <button ng-if="!viewOnlyModal"
            ng-click="build(name)"
            type="button" class="btn btn-primary pull-right">Save</button>
</div>

</div>
