various updates

This commit is contained in:
Ben Goldsworthy 2023-06-30 21:16:59 -06:00
parent 4955708f0e
commit ee87009471
37 changed files with 1734 additions and 401 deletions

View file

@ -8,7 +8,8 @@
{{ define "header-scripts" }}
{{ if ( or ( eq .Type "cv" ) ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }}
<script type="text/javascript" src="/js/google-charts.js"></script>
{{ $googleChartsJS := resources.Get "js/google-charts.js" | fingerprint }}
<script id="Google-Charts-script" src="{{ $googleChartsJS.Permalink }}" integrity="{{ $googleChartsJS.Data.Integrity }}"></script>
{{ end }}
{{ end }}

View file

@ -43,20 +43,20 @@ L.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(t,i){this._lat
{{ .Scratch.Set "maxItems" 0 }}
{{ .Scratch.Set "numOfItems" 0 }}
{{ warnf "No of locations: %v" ( len $.Site.Data.locations ) }}
/* warnf "No of locations: %v" ( len $.Site.Data.locations ) */
{{ range $key, $value := $.Site.Data.locations }}
{{ $childPosts := where $.Site.Pages ".Params.locations" "intersect" ( slice $key ) }}
{{ warnf "Current location: %v" $key }}
{{ warnf "Child posts: %v" $childPosts }}
/* warnf "Current location: %v" $key */
/* warnf "Child posts: %v" $childPosts */
{{ .Scratch.Set "numOfItems" ( len $childPosts ) }}
{{ if ( gt ( .Scratch.Get "numOfItems" ) ( .Scratch.Get "maxItems" ) ) }}
{{ warnf "Updating maxItems" }}
/* warnf "Updating maxItems" */
{{ .Scratch.Set "maxItems" ( .Scratch.Get "numOfItems" ) }}
{{ warnf "New maxItems: %d" .Scratch.Get "maxItems" }}
/* warnf "New maxItems: %d" .Scratch.Get "maxItems" */
{{ end }}
{{ end }}
{{ warnf "maxItems: %v" ( .Scratch.Get "maxItems" ) }}
/* warnf "maxItems: %v" ( .Scratch.Get "maxItems" ) */
console.log({{ .Scratch.Get "maxItems" }});
L.heatLayer([

View file

@ -8,7 +8,8 @@
{{ define "header-scripts" }}
{{ if ( or ( eq .Type "cv" ) ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }}
<script type="text/javascript" src="/js/google-charts.js"></script>
{{ $googleChartsJS := resources.Get "js/google-charts.js" | fingerprint }}
<script id="Google-Charts-script" src="{{ $googleChartsJS.Permalink }}" integrity="{{ $googleChartsJS.Data.Integrity }}"></script>
{{ end }}
{{ end }}
@ -75,12 +76,12 @@
timeline: { showBarLabels: true }
};
chart.draw(dataTable, options);
chart.draw(dataTable, options);
}
</script>
{{ else }}
{{ $js := resources.Get "js/roles-chart.js" | resources.ExecuteAsTemplate "/js/render-roles-timeline.js" ( .GetPage "cv/roles" ) }}
<script type="text/javascript" src="{{ $js.RelPermalink }}"></script>
<script src="{{ $js.RelPermalink }}"></script>
{{ end }}
{{ end }}
@ -94,35 +95,38 @@
{{ end }}
{{ end }}>
<div class="article-header__title-wrapper{{ if .Params.title_in_logo }} article-header__title-wrapper--no-title{{ end }}">
<h1 class="article-header__title">{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</h1>
<h2 class="article-header__title">{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</h2>
</div>
</div>
</header>
{{ else }}
<header class="site-content__header">
<h1 class="page-title">{{ .Title | safeHTML }}.</h1>
<h2 class="page-title">{{ .Title | safeHTML }}.</h2>
{{ .Content }}
{{ if eq .Type "cv" }}
<nav class="page-header__minor-links">
<ul>
{{ range ( where .Sections "Type" "not in" ( slice "cv/roles" ) ).ByTitle }}
<li><a href="{{ .RelPermalink }}"><h2>{{ .Title }}</h2></a> <p>({{ len (where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) }})</p></li>
<li><a href="{{ .RelPermalink }}"><h3>{{ .Title }}</h3></a> <p>({{ len (where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) }})</p></li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ if eq .Type "cv" }}
<aside class="timeline__legend">
<label for="legend__past">Past</label>
<div id="legend__past">
<span><div class="colour-square colour-square--unpaid-past"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-past"></div> <p>Paid</p></span>
<div>
<label for="legend__past">Past</label>
<div id="legend__past">
<span><div class="colour-square colour-square--unpaid-past"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-past"></div> <p>Paid</p></span>
</div>
</div>
<br>
<label for="legend__current">Current</label>
<div id="legend__current">
<span><div class="colour-square colour-square--unpaid-current"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-current"></div> <p>Paid</p></span>
<div>
<label for="legend__current">Current</label>
<div id="legend__current">
<span><div class="colour-square colour-square--unpaid-current"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-current"></div> <p>Paid</p></span>
</div>
</div>
</aside>
{{ end }}
@ -146,16 +150,19 @@
<section id="roles-timeline">
<aside class="timeline__legend">
<label for="legend__past">Past</label>
<div id="legend__past">
<span><div class="colour-square colour-square--unpaid-past"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-past"></div> <p>Paid</p></span>
<div>
<label for="legend__past">Past</label>
<div id="legend__past">
<span><div class="colour-square colour-square--unpaid-past"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-past"></div> <p>Paid</p></span>
</div>
</div>
<br>
<label for="legend__current">Current</label>
<div id="legend__current">
<span><div class="colour-square colour-square--unpaid-current"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-current"></div> <p>Paid</p></span>
<div>
<label for="legend__current">Current</label>
<div id="legend__current">
<span><div class="colour-square colour-square--unpaid-current"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-current"></div> <p>Paid</p></span>
</div>
</div>
</aside>
<div id="timeline" aria-label="Role Time" role="img">Javascript must be enabled to view this chart.</div>
@ -219,7 +226,7 @@
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
<footer class="site-content__footer">
<section id="hierarchy">
<h2 class="subheading">Hierarchy</h2>
<h3 class="subheading">Hierarchy</h3>
{{ $.Scratch.Set "parents" ( slice ) }}
{{ partial "cv/organisations/recursive-parents.html" (dict "c" . "g" $ ) }}
{{- $parents := partial "reverse-slice.html" ( $.Scratch.Get "parents" ) -}}