Nice groups display, but still no group mgmt

This commit is contained in:
echarp 2023-02-06 21:53:39 +01:00
parent 0482e1bc65
commit 02261320cf
10 changed files with 166 additions and 152 deletions

View File

@ -21,7 +21,14 @@ frontmatter:
- :fileModTime - :fileModTime
- :default - :default
markup.goldmark.renderer.unsafe: true # To allow html
markup:
goldmark:
renderer:
unsafe: true
# Important to correctly update all related files upon modifications
disableFastRender: true
taxonomies: taxonomies:
group: groups group: groups

View File

@ -128,6 +128,7 @@ body.users .ac_choice input[type="radio"]:checked + label.text {
border-radius: 0.2em; border-radius: 0.2em;
} }
aside#actions input#cover,
aside#actions input#file { aside#actions input#file {
display: none; display: none;
} }

View File

@ -1,33 +1,32 @@
{{ define "main" }} {{ define "main" }}
<section class="pa3 pa4-ns nested-copy-line-height <article class="pa3 pa4-ns nested-copy-line-height no-text">
{{ if (le (.RelPermalink | strings.Count "/") 3) }}with-breadcrumb{{ end }}"> {{ with .Content }}
{{ with .Content }} <section id="content"
<section id="content" class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}"> {{- . -}}
{{- . -}} </section>
</section>
{{ end }}
{{ range .Pages }}
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
<article class="bb b--black-10 w-100 mb4 bg-white pa3-ns flex flex-column flex-row-ns relative">
{{ if $featured_image }}
<div class="mb4 mb0-ns w-100 w-40-ns {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl3-ns" "pr3-ns" }}">
<img src="{{ $featured_image }}" class="img" alt="image from {{ .Title }}">
</div>
{{ else }}
<a class="hero-pill fl w-10-ns bg-black" href="{{.RelPermalink}}"></a>
{{ end }} {{ end }}
<h1 class="f3 fw1 athelas lh-title mh3"> {{ range .Pages }}
{{ .Title }} {{ $featured_image := partial "func/GetFeaturedImage.html" . }}
</h1> <article class="bb b--black-10 w-100 mb4 bg-white pa3-ns flex flex-column flex-row-ns relative">
{{ if $featured_image }}
<div class="mb4 mb0-ns w-100 w-40-ns {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl3-ns" "pr3-ns" }}">
<img src="{{ $featured_image }}" class="img" alt="image from {{ .Title }}">
</div>
{{ range (.Paginate .RegularPagesRecursive).Pages }} {{ else }}
{{ .Title }} <a class="hero-pill fl w-10-ns bg-black" href="{{.RelPermalink}}"></a>
{{ end }}
<h1 class="f3 fw1 athelas lh-title mh3">
{{ .Title }}
</h1>
{{ range .RegularPagesRecursive }}
{{ .Title }}
{{ end }}
</article>
{{ end }} {{ end }}
</article> </article>
{{ end }}
</section>
{{ end }} {{ end }}

View File

@ -1,30 +1,30 @@
{{ define "main" }} {{ define "main" }}
<section class="pa3 pa4-ns nested-copy-line-height {{ $currentPage := . }}
{{ if (le (.RelPermalink | strings.Count "/") 3) }}with-breadcrumb{{ end }}">
<aside id="actions" class="w-30-l mt4-l fr tc"> <article class="pa3 pa4-ns nested-copy-line-height no-text
{{ if (le (.RelPermalink | strings.Count "/") 3) }}with-breadcrumb{{ end }}">
<aside class="w-third-l fr tc" id="actions">
{{ if .Parent.IsHome }} {{ if .Parent.IsHome }}
<button id="create" <button id="create"
class="br-pill f6 link dim br3 ph3 pv2 mb2 dib white bg-dark-gray pointer"> class="br-pill f6 link dim br3 ph3 pv2 mb2 dib white bg-dark-gray pointer">
{{ T (print .Section ".create") }} {{ T (print .Section ".create") }}
</button> </button>
{{ else if .Parent.Parent.IsHome }}
<button id="delete"
class="br-pill f6 link dim br3 ph3 pv2 mb2 dib white bg-dark-gray pointer"
data-confirm="{{ T (print .Section ".delete") }}?">
{{ T (print .Section ".delete") }}
</button>
{{ end }} {{ end }}
</aside> </aside>
{{ with .Content }} {{ with .Content }}
<section id="content" <section id="content"
class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}"> class="ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
{{- . -}} {{- . -}}
</section> </section>
{{ end }} {{ end }}
{{ range .Pages }} <section class="flex flex-column flex-row-ns flex-wrap">
{{ .Render "summary-with-image" }} {{ range .Pages }}
{{ end }} <div class="w-100 w-third-ns">
</section> {{ .Render "summary-with-image" }}
</div>
{{ end }}
</section>
</article>
{{ end }} {{ end }}

View File

@ -22,7 +22,7 @@
</section> </section>
{{ end }} {{ end }}
<section class="flex-ns flex-wrap justify-around"> <section class="flex-wrap">
{{ range .Pages.ByTitle }} {{ range .Pages.ByTitle }}
{{ .Render "summary-with-image" }} {{ .Render "summary-with-image" }}
{{ end }} {{ end }}

View File

@ -1,26 +1,21 @@
{{ $featured_image := partial "func/GetFeaturedImage.html" . }} {{ $featured_image := partial "func/GetFeaturedImage.html" . }}
<article class="relative w-100 bb b--black-10 db pv4 ph3 ph0-l no-underline dark-gray flex flex-column flex-row-ns"> <article class="ma1 pa2 bg-light-gray flex flex-column flex-row-ns relative">
{{ if $featured_image }} <div class="w-100 w-40-ns pr3-ns">
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} {{ if $featured_image }}
<div class="mb4 mb0-ns w-100 w-40-ns {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl3-ns" "pr3-ns" }}"> <a href="{{.RelPermalink}}" class="db grow">
<a href="{{.RelPermalink}}" class="db grow"> <img src="{{ $featured_image }}" class="img" alt="{{ .Title }}">
<img src="{{ $featured_image }}" class="img" alt="image from {{ .Title }}"> </a>
</a> {{ else }}
<a class="hero-pill db h-100 bg-black no-underline" href="{{.RelPermalink}}">&nbsp;</a>
{{ end }}
</div> </div>
{{ else }} <div class="blah w-100 w-60-ns">
<a class="hero-pill fl w-10-ns bg-black mr3" href="{{.RelPermalink}}"></a>
{{ end }}
<div class="blah w-100{{ if $featured_image }} w-60-ns{{ else }} w-90-ns{{ end }}">
<header> <header>
<time class="db f6 fr" datetime="{{ .Date }}"> <time class="f7 i fr" datetime="{{ .Date }}">
{{ .Date | time.Format .Site.Params.date_format }} {{ .Date | time.Format .Site.Params.date_format }}
</time> </time>
<ol class="breadcrumb nav navbar-nav">
{{ partial "breadcrumb" .Parent }}
</ol>
</header> </header>
<h1 class="f3 fw1 athelas mt0 lh-title"> <h1 class="f3 fw1 athelas mt0 lh-title">
@ -29,11 +24,8 @@
</a> </a>
</h1> </h1>
<p class="f6 f5-l lh-copy nested-copy-line-height nested-links summary"> <p class="f6 f5-l lh-copy nested-copy-line-height nested-links summary">
{{ .Summary }} {{ .Summary }}
</p> </p>
<a href="{{.RelPermalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">
{{ $.Param "read_more_copy" | default (i18n "readMore") | humanize }}
</a>
</div> </div>
{{ partial "ac_notation" .Parent }} {{ partial "ac_notation" .Parent }}

View File

@ -1,65 +1,72 @@
{{ define "main" }} {{ define "main" }}
{{ with .Site.GetPage (path.Join "groups" .Params.groups) }} {{ if .Params.groups }}
{{ with .Site.GetPage (path.Join "groups" .Params.groups) }}
<span class="group absolute top-1 right-1"> <span class="group absolute top-1 right-1">
{{ $featured_image := partial "func/GetFeaturedImage.html" . }} {{ $featured_image := partial "func/GetFeaturedImage.html" . }}
{{ if $featured_image }} {{ if $featured_image }}
<a href="{{.RelPermalink}}"> <a href="{{.RelPermalink}}">
<img src="{{ $featured_image }}" class="grow mw3 mw4-l" alt="{{ .Title }}"> <img src="{{ $featured_image }}" class="grow mw3 mw4-l" alt="{{ .Title }}"/>
</a> </a>
{{ else }} {{ else }}
<a class="hero-pill bg-black" href="{{.RelPermalink}}"> <a class="hero-pill bg-black" href="{{.RelPermalink}}">
{{- .Title -}} {{- .Title -}}
</a> </a>
{{ end }} {{ end }}
</span> </span>
{{ end }} {{ end }}
{{ end }}
<section class="pa3 pa4-ns nested-copy-line-height <article class="pa3 pa4-ns nested-copy-line-height no-text">
{{ if (le (.RelPermalink | strings.Count "/") 3) }}with-breadcrumb{{ end }}"> <aside id="actions" class="w-30-l mt4-l fr tc">
<aside id="actions" class="w-30-l mt4-l fr tc"> {{ if .Parent.IsHome }}
{{ if .Parent.IsHome }} <button id="create"
<button id="create" class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer">
class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer"> {{ T (print .Section ".create") }}
{{ T (print .Section ".create") }} </button>
</button>
{{ else if .Parent.Parent.IsHome }} {{ else if .Parent.Parent.IsHome }}
<label class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer" for="cover"> <label class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer" for="cover">
{{ T (print .Section ".cover") }} {{ T (print .Section ".cover") }}
</label> </label>
<input class="dn" id="cover" name="cover" type="file" data-section="{{ .Section }}"/> <input class="dn" id="cover" name="cover" type="file" data-section="{{ .Section }}"/>
<button id="delete" <button id="delete"
class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer" class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer"
data-confirm="{{ T (print .Section ".delete") }}?"> data-confirm="{{ T (print .Section ".delete") }}?">
{{ T (print .Section ".delete") }} {{ T (print .Section ".delete") }}
</button> </button>
<a href="mailto:?subject=invitation&body={{.Content | plainify}}" <a href="mailto:?subject=invitation&body={{.Content | plainify}}"
class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray" class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray"
id="invitation"> id="invitation">
{{ T (print .Section ".send") }} {{ T (print .Section ".send") }}
</a> </a>
<span id="barcode" /> <span id="barcode" />
{{ end }}
</aside>
{{ with .Content }}
<section id="content"
class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
{{- . -}}
</section>
{{ end }} {{ end }}
</aside>
<section class="flex no-text"> {{ with .Content }}
{{ range .Pages }} <section id="content"
<span class="w-third h8"> class="cf pa3 f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
{{ .Render "summary-with-image" }} {{- . -}}
</span>
{{ end }}
</section> </section>
{{ end }}
{{- template "_internal/pagination.html" . -}} <section class="flex flex-column flex-row-ns flex-wrap">
</section> {{ if .Parent.IsHome }}
{{ range .Pages }}
<span class="w-100 w-third-ns">
{{ .Render "summary-with-image" }}
</span>
{{ end }}
{{ else }}
{{ range .RegularPagesRecursive }}
<span class="w-100 w-third-ns with-breadcrumb">
{{ .Render "summary-with-image" }}
</span>
{{ end }}
{{ end }}
</section>
</article>
{{ end }} {{ end }}

View File

@ -1,26 +1,36 @@
{{ define "header" }} {{ define "header" }}
{{/* We can override any block in the baseof file be defining it in the template */}} {{/* We can override any block in the baseof file be defining it in the template */}}
{{ partial "page-header.html" . }} {{ partial "page-header.html" . }}
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
<article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}"> <article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
{{ .Content }} {{ .Content }}
</article> </article>
<dl class="links"> <dl class="links">
{{ range .Sections }} {{ range .Sections }}
<dt class="{{ .Section }}"> <dt class="{{ .Section }}">
<a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a> <a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a>
</dt> </dt>
<dd class="{{ .Section }}">{{ add (len .Pages) (len .Resources) }}</dd> <dd class="{{ .Section }}">{{ add (len .Pages) (len .Resources) }}</dd>
{{ end }} {{ end }}
{{ with site.GetPage "groups" }} {{ with site.GetPage "groups" }}
<dt> <dt>
<a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a> <a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a>
</dt> </dt>
<dd>{{ len site.Taxonomies.groups }}</dd> <dd>{{ len site.Taxonomies.groups }}</dd>
{{ end }}
</dl>
{{ with site.GetPage "users" }}
<section class="flex flex-column flex-row-ns flex-wrap">
{{ range .RegularPagesRecursive }}
<span class="w-100 w-third-ns with-breadcrumb no-text">
{{ .Render "summary-with-image" }}
</span>
{{ end }}
</section>
{{ end }} {{ end }}
</dl>
{{ end }} {{ end }}

View File

@ -1,6 +1,6 @@
{{ if gt .Params.ac_total 0 }} {{ if gt .Params.ac_total 0 }}
<span class="notation"> <span class="notation f7">
{{ sub .Params.ac_total .Params.ac_errors }} / {{ .Params.ac_total }} {{ sub .Params.ac_total .Params.ac_errors }} / {{ .Params.ac_total }}
</span> </span>
{{ end }} {{ end }}

View File

@ -1,9 +1,7 @@
{{ if and .Parent.IsSection (not .Parent.IsHome) }} {{ range .Ancestors.Reverse }}
{{ if and (not .IsHome) (not .Parent.IsHome) }}
{{ partial "breadcrumb.html" .Parent }} <li>
<a href="{{ .Permalink }}">{{- .Title -}}</a>
<li> </li>
<a href="{{ .Permalink }}">{{- .Title -}}</a> {{ end }}
</li>
{{ end }} {{ end }}