<?php
/* Smarty version 4.5.2, created on 2024-05-11 12:44:00
  from '/Users/nikolaimv/Sites/yzb.loc/admin/templates/views/banners/banner.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.2',
  'unifunc' => 'content_663f21c006d719_45757566',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'e0bbcac64d91f2923bcf3247b80e5d8c52166a85' => 
    array (
      0 => '/Users/nikolaimv/Sites/yzb.loc/admin/templates/views/banners/banner.tpl',
      1 => 1679630384,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:components/group-buttons.tpl' => 1,
    'file:components/page-header.tpl' => 1,
    'file:components/fields/select.tpl' => 1,
    'file:components/image-preview.tpl' => 1,
    'file:tinymce_init.tpl' => 1,
    'file:uploads_init.tpl' => 1,
  ),
),false)) {
function content_663f21c006d719_45757566 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/Users/nikolaimv/Sites/yzb.loc/includes/composer/vendor/smarty/smarty/libs/plugins/function.html_options.php','function'=>'smarty_function_html_options',),1=>array('file'=>'/Users/nikolaimv/Sites/yzb.loc/includes/composer/vendor/smarty/smarty/libs/plugins/modifier.date_format.php','function'=>'smarty_modifier_date_format',),));
?>
<form method="post" enctype="multipart/form-data" class="content-inner">
	<!-- Page header -->
    <?php ob_start();
if (!empty($_smarty_tpl->tpl_vars['page']->value)) {
echo (string)$_smarty_tpl->tpl_vars['page']->value;
}
$_prefixVariable1=ob_get_clean();
$_smarty_tpl->_subTemplateRender("file:components/group-buttons.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('url'=>((string)$_smarty_tpl->tpl_vars['adminUrl']->value)."/banners?page=".$_prefixVariable1.((string)$_smarty_tpl->tpl_vars['buildQueryString']->value)), 0, false);
?>

    <?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "breadcrumb", null, null);?>
		<a href="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/banners" class="breadcrumb-item"><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8', true);?>
</a>
		<span class="breadcrumb-item active">Добавить</span>
    <?php $_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>

    <?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "showBy", null, null);
$_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>

    <?php $_smarty_tpl->_subTemplateRender("file:components/page-header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('buttons'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'buttons'),'breadcrumb'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'breadcrumb'),'showBy'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'showBy')), 0, false);
?>
	<!-- /page header -->


	<div class="content">
        <div class="row"> 
            <div class="col-md-8">
    		    <div class="card border shadow-sm">
			        <div class="card-header d-flex flex-wrap">
				        <h6 class="mb-0">Основное</h6>
				        <div class="d-inline-flex ms-auto">
					        <a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
				        </div>
			        </div>
			        <div class="collapse show">
	                    <div class="card-body">
	                        <div class="row">
	                            <div class="col-md-6">
	                                <div class="form-group mb-3">
	                                    <label class="form-label is-visible <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['title']))) {?>text-danger<?php }?>">Заголовок</label>
	                                    <input type="text" class="form-control" autocomplete="off" name="banner[title]" value="<?php if ((isset($_smarty_tpl->tpl_vars['banner']->value['title']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['banner']->value['title'], ENT_QUOTES, 'UTF-8', true);
}?>" />
	                                </div>
	                                <div class="form-group mb-3">
	                                    <label class="form-label is-visible">Дополнительное поле для текста</label>
	                                    <input type="text" class="form-control" autocomplete="off" name="banner[text]" value="<?php if ((isset($_smarty_tpl->tpl_vars['banner']->value['text']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['banner']->value['text'], ENT_QUOTES, 'UTF-8', true);
}?>" />
	                                </div>
	                            </div>
	                            <div class="col-md-6">
	                                <div class="form-group mb-3">
	                                    <label class="form-label is-visible">Подзаголовок</label>
	                                    <input type="text" class="form-control" autocomplete="off" name="banner[alias]" value="<?php if ((isset($_smarty_tpl->tpl_vars['banner']->value['alias']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['banner']->value['alias'], ENT_QUOTES, 'UTF-8', true);
}?>" />
	                                </div>
	                                <div class="form-group mb-3">
	                                    <label class="form-label is-visible">Ссылка</label>
	                                    <input type="text" class="form-control" autocomplete="off" name="banner[url]" value="<?php if ((isset($_smarty_tpl->tpl_vars['banner']->value['url']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['banner']->value['url'], ENT_QUOTES, 'UTF-8', true);
}?>" />
	                                </div>
	                            </div>
	                        </div>
	                    </div>
			        </div>
    		    </div>

	            <div class="card border shadow-sm">
		            <div class="card-header d-flex flex-wrap">
			            <h6 class="mb-0">Описание</h6>
			            <div class="d-inline-flex ms-auto">
				            <a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
			            </div>
		            </div>
		            <div class="card-body collapse show flex-md-row m-0 p-0">
			            <textarea id="description" name="banner[summary]" class="description"><?php if ((isset($_smarty_tpl->tpl_vars['banner']->value['summary']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['banner']->value['summary'], ENT_QUOTES, 'UTF-8', true);
}?></textarea>
		            </div>
	            </div>


            
            </div>

            <div class="col-md-4">
        		                <div class="card border shadow-sm">
	                <div class="card-header d-flex flex-wrap">
		                <h6 class="mb-0">Статус и видимость</h6>
		                <div class="d-inline-flex ms-auto">
			                <a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
		                </div>
	                </div>
	                <div class="collapse show">
		                <div class="card-body border-top-0">
			                <div class="form-group mb-3">
				                <label class="form-label is-visible <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['group']))) {?>text-danger<?php }?>">Группа баннеров</label>
	                            <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['groups']->value,'name'=>"banner[groupId]",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['banner']->value['groupId'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp),'class'=>"form-control select"),$_smarty_tpl);?>

			                </div>
                                                        <?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('id'=>"status",'title'=>"Статус",'field'=>"banner[status]",'array'=>$_smarty_tpl->tpl_vars['statuses']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['banner']->value['status'] ?? null)===null||$tmp==='' ? 'visible' ?? null : $tmp),'class'=>"form-group mb-3"), 0, false);
?>
                            	                    </div>
                        <?php if ((isset($_smarty_tpl->tpl_vars['banner']->value['addedOn'])) && (isset($_smarty_tpl->tpl_vars['banner']->value['modifiedOn']))) {?>
		                <div class="card-footer hstack gap-3 justify-content-between">
			                <div class="text-muted">
				                <ul class="list list-unstyled mb-0 fs-sm">
                                    <li>Создано</li>
                                    <li>Изменено</li>
				                </ul>
			                </div>
			                <div class="hstack gap-1">
				                <ul class="list list-unstyled mb-0 fs-sm">
					                <li><?php echo htmlspecialchars((string)smarty_modifier_date_format($_smarty_tpl->tpl_vars['banner']->value['addedOn'],"%d.%m.%Y %H:%M"), ENT_QUOTES, 'UTF-8', true);?>
 (<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['banner']->value['addedBy']['loginName'] ?? null)===null||$tmp==='' ? "Неизвестный пользователь" ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
)</li>
                                    <li><?php echo htmlspecialchars((string)smarty_modifier_date_format($_smarty_tpl->tpl_vars['banner']->value['modifiedOn'],"%d.%m.%Y %H:%M"), ENT_QUOTES, 'UTF-8', true);?>
 (<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['banner']->value['modifiedBy']['loginName'] ?? null)===null||$tmp==='' ? "Неизвестный пользователь" ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
)</li>
				                </ul>
			                </div>
		                </div>
                        <?php }?>
	                </div>
    			</div>

	                            <?php ob_start();
if ((isset($_smarty_tpl->tpl_vars['banner']->value['image']))) {
echo (string)$_smarty_tpl->tpl_vars['banner']->value['image']['original'];
}
$_prefixVariable2=ob_get_clean();
ob_start();
if ((isset($_smarty_tpl->tpl_vars['banner']->value['image']))) {
echo (string)$_smarty_tpl->tpl_vars['banner']->value['image']['imageId'];
}
$_prefixVariable3=ob_get_clean();
$_smarty_tpl->_subTemplateRender("file:components/image-preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('image'=>$_prefixVariable2,'id'=>$_prefixVariable3,'module'=>'banner'), 0, false);
?>
                
            </div>

	        <div class="col-md-12 main main_buttons text-center">
                <?php if ((isset($_smarty_tpl->tpl_vars['banner']->value['bannerId']))) {?><input type="hidden" class="form-control" id="id" name="id" value="<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['banner']->value['bannerId'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
"><?php }?>
                <?php echo $_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'buttons');?>

	        </div>

        </div>
    </div>
</form>

<?php $_smarty_tpl->_subTemplateRender('file:tinymce_init.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<?php $_smarty_tpl->_subTemplateRender('file:uploads_init.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<?php echo '<script'; ?>
>
    $(document).ready(function () {
        <?php if ((isset($_smarty_tpl->tpl_vars['messages']->value['saved']))) {?> new Noty({ text: 'Слайд &laquo;<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['banner']->value['title'], ENT_QUOTES, 'UTF-8', true);?>
&raquo; сохранен.', type: 'success' }).show(); <?php }?>

        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['access_denied']))) {?> new Noty({ text: 'Доступ запрещен.', type: 'error' }).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['title']))) {?> new Noty({ text: 'Введите заголовок.', type: 'error' }).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['group']))) {?> new Noty({ text: 'Введите заголовок.', type: 'error' }).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['not_saved']))) {?> new Noty({ text: 'Слайд &laquo;<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['banner']->value['title'], ENT_QUOTES, 'UTF-8', true);?>
&raquo; НЕ сохранен.', type: 'error', timeout: 1500 }).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['image_not_saved']))) {?> new Noty({ text: 'Картинка НЕ сохранена.', type: 'error' }).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['slider_not_found']))) {?> new Noty({ text: 'Слайд не найден или доступ запрещен.', type: 'error' }).show(); <?php }?>
    });

    <?php echo '</script'; ?>
>
<?php }
}
