Skip to content
Snippets Groups Projects
Commit e119838f authored by Olivia206's avatar Olivia206
Browse files

fixed organization chart style with long summaries

parent d1c49010
No related branches found
No related tags found
No related merge requests found
const organizationsCharts = document.querySelectorAll('.block-organization_chart');
class OrganizationChart {
constructor (dom) {
this.dom = dom;
this.init();
this.listen();
}
init() {
this.content = this.dom.querySelector('.persons');
this.persons = this.content.querySelectorAll('.person');
this.classLongSummary = "is-column";
this.personWithLargeSummary = this.content.querySelector('[data-column="true"]')
if (!this.personWithLargeSummary) {
return;
}
}
listen() {
this.content.classList.add(this.classLongSummary);
}
}
organizationsCharts.forEach((dom) => {
new OrganizationChart(dom);
});
\ No newline at end of file
......@@ -5,5 +5,6 @@ import './design-system/mainMenu';
import './design-system/modal';
import './design-system/toc';
import './blocks/keyFigures';
import './blocks/organizationChart';
import './blocks/timeline';
import './blocks/partners';
......@@ -6,7 +6,20 @@
@include in-page-with-sidebar
.persons
@include grid(1, sm)
@include grid(2, desktop)
&:not(.is-column)
@include grid(2, desktop)
&.is-column
@include grid(2, xl)
@include media-breakpoint-between(desktop, xl)
.person
justify-content: space-between
.avatar
margin-right: 0
margin-left: $spacing1
order: 1
width: col(3)
.description
margin-top: 0
article
flex-direction: row
.avatar
......
{{- $template := .block.template -}}
{{- $position := .block.position -}}
{{- $title := .block.title -}}
{{- $charLimit := 30 -}}
{{- $isColumn := false -}}
{{- with .block.data -}}
{{- $with_link := .with_link -}}
{{- $with_photo := .with_photo -}}
<section class="block block-organization_chart{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}">
<div class="container">
<div class="block-content">
<section class="block block-organization_chart{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}">
<div class="container">
<div class="block-content">
{{ if (or $title .description) -}}
<div class="top">
{{- if not $title -}}
......@@ -24,6 +27,7 @@
<div class="persons">
{{- range .persons -}}
{{ $person := site.GetPage (printf "/persons/%s" .slug) }}
{{ $summaryLength := len $person.Params.summary}}
<article class="person" itemscope itemtype="https://schema.org/Person">
<div class="description">
<h3 class="name" itemprop="name">
......@@ -35,7 +39,7 @@
</a>
{{ end }}
</h3>
<p itemprop="jobTitle">
<p itemprop="jobTitle" {{- if ge $summaryLength $charLimit -}} data-column="true" {{- end -}}>
{{- if (partial "GetTextFromHTML" .role) }}
{{ partial "PrepareHTML" .role }}
{{- else if partial "GetTextFromHTML" $person.Params.summary }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment