<?php

$wrapperLayout       =  (!empty($this->options['wrapperLayout']) ) ? $this->options['wrapperLayout']:'';
$wrapperLayoutClass = (!empty($this->options['wrapperLayoutClass']) ) ? ' class="'.$this->options['wrapperLayoutClass'].'" ':'';
 

$wrapperBlock      =   (!empty($this->options['wrapperBlock']) ) ? $this->options['wrapperBlock']:'';
$wrapperBlockClass = (!empty($this->options['wrapperBlockClass']) ) ? ' class="'.$this->options['wrapperBlockClass'].'" ':'';


$wrapperItem        = (!empty($this->options['wrapperItem']) ) ? $this->options['wrapperItem']:'';
$wrapperItemClass = (!empty($this->options['wrapperItemClass']) ) ? ' class="'.$this->options['wrapperItemClass'].'" ':'';

if( !empty($wrapperLayout))
    echo '<'.$wrapperLayout.$wrapperLayoutClass.'>'.PHP_EOL;



    $row = $this->job;
       if( !empty($wrapperItem))
            echo '<'.$wrapperItem.$wrapperItemClass.'>'.PHP_EOL;
            if( $this->options['showTitle'])
                echo '<h1 class="job-title">'.$row->title.'</h1>'.PHP_EOL;
            
            $annonce = $this->options['short'] ? $this->truncate($row->annonce , $this->options['shortCount'] ) : $row->annonce ;
            echo '<div class="job-annonce">'.$annonce.'</div>'.PHP_EOL;
            
            if( $this->options['showMore'] || $this->options['showApply'])
                    echo '<div class="footer">';
            
            if( $this->options['showMore']){
                $url = $this->url(array('ref' => $row->ref, 'type'=> $row->type ) , 'jobs-view' , true );
                
               echo '<a class="more"  href="'.$url.'">'.$this->translate('#see more##').'</a>';
            }
            
            if( $this->options['showApply']){
                $url = $this->url(array('ref' => $row->ref , 'action' => 'apply') , 'jobs', true  );
               echo '<h2>Postuler</h2>'.$this->action( 'apply','index','jobs', array('ref' => $row->ref ) );
               //echo '<a class="apply"  href="'.$url.'">'.$this->translate('#apply##').'</a>';
            }
       
             if( $this->options['showMore'] || $this->options['showApply'])
                    echo '</div>';
       if( !empty($wrapperItem))
            echo '</'.$wrapperItem.'>'.PHP_EOL;
    


if( !empty($wrapperLayout))
    echo '</'.$wrapperLayout.'>';
