Improved anime list rendering

This commit is contained in:
2017-07-05 15:00:58 +02:00
parent a94b69d671
commit 59daa5404e
7 changed files with 19 additions and 3 deletions

14
utils/ItemCSSClass.go Normal file
View File

@ -0,0 +1,14 @@
package utils
import (
"github.com/animenotifier/arn"
)
// ItemCSSClass removes mountable class if the list has too many items.
func ItemCSSClass(list *arn.AnimeList, index int) string {
if index > 20 || len(list.Items) > 50 {
return "anime-list-item"
}
return "anime-list-item mountable"
}