Commit a4d97426 authored by Ken Hawkins's avatar Ken Hawkins Committed by Ken Hawkins
Browse files

componentise facets


(cherry picked from commit 6a5e84aa)
parent 9c6a625d
Pipeline #73747 passed with stage
in 5 minutes and 6 seconds
{# Position location #}
{% set locations = {
'barcelona': 'Barcelona, Spain',
'grenoble': 'Grenoble, France',
'hamburg': 'Hamburg, Germany',
'heidelberg': 'Heidelberg, Germany',
'hinxton': 'EMBL-EBI Hinxton, UK',
'rome': 'Rome, Italy',
'EMBO': 'EMBO, Heidelberg, Germany'
} %}
<fieldset class="vf-form vf-form__fieldset">
<legend class="vf-form__legend">Position location</legend>
{% for key, name in locations | dictsort %}
{# count number of open positions #}
{% set counter = 0 %}
{%- for job in emblJobs %}
{% if key | makeLowercase in job.field_jobs_duty_station | makeLowercase %}
{% set counter = counter + 1 %}
{% endif -%}
{% endfor -%}
<div class="vf-form__item vf-form__item--checkbox">
<input type="checkbox" id="checkbox-{{ loop.index }}" class="vf-form__checkbox"
data-jplist-control="checkbox-text-filter" data-path=".jplist-duty-station" data-group="data-group-1" data-name="location2" data-or="locations"
data-id="location-{{ key }}"
value="{{ key }}"
>
<label for="checkbox-{{ loop.index }}" class="vf-form__label">{{ name }} ({{ counter }})</label>
</div>
{% endfor %}
</fieldset>
{# Position type #}
{% set positiontypes = {
'ADM': 'Administration',
'BIO': 'Bioinformatics',
'COM': 'Communication',
'DTC': 'Data Curation',
'GEN': 'General Support Services',
'ITS': 'IT and Infrastructure',
'POS': 'Postdoctoral Fellowships',
'PRE': 'Predoctoral Fellowships',
'RES': 'Research',
'FAC': 'Science Faculty',
'SSS': 'Scientific Services and Support',
'SDE': 'Software Development and Engineering',
'TEC': 'Technical Support',
'TRA': 'Trainee and Internships',
'TRN': 'Training',
'OTH': 'Other'
} %}
<fieldset class="vf-form vf-form__fieldset">
<legend class="vf-form__legend">Position type</legend>
{% for key, type in positiontypes | dictsort %}
{% set counter = 0 %}
{%- for job in emblJobs %}
{% if key | makeLowercase in job.field_jobs_type_key | makeLowercase %}
{% set counter = counter + 1 %}
{% endif -%}
{% endfor -%}
<div class="vf-form__item vf-form__item--checkbox">
<input type="checkbox" id="checkbox-position-{{ loop.index }}" class="vf-form__checkbox"
data-jplist-control="checkbox-text-filter" data-path=".jplist-job-type" data-group="data-group-1" data-name="type1" data-or="jobtype"
data-id="type-{{ key }}"
value="{{ key }}"
>
<label for="checkbox-position-{{ loop.index }}" class="vf-form__label">{{ type }} ({{ counter }})</label>
</div>
{% endfor %}
</fieldset>
\ No newline at end of file
......@@ -88,81 +88,13 @@ embl_content_meta_properties:
<section class="vf-grid">
<div>
<!-- locations -->
{% set locations = {
'barcelona': 'Barcelona, Spain',
'grenoble': 'Grenoble, France',
'hamburg': 'Hamburg, Germany',
'heidelberg': 'Heidelberg, Germany',
'hinxton': 'EMBL-EBI Hinxton, UK',
'rome': 'Rome, Italy',
'EMBO': 'EMBO, Heidelberg, Germany'
} %}
<fieldset class="vf-form vf-form__fieldset">
<legend class="vf-form__legend">Position location</legend>
{% for key, name in locations | dictsort %}
{# count number of open positions #}
{% set counter = 0 %}
{%- for job in emblJobs %}
{% if key | makeLowercase in job.field_jobs_duty_station | makeLowercase %}
{% set counter = counter + 1 %}
{% endif -%}
{% endfor -%}
<div class="vf-form__item vf-form__item--checkbox">
<input type="checkbox" id="checkbox-{{ loop.index }}" class="vf-form__checkbox"
data-jplist-control="checkbox-text-filter" data-path=".jplist-duty-station" data-group="data-group-1" data-name="location2" data-or="locations"
data-id="location-{{ key }}"
value="{{ key }}"
>
<label for="checkbox-{{ loop.index }}" class="vf-form__label">{{ name }} ({{ counter }})</label>
</div>
{% endfor %}
</fieldset>
{% include "filter/job-location.njk" %}
{# Position type #}
{% set positiontypes = {
'ADM': 'Administration',
'BIO': 'Bioinformatics',
'COM': 'Communication',
'DTC': 'Data Curation',
'GEN': 'General Support Services',
'ITS': 'IT and Infrastructure',
'POS': 'Postdoctoral Fellowships',
'PRE': 'Predoctoral Fellowships',
'RES': 'Research',
'FAC': 'Science Faculty',
'SSS': 'Scientific Services and Support',
'SDE': 'Software Development and Engineering',
'TEC': 'Technical Support',
'TRA': 'Trainee and Internships',
'TRN': 'Training',
'OTH': 'Other'
} %}
<fieldset class="vf-form vf-form__fieldset">
<legend class="vf-form__legend">Position type</legend>
{% for key, type in positiontypes | dictsort %}
<div class="vf-form__item vf-form__item--checkbox">
<input type="checkbox" id="checkbox-position-{{ loop.index }}" class="vf-form__checkbox"
data-jplist-control="checkbox-text-filter" data-path=".jplist-job-type" data-group="data-group-1" data-name="type1" data-or="jobtype"
data-id="type-{{ key }}"
value="{{ key }}"
>
<label for="checkbox-position-{{ loop.index }}" class="vf-form__label">{{ type }}</label>
</div>
{% endfor %}
</fieldset>
{% include "filter/job-type.njk" %}
<a
class="vf-button vf-button--sm vf-button--tertiary"
......@@ -180,12 +112,9 @@ embl_content_meta_properties:
</button> #}
</div>
<div class="vf-content | vf-grid__col--span-2">
<section data-jplist-group="data-group-1">
{%- for job in emblJobs %}
{# Show promoted "sticky" jobs #}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment