Added anime comments
This commit is contained in:
parent
3ad4faf38a
commit
5866683811
@ -30,6 +30,7 @@ component AnimeMainColumn(anime *arn.Anime, listItem *arn.AnimeListItem, tracks
|
|||||||
AnimeTracks(anime, tracks, user, false)
|
AnimeTracks(anime, tracks, user, false)
|
||||||
AnimeAMVs(anime, amvs, amvAppearances, user)
|
AnimeAMVs(anime, amvs, amvAppearances, user)
|
||||||
AnimeEpisodes(anime, episodes, user, false)
|
AnimeEpisodes(anime, episodes, user, false)
|
||||||
|
AnimeComments(anime, user, false)
|
||||||
|
|
||||||
component AnimeSideColumn(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User)
|
component AnimeSideColumn(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User)
|
||||||
AnimeTrailer(anime)
|
AnimeTrailer(anime)
|
||||||
|
24
pages/anime/comments.go
Normal file
24
pages/anime/comments.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package anime
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/animenotifier/notify.moe/components"
|
||||||
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
|
|
||||||
|
"github.com/aerogo/aero"
|
||||||
|
"github.com/animenotifier/arn"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Comments ...
|
||||||
|
func Comments(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.AnimeComments(anime, user, true))
|
||||||
|
}
|
12
pages/anime/comments.pixy
Normal file
12
pages/anime/comments.pixy
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
component AnimeComments(anime *arn.Anime, user *arn.User, standAlonePage bool)
|
||||||
|
if standAlonePage
|
||||||
|
h1.mountable
|
||||||
|
a(href=anime.Link())= anime.Title.ByUser(user)
|
||||||
|
|
||||||
|
section.anime-section.mountable
|
||||||
|
if !standAlonePage
|
||||||
|
h3.anime-section-name
|
||||||
|
a(href=anime.Link() + "/comments") Comments
|
||||||
|
|
||||||
|
.anime-comments(data-standalone-page=standAlonePage)
|
||||||
|
Comments(anime, user)
|
7
pages/anime/comments.scarlet
Normal file
7
pages/anime/comments.scarlet
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.anime-comments
|
||||||
|
[data-standalone-page="false"]
|
||||||
|
margin-top 1rem
|
||||||
|
|
||||||
|
.thread
|
||||||
|
max-width 600px
|
||||||
|
justify-content flex-start
|
@ -14,7 +14,6 @@ import (
|
|||||||
func Episodes(ctx *aero.Context) string {
|
func Episodes(ctx *aero.Context) string {
|
||||||
user := utils.GetUser(ctx)
|
user := utils.GetUser(ctx)
|
||||||
id := ctx.Get("id")
|
id := ctx.Get("id")
|
||||||
|
|
||||||
anime, err := arn.GetAnime(id)
|
anime, err := arn.GetAnime(id)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -17,6 +17,7 @@ func Register(l *layout.Layout) {
|
|||||||
l.Page("/anime/:id/characters", anime.Characters)
|
l.Page("/anime/:id/characters", anime.Characters)
|
||||||
l.Page("/anime/:id/tracks", anime.Tracks)
|
l.Page("/anime/:id/tracks", anime.Tracks)
|
||||||
l.Page("/anime/:id/relations", anime.Relations)
|
l.Page("/anime/:id/relations", anime.Relations)
|
||||||
|
l.Page("/anime/:id/comments", anime.Comments)
|
||||||
l.Page("/anime/:id/episode/:episode-number", episode.Get)
|
l.Page("/anime/:id/episode/:episode-number", episode.Get)
|
||||||
|
|
||||||
// Anime redirects
|
// Anime redirects
|
||||||
|
@ -465,7 +465,7 @@ var routeTests = map[string][]string{
|
|||||||
"/settings/apps": nil,
|
"/settings/apps": nil,
|
||||||
"/settings/avatar": nil,
|
"/settings/avatar": nil,
|
||||||
"/settings/formatting": nil,
|
"/settings/formatting": nil,
|
||||||
"/settings/pro": nil,
|
"/settings/extras": nil,
|
||||||
"/shop": nil,
|
"/shop": nil,
|
||||||
"/shop/history": nil,
|
"/shop/history": nil,
|
||||||
"/support": nil,
|
"/support": nil,
|
||||||
|
Loading…
Reference in New Issue
Block a user