<?php
/* Smarty version 4.5.3, created on 2024-10-26 16:46:40
  from '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/post.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_671cf2c0b195f3_52429701',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '2c9a75df897c099126c1d0dbe10d182cf1bf9351' => 
    array (
      0 => '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/post.tpl',
      1 => 1718970051,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:components/annotation-body.tpl' => 1,
    'file:components/images.tpl' => 1,
    'file:components/meta.tpl' => 1,
  ),
),false)) {
function content_671cf2c0b195f3_52429701 (Smarty_Internal_Template $_smarty_tpl) {
if ($_smarty_tpl->tpl_vars['post']->value->id) {
$_smarty_tpl->_assignInScope('meta_title', $_smarty_tpl->tpl_vars['post']->value->name ,false ,8);
} else {
$_smarty_tpl->_assignInScope('meta_title', 'Новая запись' ,false ,8);
}?>

<?php $_smarty_tpl->_assignInScope('tabs', "tabs" ,false ,8);?>

<div class="container-fluid">

        <div class="nk-block-head nk-block-head-sm">
        <div class="nk-block-between">

                        <div class="nk-block-head-content">
                <h3 class="nk-block-title page-title">
                    <?php if ($_smarty_tpl->tpl_vars['post']->value->id) {?>
                        Редактирование записи: <?php echo $_smarty_tpl->tpl_vars['post']->value->name;?>

                    <?php } else { ?>
                        Новый пост
                    <?php }?>
                </h3>
                <div class="nk-block-des text-soft">
                    <p>Управление записями магазина.</p>
                </div>
            </div>

                        <div class="nk-block-head-content">
                <div class="toggle-wrap nk-block-tools-toggle">

                                        <a href="#" class="btn btn-icon btn-trigger toggle-expand mr-n1" data-target="pageMenu">
                        <em class="icon ti ti-menu"></em>
                    </a>

                                        <div class="toggle-expand-content" data-content="pageMenu">
                        <ul class="nk-block-tools g-3">

                                                        <?php if ($_GET['return']) {?>
                            <li>
                                <a href="<?php echo $_GET['return'];?>
" class="btn btn-white btn-outline-light">
                                    <em class="icon ti ti-arrow-back-up"></em>
                                    <span>Вернуться</span>
                                </a>
                            </li>
                            <?php }?>

                                                        <?php if ($_smarty_tpl->tpl_vars['post']->value->id) {?>
                            <li>
                                <a href="<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0], array( array('module'=>'PostAdmin','return'=>$_SERVER['REQUEST_URI']),$_smarty_tpl ) );?>
" class="btn btn-light btn-icon btn-outline-light" data-toggle="tooltip" data-placement="top" title="Создать запись">
                                    <em class="icon ti ti-plus"></em>
                                </a>
                            </li>

                                                        <li>
                                <a href="/blog/<?php echo $_smarty_tpl->tpl_vars['post']->value->url;?>
" target="_blank" class="btn btn-light btn-icon btn-outline-light" data-toggle="tooltip" data-placement="top" title="Открыть на сайте">
                                    <em class="icon ti ti-external-link"></em>
                                </a>
                            </li>
                            <?php }?>

                        </ul>
                    </div>
                </div>
            </div>

        </div>
    </div>

        <?php if ($_GET['message_success']) {?>
    <div class="pb-2">
        <div class="alert alert-fill alert-success alert-icon">
            <em class="icon ti ti-circle-check"></em>
            <?php if ($_GET['message_success'] == 'added') {?>Запись добавлена<?php } elseif ($_GET['message_success'] == 'updated') {?>Запись обновлена<?php }?>.
        </div>
    </div>
    <?php }?>

        <?php if ($_GET['message_error']) {?>
    <div class="pb-2">
        <div class="alert alert-fill alert-danger alert-icon">
            <em class="icon ti ti-circle-x"></em>
            <?php if ($_GET['message_error'] == 'url_exists') {?>Запись с таким адресом уже существует<?php }?>.
        </div>
    </div>
    <?php }?>


        <form method="post">
        <input name="id" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['post']->value->id;?>
"/>

        <div class="row">

                        <div class="col-lg-8 mb-3 mb-lg-0">

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <div class="nk-block">
                            	<div class="nk-block-head">
                            		<h5 class="title">Основная информация</h5>
                            		<p>Основные данные записи.</p>
                            	</div>
                                <div class="row gy-4">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="form-label" for="page_name">Название поста</label>
                                            <div class="form-control-wrap">
                                                <input type="text" class="form-control" id="page_name" name="name" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['post']->value->name, ENT_QUOTES, 'UTF-8', true);?>
" required>
                                            </div>
                                            <span class="form-note">Например: "Самые красивые места Алтая".</span>
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="form-label" for="tags">Теги, через запятую</label>
                                            <div class="form-control-wrap">
                                                <input type="text" class="form-control" id="tags" name="tags" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['post']->value->tags, ENT_QUOTES, 'UTF-8', true);?>
">
                                            </div>
                                            <span class="form-note">Наример: "Природа,Здоровье,Наука".</span>
                                        </div>
                                    </div>
                                    <div class="col-md-4 col-sm-6">
                                        <div class="form-group">
                                            <label class="form-label" for="author">Автор</label>
                                            <div class="form-control-wrap">
                                                <input type="text" class="form-control" id="author" name="author" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['post']->value->author, ENT_QUOTES, 'UTF-8', true);?>
" required>
                                            </div>
                                            <span class="form-note">Например: "Админ".</span>
                                        </div>
                                    </div>
                                    <div class="col-md-8 col-sm-6">
                                        <div class="form-group">
                                            <label class="form-label" for="category">Категории</label>
                                            <div class="form-control-wrap">
                                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['categories']->value, 'name', false, 'url');
$_smarty_tpl->tpl_vars['name']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['url']->value => $_smarty_tpl->tpl_vars['name']->value) {
$_smarty_tpl->tpl_vars['name']->do_else = false;
?>
                                                <div class="custom-control custom-switch mr-4">
                                                    <input class="custom-control-input" name="categories[]" type="checkbox" id="<?php echo $_smarty_tpl->tpl_vars['url']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['url']->value;?>
" <?php if (in_array($_smarty_tpl->tpl_vars['url']->value,$_smarty_tpl->tpl_vars['post']->value->categories)) {?>checked<?php }?>>
                                                    <label class="custom-control-label" for="<?php echo $_smarty_tpl->tpl_vars['url']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['name']->value;?>
</label>
                                                </div>
                                                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="justify-center mt-2">
                                <button type="submit" class="btn btn-success">Сохранить</button>
                            </div>
                        </div>
                    </div>
                </div>

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <div class="nk-block">
                            	<div class="nk-block-head">
                            		<h5 class="title">Описание</h5>
                            		<p>Краткое и полное описание поста.</p>
                            	</div>
                                <?php $_smarty_tpl->_subTemplateRender("file:components/annotation-body.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('item'=>$_smarty_tpl->tpl_vars['post']->value,'type'=>"PostAdmin"), 0, false);
?>
                            </div>
                            <div class="justify-center mt-2">
                                <button type="submit" class="btn btn-success">Сохранить</button>
                            </div>
                        </div>
                    </div>
                </div>

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <?php $_smarty_tpl->_subTemplateRender("file:components/images.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('images'=>$_smarty_tpl->tpl_vars['post']->value->images,'dir'=>'pages'), 0, false);
?>
                        </div>
                    </div>
                </div>
            </div>

                        <div class="col-lg-4 card-box-right">
                <div class="card-box_sticky">
                                        <div class="card card-bordered mb-3">
                        <div class="card-content">
                            <div class="card-inner">

                                <div class="nk-block">
                                    <div class="nk-block-head">
                                        <h5 class="title">Параметры</h5>
                                    </div>
                                    <div class="form-group">
                                        <label class="form-label" for="post_visible">Активность</label>
                                        <span class="form-note">Включение или отключение записи.</span>
                                        <div class="form-control-wrap">
                                            <div class="custom-control custom-switch">
                                                <input type="checkbox" name="visible" value="1" class="custom-control-input" id="post_visible" <?php if ($_smarty_tpl->tpl_vars['post']->value->visible) {?>checked<?php }?>>
                                                <label class="custom-control-label" for="post_visible"></label>
                                            </div>
                                        </div>
                                    </div>
                                </div>

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

                                        <div class="card card-bordered mb-3">
                        <div class="card-content">
                            <div class="card-inner">
                                <?php $_smarty_tpl->_subTemplateRender("file:components/meta.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('item'=>$_smarty_tpl->tpl_vars['post']->value,'url'=>'/blog/'), 0, false);
?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </form>

</div>
<?php }
}
