Skip to content

Commit

Permalink
Merge pull request #360 from City-of-Helsinki/UHF-9132
Browse files Browse the repository at this point in the history
UHF-9132: Add max-width limitation to all content types without sidebar except landing page
  • Loading branch information
teroelonen authored Dec 1, 2023
2 parents 0f32803 + a26cdfc commit aeb7bd4
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 85 deletions.
2 changes: 1 addition & 1 deletion public/themes/custom/hdbt_subtheme/dist/css/styles.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/themes/custom/hdbt_subtheme/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@
}
}

.job-listing__link {
.job-listing__item {
@include component-side-padding;
}

.job-listing__link-wrapper {
margin-top: $spacing;
width: 100%;

@include breakpoint($breakpoint-m) {
margin-top: $spacing-and-half;
width: auto;
}

&:last-of-type {
&.job-listing__link-wrapper--last {
margin-top: $spacing-double;

@include breakpoint($breakpoint-m) {
Expand All @@ -45,6 +47,14 @@
}
}

.job-listing__link {
width: 100%;

@include breakpoint($breakpoint-m) {
width: auto;
}
}


.job-listing__job-description {
@include font(body);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="job-listing__organization-name">
{% for item in items %}
<span {{ item.attributes.addClass('organization') }}>
{{ item.content }}
</span>
{% endfor %}
</div>
{% for item in items %}
<span {{ item.attributes.addClass('organization') }}>
{{ item.content }}
</span>
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<div class="job-listing__salary-class">
<h2 class="job-listing__salary-class__title">{{ 'Contract area'|t }}</h2>
<div class="job-listing__salary-class__content">
{% for item in items %}
<p {{ item.attributes }}>{{ item.content }}</p>
{% endfor %}
</div>
<h2 class="job-listing__salary-class__title">{{ 'Contract area'|t }}</h2>
<div class="job-listing__salary-class__content">
{% for item in items %}
<p {{ item.attributes }}>{{ item.content }}</p>
{% endfor %}
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,51 +1,8 @@
{#
/**
* @file
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
* @see template_preprocess_field()
* Triggers on all job listing field that is not overriden with a template
* so that we are able to give the field language parameter (check field-content.html.twig).
*/
#}
{%
set title_classes = [
'label',
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}

{% if label_hidden %}
{% include '@hdbt_subtheme/field/field-content.html.twig'%}
{% else %}
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}: </div>
{% include '@hdbt_subtheme/field/field-content.html.twig'%}
{% endif %}
{% include '@hdbt_subtheme/field/field-content.html.twig'%}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
{{ link(label, node_url, link_attributes) }}
</h3>
{% if content.field_employment_type|render or content.field_employment|render %}
{% embed '@hdbt/misc/tag-list.twig' with { type: 'static' }%}
{% embed '@hdbt/misc/tag-list.twig' with { type: 'static', tag_container_class: 'content-tags--card' }%}
{% block content %}
{% if content.field_employment_type|render %}
{% include '@hdbt/misc/tag.twig' with {
Expand All @@ -102,7 +102,9 @@
{% endblock content %}
{% endembed %}
{% endif %}
{{ content.field_organization_name }}
<div class="job-listing__organization-name">
{{ content.field_organization_name }}
</div>
<div class="job-listing__metadata job-listing__metadata--application-ends">
<span class="job-listing__metadata__label">{% include '@hdbt/misc/icon.twig' with {icon: 'clock'} only %}{{ 'Application period ends'|t }}</span>
<span class="job-listing__metadata__content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,18 @@
{% endblock content %}
{% endembed %}
{% endif %}
{{ content.field_organization_name }}
{{ content.field_link_to_application }}

{% if content.field_organization_name|render %}
<div class="job-listing__organization-name job-listing__item">
{{ content.field_organization_name }}
</div>
{% endif %}

{% if content.field_link_to_application|render %}
<div class="job-listing__link-wrapper job-listing__item">
{{ content.field_link_to_application }}
</div>
{% endif %}

{% if publication_starts_today == true %}
{% set publication_starts = 'today'|t %}
Expand All @@ -144,31 +154,50 @@
{ label: 'Job code'|t, icon: 'locate', content: content.field_recruitment_id },
] %}

<div class="job-listing__metadata-wrapper">
<div class="job-listing__metadata-wrapper job-listing__item">
{% include '@hdbt/misc/metadata-wrapper.twig' with { items: metadata }%}
</div>

{% if content.field_job_description_override|render %}
{{ content.field_job_description_override }}
{% else %}
{{ content.job_description }}
<div class="job-listing__job-description job-listing__item user-edited-content">
{{ content.field_job_description_override }}
</div>
{% elseif content.job_description|render %}
<div class="job-listing__job-description job-listing__item user-edited-content">
{{ content.job_description }}
</div>
{% endif %}
{{ content.field_salary_class }}

{% if content.field_salary_class|render %}
<div class="job-listing__salary-class job-listing__item">
{{ content.field_salary_class }}
</div>
{% endif %}

{% if content.field_contacts|render or content.field_link_to_presentation|render %}
<div class="job-listing__additional-information">
<div class="job-listing__additional-information job-listing__item">
<h2 class="job-listing__additional-information__title">{{ 'Additional information'|t }}</h2>
<div class="job-listing__additional-information__content user-edited-content">
{{ content.field_contacts }}
{{ content.field_link_to_presentation }}
</div>
</div>
{% endif %}

{% if content.field_video|render %}
{% include '@hdbt/component/remote-video.twig' with {
video: content.field_video,
}%}
<div class="job-listing__video job-listing__item">
{% include '@hdbt/component/remote-video.twig' with {
video: content.field_video,
}%}
</div>
{% endif %}
{{ content.field_link_to_application }}

{% if content.field_link_to_application|render %}
<div class="job-listing__link-wrapper job-listing__link-wrapper--last job-listing__item">
{{ content.field_link_to_application }}
</div>
{% endif %}

{{ drupal_block('helfi_platform_config_social_sharing_block') }}
{% endblock component_content %}
{% endembed %}
Expand Down

0 comments on commit aeb7bd4

Please sign in to comment.