Skip to content
Snippets Groups Projects
Commit a34e676a authored by alexisben's avatar alexisben
Browse files

organization layout

parent b68bcec3
No related branches found
No related tags found
No related merge requests found
Showing
with 101 additions and 164 deletions
......@@ -191,7 +191,6 @@ $hero-color: $color-text !default
$hero-background-color: $color-background-alt !default
// Breadcrumb
$breadcrumb-below-h1: false !default // NOT READY YET!
$breadcrumb-color: $hero-color !default
$breadcrumb-color-active: $hero-color !default
$breadcrumb-icon: "caret-right" !default
......
.block-organization_chart
article
position: relative
.name
@include h4
a
@include stretched-link
text-decoration: none
+ p
margin-top: half($spacing0)
@include in-page-with-sidebar
.persons
@include grid(1, sm)
@include grid(2, desktop)
article
flex-direction: row
align-items: start
.avatar
flex-shrink: 0
margin-right: $spacing1
width: calc(#{col(1, 4)} + #{$grid-gutter})
.description
flex: 1
margin-top: $spacing1
@include media-breakpoint-up(sm)
@include in-page-without-sidebar
.persons
@include grid(4, lg)
@include grid(6, xl)
article
text-align: center
.avatar
width: 100%
\ No newline at end of file
@include grid(6, xl)
\ No newline at end of file
......@@ -31,38 +31,39 @@
margin-bottom: $spacing1
order: -1
width: px2rem(76)
.name
margin-bottom: px2rem(5)
// & ~ p
// @include small
@include h4
a
@include stretched-link
text-decoration: none
+ p
margin-top: half($spacing0)
.description
@include small
@include media-breakpoint-down(desktop)
display: block
&::after
content: ''
clear: both
display: table
> div:first-of-type
float: left
max-width: calc(100% - 6rem)
@include media-breakpoint-down(md)
flex-direction: row
justify-content: space-between
.avatar
float: right
align-self: start
flex-shrink: 0
order: 2
margin-left: $spacing0
margin-bottom: 0
@include media-breakpoint-up(desktop)
@include in-page-without-sidebar
text-align: center
.avatar
width: 100%
section.persons,
div.persons
@include grid(1)
@include grid(2, md)
@include grid(3, lg)
@include grid(4, xl)
@include grid(5, xxl)
@include grid(5, xl)
@include grid(6, xxl)
ol.persons
ol.persons--list
@include list-reset
> li
border-bottom: 1px solid $color-border
......
......@@ -7,13 +7,16 @@ params:
breadcrumb:
position: hero-start # hero-start | hero-end | after-hero
posts:
list:
index:
show_categories: false
truncate_description: 200 # Set to 0 to disable truncate
layout: list # grid | list
pages:
list:
index:
truncate_description: 200 # Set to 0 to disable truncate
persons:
index:
layout: grid # grid | list
home:
toc:
disabled: true
......
......@@ -23,41 +23,40 @@
<div class="persons">
{{- range .persons -}}
{{ $person := site.GetPage (printf "/persons/%s" .slug) }}
<div>
<article class="person" itemscope itemtype="https://schema.org/Person">
<div class="description">
<h1 class="name" itemprop="name">
{{ if $with_link }}
<a href="{{ $person.Permalink }}" aria-label="{{ i18n "commons.more_aria" (dict "Title" $person.Title) }}">
{{ end }}
{{- partial "PrepareHTML" $person.Title -}}
{{ if $with_link }}
</a>
<article class="person" itemscope itemtype="https://schema.org/Person">
<div class="description">
<h1 class="name" itemprop="name">
{{ if $with_link }}
<a href="{{ $person.Permalink }}" aria-label="{{ i18n "commons.more_aria" (dict "Title" $person.Title) }}">
{{ end }}
</h1>
<p itemprop="jobTitle">
{{- if (partial "GetTextFromHTML" .role) }}
{{ partial "PrepareHTML" .role }}
{{- else if partial "GetTextFromHTML" $person.Params.summary }}
{{- partial "PrepareHTML" $person.Params.summary -}}
{{ else if (partial "GetTextFromHTML" $person.Content) }}
{{- partial "GetTruncateContent" ( dict "text" $person.Content ) -}}
{{ end -}}
</p>
{{- partial "PrepareHTML" $person.Title -}}
{{ if $with_link }}
</a>
{{ end }}
</h1>
<p itemprop="jobTitle">
{{- if (partial "GetTextFromHTML" .role) }}
{{ partial "PrepareHTML" .role }}
{{- else if partial "GetTextFromHTML" $person.Params.summary }}
{{- partial "PrepareHTML" $person.Params.summary -}}
{{ else if (partial "GetTextFromHTML" $person.Content) }}
{{- partial "GetTruncateContent" ( dict "text" $person.Content ) -}}
{{ end -}}
</p>
</div>
{{- if $with_photo }}
<div class="avatar" itemprop="image">
{{- if $person.Params.image }}
{{ partial "commons/image.html"
(dict
"image" $person.Params.image
"sizes" site.Params.image_sizes.blocks.organization_chart
)}}
{{ end -}}
</div>
{{- if $with_photo }}
<div class="avatar" itemprop="image">
{{- if $person.Params.image }}
{{ partial "commons/image.html"
(dict
"image" $person.Params.image
"sizes" site.Params.image_sizes.blocks.organization_chart
)}}
{{ end -}}
</div>
{{ end -}}
</article>
</div>
{{ end -}}
</article>
{{- end -}}
</div>
</div>
......
......@@ -40,10 +40,10 @@
{{- $page_class = partial "GetBodyclass" . }}
{{- $page_class = printf "block-%s" $page_class }}
{{ end }}
{{ if site.Params.pages.list.truncate_description }}
{{ if site.Params.pages.index.truncate_description }}
{{- $main_description = partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.pages.list.truncate_description
"length" site.Params.pages.index.truncate_description
) -}}
{{ else }}
{{- $main_description = partial "PrepareHTML" .Params.summary -}}
......
......@@ -17,10 +17,10 @@
</h1>
{{ if and $show_descriptions .Params.summary }}
{{ if site.Params.pages.list.truncate_description }}
{{ if site.Params.pages.index.truncate_description }}
<p>{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.pages.list.truncate_description
"length" site.Params.pages.index.truncate_description
) }}</p>
{{ else }}
<p>{{ partial "PrepareHTML" .Params.summary }}</p>
......
......@@ -25,10 +25,10 @@
</a>
</h1>
{{ if and $show_descriptions .Params.summary }}
{{ if site.Params.pages.list.truncate_description }}
{{ if site.Params.pages.index.truncate_description }}
<p>{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.pages.list.truncate_description
"length" site.Params.pages.index.truncate_description
) }}</p>
{{ else }}
<p>{{ partial "PrepareHTML" .Params.summary }}</p>
......
......@@ -18,14 +18,14 @@
<article class="post">
{{- $title := partial "PrepareHTML" .Title -}}
<h1 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h1>
{{ if site.Params.posts.list.show_categories }}
{{ if site.Params.posts.index.show_categories }}
{{- partial "posts/categories" . -}}
{{ end }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}}
{{ if site.Params.posts.list.truncate_description }}
{{ if site.Params.posts.index.truncate_description }}
<p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.posts.list.truncate_description
"length" site.Params.posts.index.truncate_description
) }}</p>
{{ else }}
<p itemprop="articleBody">{{ partial "PrepareHTML" .Params.summary }}</p>
......
<ol class="persons">
{{ range (.Paginate (.Pages.ByParam "last_name")).Pages }}
{{ if .Slug }}
{{ $slug := printf "/persons/%s" .Slug }}
{{ $person := site.GetPage $slug }}
{{ if $person }}
{{ with $person }}
{{ partial "persons/list-item" $person }}
{{ end }}
{{ end }}
{{ $persons := slice }}
{{ range (.Paginate (.Pages.ByParam "last_name")).Pages }}
{{ if .Slug }}
{{ $slug := printf "/persons/%s" .Slug }}
{{ $person := site.GetPage $slug }}
{{ if $person }}
{{ $persons = $persons | append $person }}
{{ end }}
{{ end }}
</ol>
{{ end }}
{{ partial "persons/list.html" (dict "persons" $persons) }}
{{ partial "commons/pagination.html" . }}
<ol class="persons">
{{ $persons := .Pages.ByParam "last_name" }}
{{ range (.Paginate $persons).Pages }}
{{ partial "persons/list-item" . }}
{{ end }}
</ol>
{{ partial "commons/pagination.html" . }}
{{ if eq site.Params.persons.index.layout "list" }}
<ol class="persons persons--list">
{{ range .persons }}
{{ partial "persons/list-item" . }}
{{ end }}
</ol>
{{ else if eq site.Params.persons.index.layout "grid" }}
<div class="persons">
{{ range .persons }}
{{ partial "persons/person" . }}
{{ end }}
</div>
{{ end }}
{{ $layout := site.Params.posts.list.layout | default "list" }}
{{ $layout := site.Params.posts.index.layout | default "list" }}
<div class="block-posts block-posts--{{- $layout -}}">
<div class="container">
<div class="block-content">
......
......@@ -2,14 +2,14 @@
<div class="post-content">
{{- $title := partial "PrepareHTML" .Title -}}
<h1 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h1>
{{ if $.Site.Params.posts.list.show_categories }}
{{ if $.Site.Params.posts.index.show_categories }}
{{- partial "posts/categories" . -}}
{{ end }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}}
{{ if $.Site.Params.posts.list.truncate_description }}
{{ if $.Site.Params.posts.index.truncate_description }}
<p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" $.Site.Params.posts.list.truncate_description
"length" $.Site.Params.posts.index.truncate_description
) }}</p>
{{ else }}
<p itemprop="articleBody">{{ partial "PrepareHTML" .Params.summary }}</p>
......
<div itemprop="articleBody">
{{- $params := .params -}}
{{- $contactsExist := or $params.contacts $params.roles -}}
{{- range .chapters -}}
{{- $content := index $params . -}}
{{- $chapterExists := $content -}}
{{ if eq "contacts" . }}
{{- $chapterExists = $contactsExist -}}
{{ end }}
{{- if $chapterExists }}
<section>
{{ $title := i18n (printf "programs._%s" .) -}}
<h2 id="page-{{ . }}">{{ $title }}</h2>
{{ if eq . "contacts" }}
{{- partial "programs/content.html" $content -}}
{{- partial "programs/roles.html" $params.roles -}}
{{ else if eq . "teachers" }}
{{- partial "programs/teachers.html"
(dict
"title" $title
"teachers" $params.teachers
"descriptions" $params.teachers_description
) -}}
{{ else }}
{{- partial "programs/content.html" $content -}}
{{ end }}
</section>
{{ end -}}
{{- end -}}
</div>
{{- range . }}
<h3>{{ .title }}</h3>
<div class="persons">
{{- range .persons -}}
{{ $slug := . }}
{{ with site.GetPage "persons" }}
{{ with .GetPage $slug }}
<div>
<div class="person">
<p class="name">
<a href="{{ .Permalink }}">{{ partial "PrepareHTML" .Title }}</a>
</p>
{{ if .Params.email }}
<p class="contact">
<a href="mailto:{{ .Params.email }}" rel="noreferrer" target="_blank">{{ .Params.email }}</a>
</p>
{{ end }}
{{ if .Params.phone }}
<p class="contact">
{{ safeHTML .Params.phone }}
</p>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end -}}
......@@ -33,7 +33,10 @@
<div class="container">
{{- if not $is_organigram_present -}}
{{ partial "persons/taxonomies.html" . }}
{{ partial "persons/list.html" . }}
{{ $persons := .Pages.ByParam "last_name" }}
{{ $persons = (.Paginate $persons).Pages }}
{{ partial "persons/list.html" (dict "persons" $persons) }}
{{ partial "commons/pagination.html" . }}
{{- end -}}
</div>
......
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