1+ {{/*
2+ Copyright © 2025 The Hinode Team / Mark Dumay. All rights reserved.
3+ Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
4+ Visit gethinode.com/license for more details.
5+ */}}
6+
7+ {{ $error := false }}
8+
9+ {{/* Initialize arguments */}}
10+ {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "team" "args" .)}}
11+ {{ if or $args.err $args.warnmsg }}
12+ {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
13+ "partial" "component-library/components/team/team.hugo.html"
14+ "warnid" "warn-invalid-arguments"
15+ "msg" "Invalid arguments"
16+ "details" ($args.errmsg | append $args.warnmsg)
17+ "file" page.File
18+ )}}
19+ {{ $error = $args.err }}
20+ {{ end }}
21+
22+ {{/* Initialize global arguments */}}
23+ {{- $padding := partial "utilities/GetPadding.html" -}}
24+
25+ {{/* Initialize local variables */}}
26+ {{ $pages := slice }}
27+ {{ $result := partial "assets/live-pages.html" (dict
28+ "page" $args.page
29+ "section" $args.input.section
30+ "nested" $args.input.nested
31+ "keywords" $args.input.keywords
32+ "categories" $args.input.categories
33+ "tags" $args.input.tags
34+ "sort" $args.input.sort
35+ "reverse" $args.input.reverse
36+ )}}
37+ {{ $pages = $result.pages }}
38+
39+ <!-- Define more button -->
40+ {{ $moreButton := site.Params.modules.bookshop.team.moreButton | default false }}
41+ {{ $moreTitle := T "more" (pluralize $args.input.section) }}
42+ {{ $moreLink := $args.input.section }}
43+ {{ $moreType := "button" }}
44+ {{ $moreIcon := "" }}
45+ {{ with $args.more }}
46+ {{ if .title }}{{ $moreTitle = .title }}{{ end }}
47+ {{ if .link }}{{ $moreLink = .link }}{{ end }}
48+ {{ if index . "link-type" }}{{ $moreType = index . "link-type" }}{{ end }}
49+ {{ if .icon }}{{ $moreIcon = .icon }}{{ end }}
50+ {{ end }}
51+
52+ {{ $paginate := $args.paginate }}
53+ {{ if and $paginate page.IsPage }}
54+ {{ partial "utilities/LogWarn.html" (dict
55+ "partial" "component-library/components/team/team.hugo.html"
56+ "msg" "Pagination not supported"
57+ "file" page.File
58+ )}}
59+ {{ $paginate = false }}
60+ {{ end }}
61+
62+ {{/* Main code */}}
63+ {{ if not $error }}
64+ {{ if or (gt (len $pages) 0) (not $args.hideEmpty) }}
65+ {{- partial "assets/section-title.html" (dict
66+ "heading" $args.heading
67+ "justify" $args.justify
68+ "class" (printf "pb-%d" $padding.y))
69+ -}}
70+
71+ {{ $partial := "assets/card-group.html" }}
72+ {{ $params := dict }}
73+ {{- $params = merge $params (dict
74+ "page" page
75+ "list" $pages
76+ "cols" $args.cols
77+ "limit" $args.limit
78+ "padding" $args.padding
79+ "href" (cond $moreButton $moreLink "")
80+ "href-force" (gt $result.total (len $result.pages))
81+ )}}
82+
83+ {{ $params = merge $params (dict
84+ "ratio" "1x1"
85+ "header-style" $args.headerStyle
86+ "body-style" $args.bodyStyle
87+ "footer-style" $args.footerStyle
88+ "class" (or $args.class "border-0")
89+ "align" "center"
90+ "orientation" $args.orientation
91+ "href-title" (cond $moreButton $moreTitle "")
92+ "icon-rounded" $args.iconRounded
93+ "icon-style" $args.iconStyle
94+ "hook" "assets/live-card.html"
95+ "more-link-type" $moreType
96+ "more-link-icon" $moreIcon
97+ "pagination" $args.pagination
98+ "paginate" $paginate
99+ ) -}}
100+ {{ if gt (len $pages) 0 }}
101+ {{ partial $partial $params }}
102+ {{ else }}
103+ < p class ="pt-{{ $padding.y }} "> {{- T "emptyList" }}.</ p >
104+ {{ end }}
105+ {{ end }}
106+ {{ end }}
0 commit comments