<?php $view->extend('::wicms.html.php'); ?>
<?php $this->addGlobal('menuIsActive', $view['router']->path('wi_admin_blog_index')); ?>

<?php $view['slots']->set('title', $view['translator']->trans('title.categoryBlog.catEdit')) ?>

<?php $view['slots']->start('stylesheets'); ?>
    <link href="<?php echo $view['assets']->getUrl('media/Admin/WiCMS3/js/jquery/chosen/chosen.min.css') ?>" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="<?php echo $view['assets']->getUrl('media/Admin/WiCMS3/js/jquery/select2/dist/css/select2.min.css') ?>">
    <link rel="stylesheet" href="<?php echo $view['assets']->getUrl('media/Admin/WiCMS3/css/news.css') ?><?php echo $view['config']->getParameter('vStyle'); ?>"/>
<?php $view['slots']->stop(); ?>

<?php $view['slots']->start('breadcrumbs') ?>
    <li>
        <?php echo $view['translator']->trans('main-menu.content'); ?>
    </li>
    <li>
        <a href="<?php echo $view['router']->path('wi_admin_blog_index'); ?>"><?php echo $view['translator']->trans('breadcrumbs.blog.news'); ?></a>
    </li>
    <li>
        <a href="<?php echo $view['router']->path('wi_admin_blog_categories_index'); ?>">
            <?php echo $view['translator']->trans('breadcrumbs.categoryBlog.catList'); ?>
        </a>
    </li>
    <li>
        <a href="<?php echo $view['router']->path('wi_admin_blog_categories_edit', array('id' => $category->getId())); ?>">
            <?php echo $view['translator']->trans('breadcrumbs.categoryBlog.catEdit'); ?>
        </a>
    </li>
<?php $view['slots']->stop() ?>

<?php $view['slots']->start('titleSite') ?>
    <?php echo $view['translator']->trans('blog.listTitle'); ?> - <?php echo $view['translator']->trans('catBlogEdit.subTitle'); ?>
<?php $view['slots']->stop() ?>
<?php $view['slots']->start('titleIcon') ?>
    <i class="icon-comment-alt-1 color-menu-content"></i>
<?php $view['slots']->stop() ?>
<?php $view['slots']->start('titleDesc') ?>
    <?php echo $view['translator']->trans('catBlogEdit.desc'); ?>
<?php $view['slots']->stop() ?>

<?php $view['slots']->start('helpRightPanel') ?>

<?php $view['slots']->stop() ?>

<?php $view['slots']->start('body'); ?>
<div class="box">
    <div class="box-header bg-transparent">
        <!-- tools box -->
        <h3 class="box-title">
            <i class="icon-edit"></i>
            <span><?php echo $view['translator']->trans('catBlogEdit.listSubTitle'); ?> - <?php echo $category->getName();?></span>
        </h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body " style="display: block;">
        <?php echo $view['form']->start($edit_form) ?>
        <?php if ($view['form']->errors($edit_form)): ?>
            <div class="alert callout small">
                <?php echo $view['form']->errors($edit_form); ?>
            </div>
        <?php endif; ?>
        <div class="row">
            <div class="large-2 columns">
                <p><strong><?php echo $view['form']->label($edit_form['name']) ?></strong>
                    <i class="icon-help-circled helpIcon" data-tooltip title="<?php echo $view['translator']->trans('catBlogEdit.formDesc'); ?>"></i>
                </p>
            </div>
            <div class="large-10 columns">
                <div class="row">
                    <div class="medium-12 large-6 columns end">
                            <div class="formAlert">
                                <?php echo $view['form']->errors($edit_form['name']) ?>
                            </div>
                        <?php echo($view['form']->errors($edit_form['name']) ? $view['form']->widget($edit_form['name'], array('attr' => array('class' => 'callout alert'))) : $view['form']->widget($edit_form['name'])) ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="large-2 columns">
                <p><strong><?php echo $view['form']->label($edit_form['orderNr']) ?></strong>
                </p>
            </div>
            <div class="large-10 columns">
                <div class="row">
                    <div class="small-6 medium-4 large-2 columns end">
                            <div class="formAlert">
                                <?php echo $view['form']->errors($edit_form['orderNr']) ?>
                            </div>
                        <?php echo($view['form']->errors($edit_form['orderNr']) ? $view['form']->widget($edit_form['orderNr'], array('attr' => array('class' => 'callout alert'))) : $view['form']->widget($edit_form['orderNr'])) ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="large-2 columns">
                <p><strong><?php echo $view['form']->label($edit_form['description']) ?></strong>
                </p>
            </div>
            <div class="large-10 columns">
                <div class="row">
                    <div class="medium-12 large-6 columns end">
                            <div class="formAlert">
                                <?php echo $view['form']->errors($edit_form['description']) ?>
                            </div>
                        <?php echo($view['form']->errors($edit_form['description']) ? $view['form']->widget($edit_form['description'], array('attr' => array('class' => 'callout alert'))) : $view['form']->widget($edit_form['description'])) ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="large-2 columns">
                <p><strong><?php echo $view['form']->label($edit_form['parent']) ?></strong>
                </p>
            </div>
            <div class="large-10 columns">
                <div class="row">
                    <div class="medium-12 large-6 columns end">
                            <div class="formAlert">
                                <?php echo $view['form']->errors($edit_form['parent']) ?>
                            </div>
                        <?php echo($view['form']->errors($edit_form['parent']) ? $view['form']->widget($edit_form['parent'], array('attr' => array('class' => 'callout alert chosenSelectCategory'))) : $view['form']->widget($edit_form['parent'], array('attr' => array('class' => 'chosenSelectCategory')))) ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="large-2 columns">
                <p><strong><?php echo $view['form']->label($edit_form['file']) ?></strong>
                </p>
            </div>
            <div class="large-10 columns">
                <div class="row">
                    <div class="medium-12 large-6 columns end">
                        <div class="formAlert"><?php echo $view['form']->errors($edit_form['file']); ?></div>
                        <?php echo $view['form']->widget($edit_form['file'], [
                            'attr' => [
                                'class' => ($edit_form['file']->vars['attr']['class'] ?? '') . (! $edit_form['file']->vars['valid'] ? ' callout alert' : null),
                            ],
                        ]); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class=" columns">
        <div class="wi-konatkt-form">
            <button class="button" href="#" type="submit" value="<?php echo $view['translator']->trans('Form.send'); ?>">
                <i class="icon-edit"></i>
                <?php echo $view['translator']->trans('Form.send'); ?>
            </button>
            <?php echo $view['form']->end($edit_form) ?>
            <a class="button secondary float-right" href="<?php echo $view['router']->path('wi_admin_blog_categories_show', array('id' => $category->getId())); ?>">
                <i class="icon-reply"></i> <?php echo $view['translator']->trans('Form.backShow'); ?>
            </a>
        </div>
    </div>
</div>
<?php $view['slots']->stop(); ?>

<?php $view['slots']->start('javascript'); ?>
    <script src="<?php echo $view['assets']->getUrl('media/Admin/WiCMS3/js/jquery/chosen/chosen.jquery.min.js') ?>" type="text/javascript"></script>
    <script src="<?php echo $view['assets']->getUrl('media/Admin/WiCMS3/js/jquery/select2/dist/js/select2.min.js') ?>"></script>
    <script src="<?php echo $view['assets']->getUrl('media/Admin/WiCMS3/js/news.js') ?>" type="text/javascript"></script>
<?php $view['slots']->stop(); ?>
