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
- :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:
group: groups

View File

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

View File

@ -1,33 +1,32 @@
{{ define "main" }}
<section class="pa3 pa4-ns nested-copy-line-height
{{ if (le (.RelPermalink | strings.Count "/") 3) }}with-breadcrumb{{ end }}">
{{ 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 }}
{{ 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>
<article class="pa3 pa4-ns nested-copy-line-height no-text">
{{ 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 }}
<h1 class="f3 fw1 athelas lh-title mh3">
{{ .Title }}
</h1>
{{ 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>
{{ range (.Paginate .RegularPagesRecursive).Pages }}
{{ .Title }}
{{ else }}
<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 }}
</article>
{{ end }}
</section>
{{ end }}

View File

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

View File

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

View File

@ -1,26 +1,21 @@
{{ $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">
{{ if $featured_image }}
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
<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">
<img src="{{ $featured_image }}" class="img" alt="image from {{ .Title }}">
</a>
<article class="ma1 pa2 bg-light-gray flex flex-column flex-row-ns relative">
<div class="w-100 w-40-ns pr3-ns">
{{ if $featured_image }}
<a href="{{.RelPermalink}}" class="db grow">
<img src="{{ $featured_image }}" class="img" alt="{{ .Title }}">
</a>
{{ else }}
<a class="hero-pill db h-100 bg-black no-underline" href="{{.RelPermalink}}">&nbsp;</a>
{{ end }}
</div>
{{ else }}
<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 }}">
<div class="blah w-100 w-60-ns">
<header>
<time class="db f6 fr" datetime="{{ .Date }}">
<time class="f7 i fr" datetime="{{ .Date }}">
{{ .Date | time.Format .Site.Params.date_format }}
</time>
<ol class="breadcrumb nav navbar-nav">
{{ partial "breadcrumb" .Parent }}
</ol>
</header>
<h1 class="f3 fw1 athelas mt0 lh-title">
@ -29,11 +24,8 @@
</a>
</h1>
<p class="f6 f5-l lh-copy nested-copy-line-height nested-links summary">
{{ .Summary }}
{{ .Summary }}
</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>
{{ partial "ac_notation" .Parent }}

View File

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

View File

@ -1,26 +1,36 @@
{{ define "header" }}
{{/* We can override any block in the baseof file be defining it in the template */}}
{{ partial "page-header.html" . }}
{{ partial "page-header.html" . }}
{{ end }}
{{ 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" }}">
{{ .Content }}
</article>
<article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
{{ .Content }}
</article>
<dl class="links">
{{ range .Sections }}
<dt class="{{ .Section }}">
<a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a>
</dt>
<dd class="{{ .Section }}">{{ add (len .Pages) (len .Resources) }}</dd>
{{ end }}
<dl class="links">
{{ range .Sections }}
<dt class="{{ .Section }}">
<a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a>
</dt>
<dd class="{{ .Section }}">{{ add (len .Pages) (len .Resources) }}</dd>
{{ end }}
{{ with site.GetPage "groups" }}
<dt>
<a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a>
</dt>
<dd>{{ len site.Taxonomies.groups }}</dd>
{{ with site.GetPage "groups" }}
<dt>
<a href="{{ .RelPermalink }}" class="link grow">{{ .Title }}</a>
</dt>
<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 }}
</dl>
{{ end }}

View File

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

View File

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