<dialog-ok-cancel title="{{ setting.IsNew ? 'Add' : 'Edit'}} setting {{ setting.Name }}">
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label">Name</label>
        <div class="col-sm-9">
            <input autofocus id="name" class="form-control input-permission-name" ng-model="setting.Name" required ng-disabled="!setting.IsNew"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">Blocked</label>
        <div class="col-sm-9">
            <button type="button" class="btn btn-primary dropdown-toggle btn-select btn-block" data-toggle="dropdown" href="" lu-enable-permission="{{ neededPermission }}">
                <span class="pull-left">{{ setting.IsBlocked ? 'Yes' : 'No' }}</span>
                <span class="caret pull-right"></span>
            </button>
            <ul class="dropdown-menu col-sm-12">
                <li><a href="" ng-click="setting.IsBlocked = false">No</a></li>
                <li><a href="" ng-click="setting.IsBlocked = true">Yes</a></li>
            </ul>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">Admin</label>
        <div class="col-sm-9">
            <button type="button" class="btn btn-primary dropdown-toggle btn-select btn-block" data-toggle="dropdown" href="" lu-enable-permission="{{ neededPermission }}">
                <span class="pull-left">{{ setting.IsAdmin ? 'Yes' : 'No' }}</span>
                <span class="caret pull-right"></span>
            </button>
            <ul class="dropdown-menu col-sm-12">
                <li><a href="" ng-click="setting.IsAdmin = false">No</a></li>
                <li><a href="" ng-click="setting.IsAdmin = true">Yes</a></li>
            </ul>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">Type</label>
        <div class="col-sm-9">
            <button type="button" class="btn btn-primary dropdown-toggle btn-select btn-block" data-toggle="dropdown"
                    href="" lu-enable-permission="{{ neededPermission }}" ng-disabled="!setting.IsNew">
                <span class="pull-left">{{ setting.Type }}</span>
                <span class="caret pull-right"></span>
            </button>
            <ul class="dropdown-menu col-sm-12">
                <li ng-repeat="type in types"><a href="" ng-click="setType(type)">{{ type }}</a></li>
            </ul>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label" for="Value">Value</label>
        <div class="col-sm-9">
            <textarea id="Value" ng-model="setting.Value" ng-if="setting.Type == 'string'"
                      class="form-control" lu-enable-permission="{{ neededPermission }}"></textarea>

            <input id="Value" ng-model="setting.Value" ng-if="setting.Type == 'int' || setting.Type == 'float'"
                   class="form-control" type="number" required lu-enable-permission="{{ neededPermission }}" />

            <div class="col-sm-9" ng-if="setting.Type == 'object'">{{ setting.Value }}</div>

            <div class="btn-group" ng-if="setting.Type == 'bool'">
                <button type="button" class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown"
                        href="" lu-enable-permission="{{ neededPermission }}">
                    {{ setting.Value ? 'Yes' : 'No' }} <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="" ng-click="setting.Value = false">No</a></li>
                    <li><a href="" ng-click="setting.Value = true">Yes</a></li>
                </ul>
            </div>
        </div>
    </div>
</dialog-ok-cancel>