templates/common/components/jobs.html.twig line 1

Open in your IDE?
  1. {% import 'common/macros/elements.html.twig' as elements %}
  2. {% import 'common/macros/svg.html.twig' as svg %}
  3. {% macro list_item(job) %}
  4.     {% set applyUrl = job.getExternalApplyUrl() ?? path('career_show', { job: job.getSlug() }) %}
  5.     <article class="item" data-code="{{ job.getLocation()|lower }}">
  6.         {{ elements.heading('<a href="' ~ applyUrl ~ '">' ~ job.getName() ~ '</a>', 3, 'title') }}
  7.         <div class="details">
  8.             {% if job.getLevel() is not null %}
  9.                 <div class="job-level">
  10.                     <div class="icon">{{ elements.job_level_icon(job) }}</div>
  11.                     {{ ('job_level.' ~ job.getLevel())|trans({}, 'enum') }}
  12.                 </div>
  13.             {% endif %}
  14.             {% if job.workingHours() is not null %}
  15.                 <div class="job-hours">
  16.                     <div class="icon">{{ elements.job_workhour_icon(job) }}</div>
  17.                     {{ ('job_working_hours.' ~ job.getWorkingHours())|trans({}, 'enum') }}
  18.                 </div>
  19.             {% endif %}
  20.             <div class="location">
  21.                 {{ job.getLocation().getCity() }}
  22.             </div>
  23.         </div>
  24.         <div class="content">
  25.             <p>{{ job.getShortDescription()|striptags }}</p>
  26.         </div>
  27.         <div class="apply-now">
  28.             {{ elements.CTA('common.apply_now'|trans|upper, applyUrl, 'link') }}
  29.         </div>
  30.     </article>
  31. {% endmacro %}
  32. {% import _self as _ %}
  33. {% if items|length > 0 %}
  34.     <section class="jobs-section {% if fullPage is defined %}full{% endif %}">
  35.         {% if fullPage is not defined %}
  36.             <div class="section-header">
  37.                 {{ elements.heading('common.jobs'|trans|upper, 4, 'section-category') }}
  38.                 {{ elements.heading('common.work_with_us'|trans, 2, 'section-title') }}
  39.             </div>
  40.         {% endif %}
  41.         <div class="list">
  42.             {% for item in items %}
  43.                 {{ _.list_item(item) }}
  44.             {% else %}
  45.                 {% if hideEmptyMessage is not defined %}
  46.                     <p class="empty-message">{{ 'common.no_jobs'|trans }}</p>
  47.                 {% endif %}
  48.             {% endfor %}
  49.         </div>
  50.         {% if fullPage is not defined %}
  51.             <div class="more">
  52.                 {{ elements.CTA('common.more_jobs'|trans|upper, path('career_index'), 'secondary') }}
  53.             </div>
  54.         {% endif %}
  55.     </section>
  56. {% endif %}