From 4f1178fc2a3e5865c2fb1c16c83fc1abb15484f9 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sat, 1 Jan 2022 19:43:19 -0700 Subject: crane, http, util: housekeeping, performance improvements, styling --- templates/list.html | 65 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 18 deletions(-) (limited to 'templates/list.html') diff --git a/templates/list.html b/templates/list.html index 52e7bb9..132bb6d 100644 --- a/templates/list.html +++ b/templates/list.html @@ -1,37 +1,66 @@ {{ define "list" }} -
+
{{ range $category, $papers := .Papers.List }} {{ $paperCount := len $papers }} {{ if ge $paperCount 1 }} -
- {{ $category }} -
+

+ +

{{ range $path, $paper := $papers }} -
    -
  • +
    {{ if $paper.Meta.Title }} - {{ $paper.Meta.Title }}
    + + {{ $paper.Meta.Title }} + +
    {{ else }} - {{ $paper.PaperName }}
    + + {{ $paper.PaperName }} + +
    {{ end }} - {{ $contCount := len $paper.Meta.Contributors }}{{ if ge $contCount 1 }} - {{ range $index, $contributor := $paper.Meta.Contributors }}{{if $index}}, {{end}}{{ $contributor.FirstName }} {{ $contributor.LastName }}{{end}}
    + {{ $contCount := len $paper.Meta.Contributors }} + {{ if ge $contCount 1 }} + + {{- range $index, $contributor := $paper.Meta.Contributors -}} + {{- if $index }}, {{ end -}} + {{- $contributor.FirstName }} {{ $contributor.LastName -}} + {{- end -}} + +
    {{ end }} {{ $hasVal := false }} - {{ if $paper.Meta.PubYear }}{{ $hasVal = true }}{{ $paper.Meta.PubYear }}{{ end }} + {{ if $paper.Meta.PubYear }} + {{ $hasVal = true }} + {{ $paper.Meta.PubYear }} + {{ end }} - {{ if $paper.Meta.DOI }}{{ if $hasVal }}- {{end}}{{ $paper.Meta.DOI }} + {{ if $paper.Meta.DOI }} + {{ if $hasVal }}- {{end}} + + {{ $paper.Meta.DOI }} + - {{ else if $paper.Meta.ArxivID }}{{ if $hasVal }}- {{ end }}{{ $paper.Meta.ArxivID }} - {{ else if $paper.Meta.Resource }}{{ if $hasVal }}- {{ end }}{{ $paper.Meta.Resource }}{{ end }} + {{ else if $paper.Meta.ArxivID }} + {{ if $hasVal }}- {{ end }} + + {{ $paper.Meta.ArxivID }} + + {{ else if $paper.Meta.Resource }} + {{ if $hasVal }}- {{ end }} + + {{ $paper.Meta.Resource }} + + {{ end }} - {{ if $paper.Meta.Journal }}{{ if $hasVal }}- {{ end }}{{ $paper.Meta.Journal }}{{ end }} -
  • -
+ {{ if $paper.Meta.Journal }} + {{ if $hasVal }}- {{ end }} + {{ $paper.Meta.Journal }} + {{ end }} +
{{ end }} -
{{ end }} {{ end }}
-- cgit v1.2.3-54-g00ecf