<?php
/**
 * YAWIK
 *
 * @filesource
 * @copyright https://yawik.org/COPYRIGHT.php
 * @license   MIT
 */

$id = $this->element->getEntity()->getId();
$lang = $this->params('lang');

?>
<h3><?php echo $this->translate("Job details")?></h3>
<div class="row">
    <div class="col-md-8">
        <div class="panel panel-default">
            <div class="panel-body">
                <iframe id="editJob" style="width:100%; height:800px;" src="<?php
                $job = $this->element->getEntity();
                if ($job instanceOf \Jobs\Entity\JobSnapshot) {
                    $linkOptions = ['query' => ['snapshot' => $job->getSnapshotId()]];
                } else {
                    $linkOptions = [];
                }

                echo $this->url('lang/jobs/editTemplate', array('id' => $id), $linkOptions); ?>"></iframe>
            </div>
        </div>
    </div>
    <div class="col-md-4">
        <div class="alert alert-info">
            <?php echo $this->translate("You are using a default template. You are free to create your own template, just contact the developing team for integration")?>
            <div id="template-links">
            <ul >
                <li>
                    <a href="<?php echo $this->url('lang/jobs/template', array('id' => $id,'template'=>'default'), $linkOptions)?>">
                        <?php echo $this->translate("Default")?>
                    </a>
                </li>
                <li>
                    <a href="<?php echo $this->url('lang/jobs/template', array('id' => $id, 'template'=>'classic'), $linkOptions)?>">
                        <?php echo $this->translate("Classic")?>
                    </a>
                </li>
                <li>
                    <a href="<?php echo $this->url('lang/jobs/template', array('id' => $id, 'template'=>'modern'), $linkOptions)?>">
                        <?php echo $this->translate("Modern")?>
                    </a>
                </li>
                <li>
                    <a href="<?php echo $this->url('lang/jobs/template', array('id' => $id, 'template'=>'html'), $linkOptions)?>">
                        <?php echo $this->translate("Pure HTML")?>
                    </a>
                </li>

                <?php
                $this->headScript()->appendFile($this->basePath('modules/Jobs/js/templates.js'));
                ?>
            </ul>
                <div id="template-links-loading" style="display: none;">loading</div>
            </div>
        </div>
        <div class="alert alert-info">
            <h4><?php echo $this->translate('Track applications')?></h4>

            <?=$this->summaryForm($this->element->getForm('atsMode'), 'form-horizontal') ?>

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