From 93685ba170c63c6509314a72d83e3d2096ed5ab7 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 9 Mar 2021 11:03:01 -0700 Subject: support arxiv, parsing improvements --- templates/admin-edit.html | 14 ++++++++++++-- templates/list.html | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/admin-edit.html b/templates/admin-edit.html index 4192af0..57a9aaa 100644 --- a/templates/admin-edit.html +++ b/templates/admin-edit.html @@ -58,10 +58,20 @@
{{ end }} - {{ if $paper.Meta.Title }} + {{ $contCount := len $paper.Meta.Contributors }}{{ if ge $contCount 1 }} {{ range $index, $contributor := $paper.Meta.Contributors }}{{if $index}}, {{end}}{{ $contributor.FirstName }} {{ $contributor.LastName }}{{end}}
- {{ $paper.Meta.PubYear }} - {{ $paper.Meta.DOI }} - {{ $paper.Meta.Journal }} {{ end }} + + {{ $hasVal := false }} + {{ if $paper.Meta.PubYear }}{{ $hasVal = true }}{{ $paper.Meta.PubYear }}{{ end }} + + {{ 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 }} + + {{ if $paper.Meta.Journal }}{{ if $hasVal }}- {{ end }}{{ $paper.Meta.Journal }}{{ end }} + {{ end }} {{ end }} diff --git a/templates/list.html b/templates/list.html index 8f6382d..9e139b9 100644 --- a/templates/list.html +++ b/templates/list.html @@ -14,10 +14,20 @@ {{ $paper.PaperName }}
{{ end }} - {{ if $paper.Meta.Title }} + {{ $contCount := len $paper.Meta.Contributors }}{{ if ge $contCount 1 }} {{ range $index, $contributor := $paper.Meta.Contributors }}{{if $index}}, {{end}}{{ $contributor.FirstName }} {{ $contributor.LastName }}{{end}}
- {{ $paper.Meta.PubYear }} - {{ $paper.Meta.DOI }} - {{ $paper.Meta.Journal }} {{ end }} + + {{ $hasVal := false }} + {{ if $paper.Meta.PubYear }}{{ $hasVal = true }}{{ $paper.Meta.PubYear }}{{ end }} + + {{ 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 }} + + {{ if $paper.Meta.Journal }}{{ if $hasVal }}- {{ end }}{{ $paper.Meta.Journal }}{{ end }} + {{ end }} {{ end }} -- cgit v1.2.3-54-g00ecf