From e171731d627e133ea7a4b337de9807fcf6af51b8 Mon Sep 17 00:00:00 2001 From: Meutel Date: Mon, 31 Jul 2017 20:14:38 +0200 Subject: [PATCH] Refactoring templates --- templates/index.html | 77 +++--------------------------------- templates/index_authors.html | 18 +++++++++ templates/index_books.html | 29 ++++++++++++++ templates/index_series.html | 25 ++++++++++++ 4 files changed, 77 insertions(+), 72 deletions(-) create mode 100644 templates/index_authors.html create mode 100644 templates/index_books.html create mode 100644 templates/index_series.html diff --git a/templates/index.html b/templates/index.html index 2c807a2..57e300e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,81 +16,14 @@ {{ end }} - {{ if .Series }} - - - - - - - - {{ range .Series }} - - - - {{ end }} - -
- Nom - - Livre(s)Auteur(s)
- - {{ .Name }} - {{ .Count }} - {{ range .Authors }} - - {{ .Name }}  - {{ end }} -
+ {{ if ne (len .Series) 0 }} + {{ template "index_series.html" .Series }} {{ end }} - {{ if .Authors }} - - - - - - - - - -
- Nom - - Livre(s)
- - {{ .Author.Name }} - {{ .Author.Count }}
+ {{ if ne (len .Authors) 0 }} + {{ template "index_authors.html" .Authors }} {{ end }} {{ if ne (len .Books) 0 }} - - - - - - - {{ range .Books }} - - - - - - {{ end }} -
- Nom - - Auteur(s)Serie
- {{ .Title }} - {{ range .Authors }} - - {{ .Name }} - {{ end }} - - {{ if .Series }} - - {{ .Series.Name }} - {{ .Book.SeriesIndex }} - {{ end }} -
+ {{ template "index_books.html" .Books }} {{ end }} {{ if (ne (len .Books) 0) or (ne (len .Authors) 0) or (ne (len .Series) 0) }}