Improved editor log and anime page headers are linkable
This commit is contained in:
@ -25,10 +25,10 @@ component AnimeMainColumn(anime *arn.Anime, listItem *arn.AnimeListItem, tracks
|
||||
AnimeGenres(anime)
|
||||
AnimeActions(anime, listItem, user)
|
||||
|
||||
AnimeCharacters(anime)
|
||||
AnimeRelations(anime, user)
|
||||
AnimeTracks(anime, tracks)
|
||||
AnimeEpisodes(anime, episodes, user)
|
||||
AnimeCharacters(anime, user, false)
|
||||
AnimeRelations(anime, user, false)
|
||||
AnimeTracks(anime, tracks, user, false)
|
||||
AnimeEpisodes(anime, episodes, user, false)
|
||||
|
||||
component AnimeSideColumn(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User)
|
||||
AnimeTrailer(anime)
|
||||
@ -143,20 +143,6 @@ component AnimeGenres(anime *arn.Anime)
|
||||
a.anime-genre.mountable(href="/genre/" + strings.ToLower(genre), data-mountable-type="footer")
|
||||
span= genre
|
||||
|
||||
component AnimeRelations(anime *arn.Anime, user *arn.User)
|
||||
if anime.Relations() != nil && len(anime.Relations().Items) > 0
|
||||
section.anime-section.mountable
|
||||
h3.anime-section-name Relations
|
||||
.anime-relations
|
||||
each relation in anime.Relations().Items
|
||||
if relation.Anime() != nil
|
||||
a.anime-relation.mountable(href=relation.Anime().Link(), title=relation.Anime().Title.ByUser(user), data-mountable-type="relation")
|
||||
img.anime-relation-image.lazy(data-src=relation.Anime().ImageLink("small"), data-webp="true", data-color=relation.Anime().AverageColor(), alt=relation.Anime().Title.ByUser(user))
|
||||
.anime-relation-type= relation.HumanReadableType()
|
||||
.anime-relation-year
|
||||
if relation.Anime().StartDate != ""
|
||||
span= relation.Anime().StartDate[:4]
|
||||
|
||||
component AnimeTrailer(anime *arn.Anime)
|
||||
if len(anime.Trailers) > 0 && anime.Trailers[0].Service == "Youtube" && anime.Trailers[0].ServiceID != ""
|
||||
section.anime-section.mountable
|
||||
|
@ -3,6 +3,8 @@ package anime
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
@ -12,11 +14,12 @@ import (
|
||||
// Characters ...
|
||||
func Characters(ctx *aero.Context) string {
|
||||
id := ctx.Get("id")
|
||||
user := utils.GetUser(ctx)
|
||||
anime, err := arn.GetAnime(id)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "Anime not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.AnimeCharacters(anime))
|
||||
return ctx.HTML(components.AnimeCharacters(anime, user, true))
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
component AnimeCharacters(anime *arn.Anime)
|
||||
//- AnimeTabs(anime)
|
||||
component AnimeCharacters(anime *arn.Anime, user *arn.User, standAlonePage bool)
|
||||
if standAlonePage
|
||||
h1.mountable
|
||||
a(href=anime.Link())= anime.Title.ByUser(user)
|
||||
|
||||
if anime.Characters() != nil && len(anime.Characters().Items) > 0
|
||||
.anime-section
|
||||
h3.anime-section-name Characters
|
||||
.anime-section.mountable
|
||||
h3.anime-section-name
|
||||
a(href=anime.Characters().Link()) Characters
|
||||
|
||||
.characters
|
||||
each character in anime.Characters().Items
|
||||
if character.Role == "main" && character.Character() != nil
|
||||
if (character.Role == "main" || standAlonePage) && character.Character() != nil
|
||||
.mountable(data-mountable-type="character")
|
||||
Character(character.Character())
|
@ -21,5 +21,5 @@ func Episodes(ctx *aero.Context) string {
|
||||
return ctx.Error(http.StatusNotFound, "Anime not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.AnimeEpisodes(anime, anime.Episodes().Items, user))
|
||||
return ctx.HTML(components.AnimeEpisodes(anime, anime.Episodes().Items, user, true))
|
||||
}
|
||||
|
@ -1,7 +1,13 @@
|
||||
component AnimeEpisodes(anime *arn.Anime, episodes []*arn.AnimeEpisode, user *arn.User)
|
||||
component AnimeEpisodes(anime *arn.Anime, episodes []*arn.AnimeEpisode, user *arn.User, standAlonePage bool)
|
||||
if standAlonePage
|
||||
h1.mountable
|
||||
a(href=anime.Link())= anime.Title.ByUser(user)
|
||||
|
||||
if len(episodes) > 0
|
||||
.anime-section.mountable
|
||||
h3.anime-section-name Episodes
|
||||
h3.anime-section-name
|
||||
a(href=anime.Episodes().Link()) Episodes
|
||||
|
||||
.episodes
|
||||
each episode in episodes
|
||||
a.episode.mountable(href=anime.Link() + "/episode/" + strconv.Itoa(episode.Number), data-mountable-type="episode", data-available=episode.Available())
|
||||
|
24
pages/anime/relations.go
Normal file
24
pages/anime/relations.go
Normal file
@ -0,0 +1,24 @@
|
||||
package anime
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// Relations ...
|
||||
func Relations(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
id := ctx.Get("id")
|
||||
|
||||
anime, err := arn.GetAnime(id)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "Anime not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.AnimeRelations(anime, user, true))
|
||||
}
|
19
pages/anime/relations.pixy
Normal file
19
pages/anime/relations.pixy
Normal file
@ -0,0 +1,19 @@
|
||||
component AnimeRelations(anime *arn.Anime, user *arn.User, standAlonePage bool)
|
||||
if standAlonePage
|
||||
h1.mountable
|
||||
a(href=anime.Link())= anime.Title.ByUser(user)
|
||||
|
||||
if anime.Relations() != nil && len(anime.Relations().Items) > 0
|
||||
section.anime-section.mountable
|
||||
h3.anime-section-name
|
||||
a(href=anime.Relations().Link()) Relations
|
||||
|
||||
.anime-relations
|
||||
each relation in anime.Relations().Items
|
||||
if relation.Anime() != nil
|
||||
a.anime-relation.mountable(href=relation.Anime().Link(), title=relation.Anime().Title.ByUser(user), data-mountable-type="relation")
|
||||
img.anime-relation-image.lazy(data-src=relation.Anime().ImageLink("small"), data-webp="true", data-color=relation.Anime().AverageColor(), alt=relation.Anime().Title.ByUser(user))
|
||||
.anime-relation-type= relation.HumanReadableType()
|
||||
.anime-relation-year
|
||||
if relation.Anime().StartDate != ""
|
||||
span= relation.Anime().StartDate[:4]
|
@ -3,6 +3,8 @@ package anime
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
@ -12,6 +14,7 @@ import (
|
||||
// Tracks ...
|
||||
func Tracks(ctx *aero.Context) string {
|
||||
id := ctx.Get("id")
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
anime, err := arn.GetAnime(id)
|
||||
|
||||
@ -23,5 +26,5 @@ func Tracks(ctx *aero.Context) string {
|
||||
return !track.IsDraft && len(track.Media) > 0 && arn.Contains(track.Tags, "anime:"+anime.ID)
|
||||
})
|
||||
|
||||
return ctx.HTML(components.AnimeTracks(anime, tracks))
|
||||
return ctx.HTML(components.AnimeTracks(anime, tracks, user, true))
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
component AnimeTracks(anime *arn.Anime, tracks []*arn.SoundTrack)
|
||||
component AnimeTracks(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User, standAlonePage bool)
|
||||
if standAlonePage
|
||||
h1.mountable
|
||||
a(href=anime.Link())= anime.Title.ByUser(user)
|
||||
|
||||
if len(tracks) > 0
|
||||
.anime-section.mountable
|
||||
h3.anime-section-name Tracks
|
||||
h3.anime-section-name
|
||||
a(href="/anime/" + anime.ID + "/tracks") Tracks
|
||||
|
||||
.soundtracks.anime-soundtracks
|
||||
each track in tracks
|
||||
|
Reference in New Issue
Block a user