<div class="panel panel-default">
    <div class="panel-heading">
        <h2 ng-if="!vm.isEditMode">{{::vm.translate.get('Create Page')}}</h2>
        <h2 ng-if="vm.isEditMode">{{::vm.translate.get('Edit Page')}}</h2>
    </div>
    <div class="panel-body">
        <form name="pageForm" class="form-horizontal">
            <div class="col-sm-offset-2 bg-danger" ng-show="vm.validationErrors">
                <ul>
                    <li ng-repeat="error in vm.validationErrors">{{error}}</li>
                </ul>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{::vm.translate.get('Name')}}</label>
                <div class="col-sm-10">
                    <input name="name" ng-model="vm.page.name" ng-change="vm.updateSlug()" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Url</label>
                <div class="col-sm-10">
                    <input name="slug" ng-model="vm.page.slug" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{::vm.translate.get('Meta Title')}}</label>
                <div class="col-sm-10">
                    <input name="metaTitle" ng-model="vm.page.metaTitle" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{::vm.translate.get('Meta Keywords')}}</label>
                <div class="col-sm-10">
                    <textarea name="metaKeywords" ng-model="vm.page.metaKeywords" class="form-control" rows="2"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{::vm.translate.get('Meta Description')}}</label>
                <div class="col-sm-10">
                    <textarea name="metaDescription" ng-model="vm.page.metaDescription" class="form-control" rows="3"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{::vm.translate.get('Body')}}</label>
                <div class="col-sm-10">
                    <summernote on-image-upload="vm.imageUpload(files)" editor="vm.body" ng-model="vm.page.body"></summernote>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button class="btn btn-primary" ng-click="vm.save()"><span class="glyphicon glyphicon-ok"></span> {{::vm.translate.get('Save')}}</button>
                    <button ui-sref="page" class="btn btn-default">{{::vm.translate.get('Cancel')}}</button>
                </div>
            </div>
        </form>
    </div>
</div>