<?php
/**
 * YAWIK
 *
 * @filesource
 * @copyright https://yawik.org/COPYRIGHT.php
 * @license   MIT
 */
/**
 * {{rtd: currently not used. Generates an reference number for jobs}}
 */


$this->headScript()->appendFile($this->basePath('modules/Jobs/js/form.apply-identifier.js'));
$value = $this->element->getValue();
if (empty($value)) {
    throw new \RuntimeException('Missing application id in Element "' . $this->element->getLabel() . '"');
}
?>
<div class="apply-identifier-wrapper">
<?php
 echo str_replace('class="controls', 'class="apply-identifier-input controls', $this->formRow()->render($this->element, /*ignoreViewPartial*/ true));
?>

<div class="controls controls-row row apply-identifier-display hidden" id="<?php echo $this->element->getAttribute('id') ?>-display">
    <div class="col-md-3 text-right"><label class="text-muted"><?php echo $this->translate('Apply link') ?></label></div>
    <div class="col-md-9"><div class="panel panel-default form-control">
        <span class="text-muted apply-identifier-link"><?php echo $this->serverurl($this->url('lang/apply', array('applyId' => $value), true)) ?>
        </span>
    </div></div>
</div>
</div>