amuse.git

commit 7cbebeecf587907235b7e2ac91b7808b345083b4

Author: Adam <git@apiote.tk>

do not show skipped episodes in experiences

 db/db.go | 6 ++++--
 templates/experiences.html | 12 +++++++-----


diff --git a/db/db.go b/db/db.go
index 1be25d48da353068c41d0ce5e3f1aca5ba5a280b..1cfb126da492da2624b241c5a2835af7a10bf373 100644
--- a/db/db.go
+++ b/db/db.go
@@ -599,7 +599,7 @@ 		page = 1
 	}
 
 	var pages float64
-	row := db.QueryRow(`select count(*) from experiences where username = ?`, username)
+	row := db.QueryRow(`select count(*) from experiences where username = ? and time != '0001-01-01 00:00:00+00:00'`, username)
 	err = row.Scan(&pages)
 	if err != nil {
 		return experiences, err
@@ -634,7 +634,9 @@ 			fmt.Println("Scan error")
 			return datastructure.Experiences{}, err
 		}
 
-		experiences.List = append(experiences.List, entry)
+		if !entry.Datetime.IsZero() {
+			experiences.List = append(experiences.List, entry)
+		}
 	}
 
 	return experiences, nil




diff --git a/templates/experiences.html b/templates/experiences.html
index d3ea2366a76778ab610ad5f1a708307db59779ac..b5b07dce0f2cbf4aaf298ccc2a3602ab33dd423c 100644
--- a/templates/experiences.html
+++ b/templates/experiences.html
@@ -53,11 +53,15 @@ 					
 					{{end}}
 				</div>
 			</div>
-			<div class="flex flex-align-start">
+			<div class="flex flex-column w12 flex-align-start">
 				{{- $lastDate:="" -}}
 				{{- range .Data.List -}}
+					{{- if and (ne $lastDate ($.FormatDate .Datetime)) (ne $lastDate "")}}
+				</div>
+					{{end}}
+					{{- if not .Datetime.IsZero -}}
 					{{- if ne $lastDate ($.FormatDate .Datetime)}}
-				<div class="w12 margin-lr-5">
+				<div class="margin-lr-5">
 					<span class="sans">{{$.FormatDateNice .Datetime $.State.User.Timezone}}</span><hr class="margin-top-_25 margin-bottom-1"/>
 					{{- end}}
 					<p>
@@ -66,9 +70,7 @@ 						{{.Title}} ({{.YearStart}})
 						{{if eq .Type "tvserie"}}<span class="sans">{{.Code}}</span>{{end}}
 						{{- if gt .Collection 0 -}}<span class="sans">({{.Collection}} <!-- collection name and link --> #{{.Part}})</span>{{- end}}
 					</p>
-					{{- if and (ne $lastDate ($.FormatDate .Datetime)) (ne $lastDate "")}}
-				</div>
-					{{end}}
+					{{- end -}}
 					{{$lastDate = ($.FormatDate .Datetime) -}}
 				{{end}}
 				</div>