use common *.baseof.html templates

This commit is contained in:
Ben Goldsworthy 2025-06-06 17:01:20 +02:00
parent 4e67efab84
commit af68a0e22d
No known key found for this signature in database
19 changed files with 486 additions and 408 deletions

View file

@ -11,68 +11,7 @@
{{ end }}
{{ define "footer-scripts" }}
{{ $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();
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' });
dataTable.addRows([
{{- with ( .GetPage "cv/roles" ).Pages -}}
{{- range ( where . ".Params.organisations" "intersect" $titles ) -}}
{{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}}
{{-
printf `["%s", "%s", "%s", %s, %s],`
(
partialCached
"cv/organisation/get_role_organisation_string.html"
( dict "sc" $ "pc" . )
.
)
(
partialCached
"cv/organisation/get_role_role_string.html"
( dict "sc" $ "pc" . )
.
)
(
partialCached
"cv/organisation/get_role_colour.html"
( dict "end_date" .Params.end_date "is_paid" .Params.paid )
.Params.end_date .Params.paid
)
( partialCached "cv/organisation/get_role_start_date.html" .Date .Date )
( partialCached "cv/organisation/get_role_end_date.html" .Params.end_date .Params.end_date )
| safeJS
-}}
{{- end -}}
{{- end -}}
{{ end -}}
]);
var options = {
title: '{{ .Title | plainify }} Roles Timeline',
height: '100%',
chartArea: {
width: '94%'
},
width: '100%',
timeline: { showBarLabels: true }
};
chart.draw(dataTable, options);
}
</script>
{{- partial "scripts/show_organisation_roles_in_timeline.js" ( dict "sc" $ "pc" . "organisation_titles" ( .Scratch.Get "titles" ) ) -}}
{{ end }}
{{ define "main-header" }}
@ -139,11 +78,25 @@
{{ partial "cv/organisations/recursive-parents.html" ( dict "c" . "g" $ ) }}
{{- $parents := partial "cv/organisations/reverse-slice.html" ( $.Scratch.Get "parents" ) -}}
{{- range $parents -}}<ul><li class="hierarchy-item hierarchy-item--parent"><a href="{{ .RelPermalink }}">{{ default .Title .Params.markup_title | .Page.RenderString }}</a>{{- end -}}
<ul><li class="hierarchy-item hierarchy-item--current">{{ default .Title .Params.markup_title | .Page.RenderString }}</li>
{{ range .Sections }}<ul>{{ partial "cv/organisations/recursive-children.html" . }}</ul>{{ end }}
</ul>
{{- range $parents -}}</li></ul>{{- end -}}
{{- range $parents -}}
<ul>
<li class="hierarchy-item hierarchy-item--parent">
<a href="{{- .RelPermalink -}}">
{{- default .Title .Params.markup_title | .Page.RenderString -}}
</a>
{{- end -}}
<ul>
<li class="hierarchy-item hierarchy-item--current">
{{- default .Title .Params.markup_title | .Page.RenderString -}}
</li>
{{- range .Sections -}}
<ul>{{- partial "cv/organisations/recursive-children.html" . -}}</ul>
{{- end -}}
</ul>
{{- range $parents -}}
</li>
</ul>
{{- end -}}
</section>
</footer>
{{ end }}