<div class="blade-static __bottom" ng-include="'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/common/templates/ok-cancel.tpl.html'"></div>

<div class="blade-content __xlarge-wide">
    <div class="blade-inner">
        <div class="inner-block">
            <form class="form" name="formScope">
                <p ng-if="blade.currentEntity.isPredefined && blade.currentEntity.isEdited" class="text __note"><span>{{ 'notifications.blades.notifications-edit-template.labels.note-caption' | translate }}</span> {{ 'notifications.blades.notifications-edit-template.labels.note-text' | translate }}</p>
                <div class="form-group clearfix" ng-init="setForm(formScope)">
                    <div class="column">
                        <div class="form-group">
                            <label class="form-label" style="margin:0">{{'notifications.blades.notifications-edit-template.labels.language' | translate}}</label>
                            <div class="form-input" style="margin-top:0">
                                <ui-select ng-model="blade.currentEntity.languageCode" ng-disabled="blade.currentEntity.isReadonly">
                                    <ui-select-match allow-clear placeholder="{{ 'notifications.blades.notifications-edit-template.placeholders.language' | translate }}">{{$select.selected}}</ui-select-match>
                                    <ui-select-choices repeat="x in blade.languages">
                                        <span ng-bind-html="x"></span>
                                    </ui-select-choices>
                                </ui-select>
                                <div class="table-descr">
                                    {{ 'notifications.blades.notifications-edit-template.labels.blank-note' | translate }}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="column" ng-if="blade.notification.kind ==='EmailNotification'">
                        <div class="form-group">
                            <label class="form-label" style="margin:0">{{'notifications.blades.notifications-edit-template.labels.layout' | translate}}</label>
                            <ui-scroll-drop-down page-size="50"
                                                 ng-model="blade.currentEntity.notificationLayoutId"
                                                 data="searchNotificationLayouts(criteria)"
                                                 placeholder="'notifications.blades.notifications-edit-template.placeholders.layout'">
                            </ui-scroll-drop-down>
                            <div class="table-descr">
                                {{ 'notifications.blades.notifications-edit-template.labels.layout-blank-note' | translate }}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group clearfix" ng-if="blade.notification.kind ==='EmailNotification'">
                    <div class="column">
                        <div>
                            <label class="form-label" style="margin:0">{{'notifications.blades.notifications-edit-template.labels.subject' | translate}}</label>
                            <div style="margin:0">
                                <div class="form-input">
                                    <input ng-disabled="blade.currentEntity.isReadonly" focus-on="" required class="form-control" ng-model="blade.currentEntity.subject" placeholder="{{ 'notifications.blades.notifications-edit-template.placeholders.subject' | translate }}" />
                                </div>
                                <div class="table-descr">
                                    {{ 'notifications.blades.notifications-edit-template.descriptions.subject' | translate }}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group inner-block" ng-if="blade.notification.kind ==='EmailNotification'">
                    <div class="column">
                        <div>
                            <label class="form-label" style="margin:0">{{'notifications.blades.notifications-edit-template.labels.template' | translate}}</label>
                            <div class="form-group" style="margin:0">
                                <input id="fileUploader" type="file" multiple style="display: none;" uploader="fileUploader" nv-file-select />
                                <textarea ng-disabled="blade.currentEntity.isReadonly" vc-uk-htmleditor ng-model="blade.currentEntity.body" file-uploader="fileUploader"></textarea>
                            </div>
                        </div>
                        <div>
                            <label class="form-label" style="margin:0">{{'notifications.blades.notifications-edit-template.labels.sample' | translate}}</label>
                            <div class="form-input">
                                <textarea class="__xlarge form-control" ng-class="{'error': !blade.isSampleValidJson()}" cols="30" rows="30" ng-disabled="blade.currentEntity.isReadonly" ng-model="blade.currentEntity.sample"></textarea>
                            </div>
                            <div class="table-descr">
                                {{ 'notifications.blades.notifications-edit-template.descriptions.sample' | translate }}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="inner-block" ng-if="blade.notification.kind ==='SmsNotification'">
                    <div class="column">
                        <div class="form-group">
                            <label class="form-label" style="margin:0">{{'notifications.blades.notifications-edit-template.labels.template' | translate}}</label>
                            <div class="form-group" style="margin:0">
                                <input id="fileUploader" type="file" multiple style="display: none;" uploader="fileUploader" nv-file-select />
                                <textarea ng-disabled="blade.currentEntity.isReadonly" vc-uk-htmleditor ng-model="blade.currentEntity.message" file-uploader="fileUploader"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
