2022-11-11 05:48:02 +00:00
{{ define "title" }}
{{ .Page.Title | plainify }} | {{ .Site.Title }}
{{ end }}
{{ define "main-class" }}
2023-08-07 22:23:46 +00:00
{{- if .IsDescendant ( .GetPage "/cv/organisations" ) -}}--single{{- else -}}--section{{- end }} layouts-cv-section
2022-11-11 05:48:02 +00:00
{{ end }}
{{ define "header-scripts" }}
{{ if ( or ( eq .Type "cv" ) ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }}
2023-10-03 12:08:35 +00:00
< script id = "Google-Charts-script" src = "/js/google-charts.js" > < / script >
2022-11-11 05:48:02 +00:00
{{ end }}
{{ end }}
{{ define "footer-scripts" }}
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
{{ $titles := .Scratch.Get "titles" }}
< script >
google.charts.load('current', {'packages':['timeline']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
2023-10-03 12:08:35 +00:00
2022-11-11 05:48:02 +00:00
dataTable.addColumn({ type: 'string', id: 'Type' });
dataTable.addColumn({ type: 'string', id: 'Job Title' });
dataTable.addColumn({ type: 'string', id: 'style', role: 'style' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
2023-10-03 12:08:35 +00:00
dataTable.addRows([
2022-11-11 05:48:02 +00:00
{{- $unpaid_past := "#FFFFF0" -}}
{{- $paid_past := "#FCFCA6" -}}
{{- $unpaid_current := "#BBBBB0" -}}
{{- $paid_current := "#BCBC7E" -}}
{{ with ( .GetPage "cv/roles" ).Pages -}}
{{- range ( where . ".Params.organisations" "intersect" $titles ) -}}
2023-12-12 22:40:30 +00:00
{{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}}
2023-10-03 12:08:35 +00:00
[
2023-12-12 22:40:30 +00:00
"
{{- with .Params.organisations -}}
{{- $.Scratch.Set "parents" ( slice ) -}}
{{- range . -}}
{{- range ( where ( where $.Site.Pages "Type" "cv" ) "Title" . ) -}}
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
{{- $.Scratch.Set "parents" ( $.Scratch.Get "parents" | append "███████████████" ) -}}
{{- end -}}
{{- else -}}
{{- $.Scratch.Set "parents" ( $.Scratch.Get "parents" | append ( .Title | plainify ) ) -}}
{{- end -}}
{{- else -}}
{{ erroridf "missing-organisation" "Could not find organisation %q (%q)" . $.File.Path }}
{{- end -}}
{{- end -}}
{{- delimit ( $.Scratch.Get "parents" ) ", " -}}
{{- $.Scratch.Delete "parents" -}}
{{- end -}}
",
"
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
███████████████
{{- end -}}
{{- else -}}
{{- .Title | plainify -}}
{{- end -}}
",
2022-11-11 05:48:02 +00:00
"{{ if .Params.end_date -}}
{{- if .Params.paid -}}
{{- $paid_past -}}
{{- else -}}
{{- $unpaid_past -}}
{{- end -}}
{{- else -}}
{{- if .Params.paid -}}
{{- $paid_current -}}
{{- else -}}
{{- $unpaid_current -}}
{{- end -}}
{{- end }}",
2023-10-03 12:08:35 +00:00
new Date("{{ .Date.Format "2006-01-02" }}"),
2022-11-11 05:48:02 +00:00
new Date("
{{- if .Params.end_date -}}
{{- .Params.end_date -}}
{{- else -}}
{{- now.Format "2006-01-02" -}}
{{- end -}}
2023-10-03 12:08:35 +00:00
")
2022-11-11 05:48:02 +00:00
],
2023-12-12 22:40:30 +00:00
{{- end -}}
2022-11-11 05:48:02 +00:00
{{- end -}}
{{ end -}}
]);
2023-10-03 12:08:35 +00:00
2022-11-11 05:48:02 +00:00
var options = {
title: '{{ .Title | plainify }} Roles Timeline',
height: '100%',
chartArea: {
width: '94%'
},
width: '100%',
timeline: { showBarLabels: true }
};
2023-10-03 12:08:35 +00:00
2023-07-01 03:16:59 +00:00
chart.draw(dataTable, options);
2022-11-11 05:48:02 +00:00
}
< / script >
{{ else }}
2023-10-03 12:08:35 +00:00
{{ $js := resources.Get "js/roles-chart.js" | resources.ExecuteAsTemplate "/js/render-roles-timeline.js" ( .GetPage "cv/roles" ) | resources.Fingerprint }}
< script src = "{{ $js.RelPermalink }}" integrity = "{{ $js.Data.Integrity }}" > < / script >
2022-11-11 05:48:02 +00:00
{{ end }}
{{ end }}
{{ define "main-header" }}
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
2023-10-03 12:08:35 +00:00
< header class = "site-content__header" >
< div class = "article-header__featured-image"
{{ if .Params.featured_image }}
{{ with .Resources.GetMatch .Params.featured_image }}
style="background-image: url({{ .RelPermalink }})"
{{ end }}
{{ end }}>
2023-12-12 22:40:30 +00:00
< div class = "article-header__title-wrapper{{ if .Params.title_in_logo }} article-header__title-wrapper--no-title{{ end }}" >
< h2 class = "article-header__title" > {{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}< / h2 >
< / div >
2023-10-03 12:08:35 +00:00
< / div >
2023-12-12 22:40:30 +00:00
{{- with .Params.nka -}}< p > Now known as: {{ . }}< / p > {{- end -}}
{{- with .Params.fka -}}< p > Formerly known as: {{ . }}< / p > {{- end -}}
{{- with .Params.tka -}}< p > Then known as: {{ . }}< / p > {{- end -}}
2023-10-03 12:08:35 +00:00
< / header >
2022-11-11 05:48:02 +00:00
{{ else }}
< header class = "site-content__header" >
2023-10-03 12:08:35 +00:00
< h2 class = "page-title" > {{ .Title | safeHTML }}. {{ if not ( or ( eq .Type "cv" ) ( eq .Type "cv/organisations" ) ) -}}
{{- range .AlternativeOutputFormats -}}
< a href = "{{ .RelPermalink }}" aria-label = "{{ $.Title }} RSS feed" >
< img class = "feed-icon" alt = "RSS feed" src = "{{ $.Site.Params.feedIcon }}" >
< / a >
{{- end -}}
{{- end -}}
< / h2 >
{{- .Content -}}
{{- if ( and ( eq .Type "cv" ) ( not ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) ) -}}
< nav class = "page-header__minor-links" >
< ul >
{{ range ( where .Sections "Type" "not in" ( slice "cv/roles" ) ).ByTitle }}
< li > < a href = "{{ .RelPermalink }}" > < h3 > {{ .Title }}< / h3 > < / a > < p > ({{ len (where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) }})< / p > < / li >
{{ end }}
< / ul >
< / nav >
{{- partialCached "cv/timeline-legend.html" . -}}
{{- else -}}
< nav class = "page-header__minor-links" >
{{- partial "years-list.html" . -}}
< / nav >
{{- end -}}
2022-11-11 05:48:02 +00:00
< / header >
{{ end }}
{{ end }}
{{ define "main-body" }}
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
{{ $titles := slice ( .Title | plainify ) }}
{{ with .Sections }}
{{ $titles = $titles | append ( partial "cv/organisations/recursive-children-titles.html" . ) }}
{{ end }}
{{ .Scratch.Set "titles" $titles }}
2023-10-03 12:08:35 +00:00
2022-11-11 05:48:02 +00:00
< main id = "organisation-body" class = "site-content__body" >
< section id = "description" >
{{ .Content }}
< / section >
2023-10-03 12:08:35 +00:00
2022-11-11 05:48:02 +00:00
< section id = "roles-timeline" >
2023-10-03 12:08:35 +00:00
< div id = "timeline" aria-label = "Roles timeline" role = "img" > Javascript must be enabled to view this chart.< / div >
2022-11-11 05:48:02 +00:00
< / section >
2023-10-03 12:08:35 +00:00
2022-11-11 05:48:02 +00:00
< section id = "related" class = "row" >
{{- $titles := .Scratch.Get "titles" -}}
2023-10-03 12:08:35 +00:00
2023-12-12 22:40:30 +00:00
{{ range ( where ( ( .GetPage "blog" ).Sections ) "Title" "Blog Posts" ) }}
2022-11-11 05:48:02 +00:00
{{ $section_title := .Title }}
2023-12-12 22:40:30 +00:00
{{ with where ( where ( where ( where .Site.Pages "Section" "blog" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
2022-11-11 05:48:02 +00:00
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
2023-10-03 12:08:35 +00:00
2023-12-12 22:40:30 +00:00
{{ range ( where ( ( .GetPage "portfolio" ).Sections ) "Title" "!=" "Appearances" ).ByTitle }}
2022-11-11 05:48:02 +00:00
{{ $section_title := .Title }}
2023-12-12 22:40:30 +00:00
{{ with where ( where ( where ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
2022-11-11 05:48:02 +00:00
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
2023-10-03 12:08:35 +00:00
2023-12-12 22:40:30 +00:00
{{ range ( where ( ( .GetPage "cv" ).Sections ) "Title" "Qualifications" ) }}
2022-11-11 05:48:02 +00:00
{{ $section_title := .Title }}
2023-12-12 22:40:30 +00:00
{{ with where ( where ( where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
2022-11-11 05:48:02 +00:00
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
2023-10-03 12:08:35 +00:00
2023-12-12 22:40:30 +00:00
{{ range ( where ( (.GetPage "cv").Sections ) "Title" "Awards" ) }}
2022-11-11 05:48:02 +00:00
{{ $section_title := .Title }}
2023-12-12 22:40:30 +00:00
{{ with where ( where ( where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
2022-11-11 05:48:02 +00:00
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
2023-10-03 12:08:35 +00:00
2023-12-12 22:40:30 +00:00
{{ range ( where ( (.GetPage "portfolio").Sections ) "Title" "Appearances" ).ByTitle }}
2022-11-11 05:48:02 +00:00
{{ $section_title := .Title }}
2023-12-12 22:40:30 +00:00
{{ with where ( where ( where ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
2022-11-11 05:48:02 +00:00
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
< / section >
< / main >
2023-10-03 12:08:35 +00:00
{{ else if eq .Type "cv" }}
< article class = "site-content__body site-content__body--chart" >
< div id = "timeline" aria-label = "Roles timeline" role = "img" > Javascript must be enabled to view this chart.< / div >
< / article >
{{ else }}
{{ partial "items-grid.html" . }}
{{ end }}
2022-11-11 05:48:02 +00:00
{{ end }}
{{ define "main-footer" }}
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
< footer class = "site-content__footer" >
< section id = "hierarchy" >
2023-07-01 03:16:59 +00:00
< h3 class = "subheading" > Hierarchy< / h3 >
2022-11-11 05:48:02 +00:00
{{ $.Scratch.Set "parents" ( slice ) }}
2023-10-03 12:08:35 +00:00
{{ partial "cv/organisations/recursive-parents.html" ( dict "c" . "g" $ ) }}
2023-08-07 22:23:46 +00:00
{{- $parents := partial "cv/organisations/reverse-slice.html" ( $.Scratch.Get "parents" ) -}}
2023-10-03 12:08:35 +00:00
2022-11-11 05:48:02 +00:00
{{- range $parents -}}< ul > < li class = "hierarchy-item hierarchy-item--parent" > < a href = "{{ .RelPermalink }}" > {{ .Title | safeHTML }}< / a > {{- end -}}
< ul > < li class = "hierarchy-item hierarchy-item--current" > {{ .Title | safeHTML }}< / li >
{{ range .Sections }}< ul > {{ partial "cv/organisations/recursive-children.html" . }}< / ul > {{ end }}
< / ul >
{{- range $parents -}}< / li > < / ul > {{- end -}}
< / section >
< / footer >
{{ end }}
{{ end }}