{% import 'common/macros/elements.html.twig' as elements %}
{% import 'common/macros/svg.html.twig' as svg %}
{% macro list_item(job) %}
{% set applyUrl = job.getExternalApplyUrl() ?? path('career_show', { job: job.getSlug() }) %}
<article class="item" data-code="{{ job.getLocation()|lower }}">
{{ elements.heading('<a href="' ~ applyUrl ~ '">' ~ job.getName() ~ '</a>', 3, 'title') }}
<div class="details">
{% if job.getLevel() is not null %}
<div class="job-level">
<div class="icon">{{ elements.job_level_icon(job) }}</div>
{{ ('job_level.' ~ job.getLevel())|trans({}, 'enum') }}
</div>
{% endif %}
{% if job.workingHours() is not null %}
<div class="job-hours">
<div class="icon">{{ elements.job_workhour_icon(job) }}</div>
{{ ('job_working_hours.' ~ job.getWorkingHours())|trans({}, 'enum') }}
</div>
{% endif %}
<div class="location">
{{ job.getLocation().getCity() }}
</div>
</div>
<div class="content">
<p>{{ job.getShortDescription()|striptags }}</p>
</div>
<div class="apply-now">
{{ elements.CTA('common.apply_now'|trans|upper, applyUrl, 'link') }}
</div>
</article>
{% endmacro %}
{% import _self as _ %}
{% if items|length > 0 %}
<section class="jobs-section {% if fullPage is defined %}full{% endif %}">
{% if fullPage is not defined %}
<div class="section-header">
{{ elements.heading('common.jobs'|trans|upper, 4, 'section-category') }}
{{ elements.heading('common.work_with_us'|trans, 2, 'section-title') }}
</div>
{% endif %}
<div class="list">
{% for item in items %}
{{ _.list_item(item) }}
{% else %}
{% if hideEmptyMessage is not defined %}
<p class="empty-message">{{ 'common.no_jobs'|trans }}</p>
{% endif %}
{% endfor %}
</div>
{% if fullPage is not defined %}
<div class="more">
{{ elements.CTA('common.more_jobs'|trans|upper, path('career_index'), 'secondary') }}
</div>
{% endif %}
</section>
{% endif %}