2017-11-22 10:51:59 +00:00
component Calendar(days []*utils.CalendarDay, user *arn.User)
2017-11-22 11:39:36 +00:00
h1.mountable Calendar
2017-11-22 10:51:59 +00:00
2018-03-12 00:27:33 +00:00
.corner-buttons
2019-03-02 21:16:24 +00:00
if user != nil
button.action(data-trigger="click", data-action="calendarShowAddedAnimeOnly", data-api="/api/settings/" + user.ID, title="Show anime in my collection")
2019-03-03 16:45:44 +00:00
RawIcon("eye-slash")
2017-12-03 18:08:05 +00:00
2019-04-27 11:23:15 +00:00
if user != nil
#calendar(data-show-added-anime-only=user.Settings().Calendar.ShowAddedAnimeOnly)
CalendarWeek(days, user)
else
#calendar
CalendarWeek(days, user)
component CalendarWeek(days []*utils.CalendarDay, user *arn.User)
2017-11-22 10:51:59 +00:00
.week
each day in days
2017-12-03 18:08:05 +00:00
div(class=day.Class)
2017-11-22 11:39:36 +00:00
h3.weekday-name.mountable(data-mountable-type=day.Name)= day.Name
2019-04-27 11:23:15 +00:00
if user == nil
.calendar-entries
each entry in day.Entries
CalendarEntry(day, entry, user)
else
.calendar-entries
each entry in day.Entries
CalendarEntry(day, entry, user)
2019-03-02 21:16:24 +00:00
component CalendarEntry(day *utils.CalendarDay, entry *utils.CalendarEntry, user *arn.User)
2019-04-27 11:23:15 +00:00
a.calendar-entry.mountable(href=entry.Anime.Link(), data-mountable-type=day.Name, data-added=entry.Added)
CalendarView(day, entry, user)
2019-03-03 16:45:44 +00:00
component CalendarView(day *utils.CalendarDay, entry *utils.CalendarEntry, user *arn.User)
img.calendar-entry-image.lazy(data-src=entry.Anime.ImageLink("small"), data-webp="true", data-color=entry.Anime.AverageColor(), alt=entry.Anime.Title.ByUser(user))
.calendar-entry-info
.calendar-entry-title= entry.Anime.Title.ByUser(user)
.calendar-entry-time-and-episode
.calendar-entry-time.utc-date-absolute(data-date=entry.Episode.AiringDate.Start)
.calendar-entry-episode= "Ep: " + strconv.Itoa(entry.Episode.Number)