Episode restrictions
This commit is contained in:
parent
cd9dfd85e1
commit
96b1e2d6d2
@ -28,7 +28,7 @@ component AnimeMainColumn(anime *arn.Anime, tracks []*arn.SoundTrack, episodes [
|
||||
AnimeCharacters(anime)
|
||||
AnimeRelations(anime, user)
|
||||
AnimeTracks(anime, tracks)
|
||||
AnimeEpisodes(episodes)
|
||||
AnimeEpisodes(episodes, user)
|
||||
|
||||
component AnimeSideColumn(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User)
|
||||
AnimeTrailer(anime)
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
@ -11,6 +12,7 @@ import (
|
||||
|
||||
// Episodes ...
|
||||
func Episodes(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
id := ctx.Get("id")
|
||||
|
||||
anime, err := arn.GetAnime(id)
|
||||
@ -19,5 +21,5 @@ func Episodes(ctx *aero.Context) string {
|
||||
return ctx.Error(http.StatusNotFound, "Anime not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.AnimeEpisodes(anime.Episodes().Items))
|
||||
return ctx.HTML(components.AnimeEpisodes(anime.Episodes().Items, user))
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
component AnimeEpisodes(episodes []*arn.AnimeEpisode)
|
||||
component AnimeEpisodes(episodes []*arn.AnimeEpisode, user *arn.User)
|
||||
if len(episodes) > 0
|
||||
.anime-section.mountable
|
||||
h3.anime-section-name Episodes
|
||||
@ -14,12 +14,13 @@ component AnimeEpisodes(episodes []*arn.AnimeEpisode)
|
||||
Japanese(episode.Title.Japanese)
|
||||
else
|
||||
span -
|
||||
td.episode-actions
|
||||
for name, link := range episode.Links
|
||||
a(href=link, target="_blank", rel="noopener", title="Watch episode " + toString(episode.Number) + " on " + name)
|
||||
RawIcon("eye")
|
||||
//- a(href="https://translate.google.com/#ja/en/" + episode.Title.Japanese, target="_blank", rel="noopener")
|
||||
//- RawIcon("google")
|
||||
if user != nil && user.Location.CountryName != "Japan"
|
||||
td.episode-actions
|
||||
for name, link := range episode.Links
|
||||
a(href=link, target="_blank", rel="noopener", title="Watch episode " + toString(episode.Number) + " on " + name)
|
||||
RawIcon("eye")
|
||||
//- a(href="https://translate.google.com/#ja/en/" + episode.Title.Japanese, target="_blank", rel="noopener")
|
||||
//- RawIcon("google")
|
||||
if validator.IsValidDate(episode.AiringDate.Start)
|
||||
td.episode-airing-date-start.utc-airing-date(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman()
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user