<div class="modal-header">
    <button type="button" class="close closebtn" data-ng-click="cancel()" aria-hidden="true">&times;</button>
    <h1 class="modal-title">{{'Edit' | translate}}</h1>
</div>
<div class="modal-body">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <form role="form">
                    <div class="form-group">
                        <label class="control-label">{{'Title' | translate}}</label>
                        <input type="text" class="form-control" ng-model="settings['@friendlyName']">
                    </div>
                    <div class="form-group">
                        <label class="control-label">{{'Is important' | translate}}</label>
                        <div class="radio">
                            <label>
                                <input type="radio" data-ng-model="settings['@important']" data-ng-value="true">
                                {{'Yes' | translate}}
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" data-ng-model="settings['@important']" data-ng-value="false">
                                {{'No' | translate}}
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">{{'Property' | translate}}</label>
                        <input type="text" ng-model="settings['@property']" typeahead="p for p in propertyList | filter:$viewValue | limitTo:8" class="form-control">
                    </div>
                    <div class="form-group">
                        <label class="control-label">{{'Selector' | translate}}</label>
                        <input type="text" class="form-control" ng-model="settings['@selector']">
                    </div>
                    <div class="form-group">
                        <label class="control-label">{{'Type' | translate}}</label>
                        <select name="repeatSelect" class="form-control" ng-model="settings['@setting']" ng-change="resetValues()">
                            <option value="text">Text</option>
                            <option value="color">Color</option>
                            <option value="url">Url</option>
                            <option value="bool">Bool</option>
                            <option value="select">Select</option>
                        </select>
                    </div>

                    <div class="form-group" ng-show="settings['@setting'] == 'bool'">
                        <label class="control-label">{{'True value' | translate}}</label>
                        <input type="text" class="form-control" ng-model="settings['@truevalue']">
                    </div>
                    <div class="form-group" ng-show="settings['@setting'] == 'bool'">
                        <label class="control-label">{{'False value' | translate}}</label>
                        <input type="text" class="form-control" ng-model="settings['@falsevalue']">
                    </div>
                    <div class="form-group" ng-show="settings['@setting'] == 'select'">
                        <label class="control-label">{{'Options' | translate}}</label>
                        <div class="wt-paddingTopSmall">
                            <div class="form-inline">
                                <input type="text" class="form-control" ng-model="newOption">
                                &nbsp;
                                <button class="btn btn-success" ng-click="addOption();">{{'Add' | translate}}</button>
                            </div>
                            <table class="table" ng-show="settings['@select'].length">
                                <thead>
                                    <tr>
                                        <th>Title</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="option in settings['@select'] track by $index">
                                        <td>
                                            <span>{{option}}</span>
                                        </td>
                                        <td><a href="" ng-click="deleteItem($index, settings['@select'])"><span class="glyphicon glyphicon-trash"></span></a></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">{{'Default value' | translate}}</label>
                        <div class="row" wizdom-include="getSettingTemplate();"></div>
                    </div>
                </form>
                <span>CSS Preview</span>
                <div class="ace-full-height" style="height:100px;" ui-ace="{useWrapMode : true, showGutter: true, theme:'monokai', mode: 'css', showPrintMargin: false, onLoad: aceLoaded}"
                     ng-model="preview">
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal-footer">
    <button class="btn btn-default wiz-btn-padding" ng-disabled="loading" ng-click="cancel();">{{"Cancel" | translate}}</button>
    <button class="btn btn-primary wiz-btn-padding" ng-click="save();" ng-disabled="saving">{{'Save' | translate}}</button>
</div>