dreamjob/app/View/Elements/job_opening_item.ctp

96 lines
4.5 KiB
PHP

<?php
/*
*
*/
$opening_in_fav = false;
$opening_in_app = false;
?>
<c:if test="${WORKER!=null}">
<c:forEach var="item" items="${WORKER.applications}">
<c:if test="${item.opening.id eq opening.id}">
<c:set var="opening_in_app" value="true" />
<c:set var="opening_app" value="${item}" />
</c:if>
</c:forEach>
<c:forEach var="item" items="${WORKER.favority}">
<c:if test="${item.id eq opening.id}">
<c:set var="opening_in_fav" value="true" />
</c:if>
</c:forEach>
</c:if>
<c:if test="${empty opening_MINI || not (opening_in_app || opening_in_fav)}">
<div class="openingitem">
<h3><?=$opening['DreamjobJobOpening']['title'];?></h3>
<c:if test="${WORKER!=null}">
<c:if test="${not opening_in_app}">
<span style="float: right;">
<a href="<c:url value="${URL}favority/toggle/${opening.id}/"/>"><c:choose>
<c:when test="${opening_in_fav}"><img src="<c:url value="${STATIC_URL}img/favority_on.png"/>"/></c:when><c:otherwise><img src="<c:url value="${STATIC_URL}img/favority_off.png"/>"/></c:otherwise></c:choose></a>
</span>
</c:if>
</c:if>
<div>
<c:choose>
<c:when test="${opening.company.avatar != null}">
<div class="icon">
<span><c:out value="${opening.company.nickname}${opening.company.corporateform}"/></span>
<div>
<img src="<c:url value="${MEDIA_URL}${profil.avatar}"/>"/>
</div>
</div>
</c:when>
<c:otherwise>
<div class="noicon-title">
<span><c:out value="${opening.company.nickname}${opening.company.corporateform}"/></span>
</div>
</c:otherwise>
</c:choose>
<div class="left">
<span><?=__("dreamjob.graducation.company");?>: <?=$opening['DreamjobListGraducation']['name'];?></span>
<span><?=__("dreamjob.branch");?>: <?=$opening['DreamjobJobOpening']['branch'];?></span>
<span><?=__("dreamjob.city");?>: <?=$opening['DreamjobJobOpening']['city'];?></span>
<span><?=__("dreamjob.kindofjob");?>: <?=$opening['DreamjobListKindofjob']['name'];?></span>
<span<?php if( time() > strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate"<?php } ?>><?=__("dreamjob.opening.enddate");?>: <?=$this->Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?></span>
</div>
<div class="right">
<div class="btn-group-vertical">
<a class="btn btn-default" href="<c:url value="${URL}opening/${opening.id}/"/>">
<spring:message code="dreamjob.opening.detail"/>
</a>
<c:choose>
<c:when test="${COMPANY.id==opening.company.id}">
<a class="btn btn-default" href="<c:url value="${URL}opening/edit/${opening.id}/"/>">
<spring:message code="dreamjob.edit"/>
</a>
</c:when>
<c:when test="${opening_in_app}">
<c:set var="count" value="0"/>
<c:set var="newcount" value="0"/>
<c:forEach var="item" items="${opening_app.messages}">
<c:if test="${item.fromcompany && not saw}">
<c:set var="newcount" value="${newcount + 1}"/>
</c:if>
<c:set var="count" value="${count + 1}"/>
</c:forEach>
<a class="btn btn-default" href="<c:url value="${URL}application/${opening_app.id}/"/>">
<spring:message code="dreamjob.applicated"/>
<span class="badge">
<c:if test="${newcount eq count}">${newcount}/</c:if>
${count}</span>
</a>
</c:when>
<c:otherwise>
<a class="btn btn-default
<c:if test="${WORKER ==null}">disabled</c:if>"
href="{% url de.miconware.dreamjob.jobs.views.application_send opening.pk %}">
<spring:message code="dreamjob.applicate"/>
</a>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
</div>
</c:if>