Filter own entries in calendar

This commit is contained in:
2017-12-03 19:08:05 +01:00
parent e1277fa734
commit 46e5eb1f33
5 changed files with 29 additions and 6 deletions

View File

@ -39,8 +39,13 @@ func Get(ctx *aero.Context) string {
for i := 0; i < 7; i++ {
days[i] = &utils.CalendarDay{
Name: weekdayNames[(weekdayIndex+i)%7],
Class: "weekday",
Entries: []*utils.CalendarEntry{},
}
if days[i].Name == "Saturday" || days[i].Name == "Sunday" {
days[i].Class += " weekend"
}
}
// Add anime episodes to the days
@ -66,14 +71,14 @@ func Get(ctx *aero.Context) string {
entry := &utils.CalendarEntry{
Anime: animeEpisodes.Anime(),
Episode: episode,
Class: "calendar-entry mountable",
Added: false,
}
if user != nil {
animeListItem := user.AnimeList().Find(entry.Anime.ID)
if animeListItem != nil && (animeListItem.Status == arn.AnimeListStatusWatching || animeListItem.Status == arn.AnimeListStatusPlanned) {
entry.Class += " calendar-entry-personal"
entry.Added = true
}
}