Editor page
This commit is contained in:
parent
0be7eca8cd
commit
7579c52188
40
main.go
40
main.go
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/animenotifier/notify.moe/pages/best"
|
"github.com/animenotifier/notify.moe/pages/best"
|
||||||
"github.com/animenotifier/notify.moe/pages/dashboard"
|
"github.com/animenotifier/notify.moe/pages/dashboard"
|
||||||
"github.com/animenotifier/notify.moe/pages/editanime"
|
"github.com/animenotifier/notify.moe/pages/editanime"
|
||||||
|
"github.com/animenotifier/notify.moe/pages/editor"
|
||||||
"github.com/animenotifier/notify.moe/pages/embed"
|
"github.com/animenotifier/notify.moe/pages/embed"
|
||||||
"github.com/animenotifier/notify.moe/pages/explore"
|
"github.com/animenotifier/notify.moe/pages/explore"
|
||||||
"github.com/animenotifier/notify.moe/pages/forum"
|
"github.com/animenotifier/notify.moe/pages/forum"
|
||||||
@ -73,6 +74,14 @@ func configure(app *aero.Application) *aero.Application {
|
|||||||
app.Ajax("/threads/:id", threads.Get)
|
app.Ajax("/threads/:id", threads.Get)
|
||||||
app.Ajax("/posts/:id", posts.Get)
|
app.Ajax("/posts/:id", posts.Get)
|
||||||
app.Ajax("/tracks/:id", tracks.Get)
|
app.Ajax("/tracks/:id", tracks.Get)
|
||||||
|
app.Ajax("/new/thread", newthread.Get)
|
||||||
|
app.Ajax("/new/soundtrack", newsoundtrack.Get)
|
||||||
|
app.Ajax("/settings", settings.Get)
|
||||||
|
app.Ajax("/music", music.Get)
|
||||||
|
app.Ajax("/users", users.Get)
|
||||||
|
app.Ajax("/login", login.Get)
|
||||||
|
|
||||||
|
// User profiles
|
||||||
app.Ajax("/user", user.Get)
|
app.Ajax("/user", user.Get)
|
||||||
app.Ajax("/user/:nick", profile.Get)
|
app.Ajax("/user/:nick", profile.Get)
|
||||||
app.Ajax("/user/:nick/threads", profile.GetThreadsByUser)
|
app.Ajax("/user/:nick/threads", profile.GetThreadsByUser)
|
||||||
@ -85,27 +94,32 @@ func configure(app *aero.Application) *aero.Application {
|
|||||||
app.Ajax("/user/:nick/animelist/hold", animelist.FilterByStatus(arn.AnimeListStatusHold))
|
app.Ajax("/user/:nick/animelist/hold", animelist.FilterByStatus(arn.AnimeListStatusHold))
|
||||||
app.Ajax("/user/:nick/animelist/dropped", animelist.FilterByStatus(arn.AnimeListStatusDropped))
|
app.Ajax("/user/:nick/animelist/dropped", animelist.FilterByStatus(arn.AnimeListStatusDropped))
|
||||||
app.Ajax("/user/:nick/animelist/anime/:id", animelistitem.Get)
|
app.Ajax("/user/:nick/animelist/anime/:id", animelistitem.Get)
|
||||||
app.Ajax("/new/thread", newthread.Get)
|
|
||||||
app.Ajax("/new/soundtrack", newsoundtrack.Get)
|
// Search
|
||||||
app.Ajax("/settings", settings.Get)
|
app.Ajax("/search", search.Get)
|
||||||
app.Ajax("/music", music.Get)
|
app.Ajax("/search/:term", search.Get)
|
||||||
|
|
||||||
|
// Admin
|
||||||
|
app.Ajax("/admin", admin.Get)
|
||||||
|
app.Ajax("/editor", editor.Get)
|
||||||
|
app.Ajax("/statistics", statistics.Get)
|
||||||
|
app.Ajax("/statistics/anime", statistics.Anime)
|
||||||
|
app.Ajax("/webdev", webdev.Get)
|
||||||
|
|
||||||
|
// Import
|
||||||
app.Ajax("/import", listimport.Get)
|
app.Ajax("/import", listimport.Get)
|
||||||
app.Ajax("/import/anilist/animelist", listimportanilist.Preview)
|
app.Ajax("/import/anilist/animelist", listimportanilist.Preview)
|
||||||
app.Ajax("/import/anilist/animelist/finish", listimportanilist.Finish)
|
app.Ajax("/import/anilist/animelist/finish", listimportanilist.Finish)
|
||||||
app.Ajax("/import/myanimelist/animelist", listimportmyanimelist.Preview)
|
app.Ajax("/import/myanimelist/animelist", listimportmyanimelist.Preview)
|
||||||
app.Ajax("/import/myanimelist/animelist/finish", listimportmyanimelist.Finish)
|
app.Ajax("/import/myanimelist/animelist/finish", listimportmyanimelist.Finish)
|
||||||
app.Ajax("/admin", admin.Get)
|
|
||||||
app.Ajax("/statistics", statistics.Get)
|
// Genres
|
||||||
app.Ajax("/statistics/anime", statistics.Anime)
|
|
||||||
app.Ajax("/search", search.Get)
|
|
||||||
app.Ajax("/search/:term", search.Get)
|
|
||||||
app.Ajax("/users", users.Get)
|
|
||||||
app.Ajax("/login", login.Get)
|
|
||||||
app.Ajax("/webdev", webdev.Get)
|
|
||||||
app.Ajax("/extension/embed", embed.Get)
|
|
||||||
// app.Ajax("/genres", genres.Get)
|
// app.Ajax("/genres", genres.Get)
|
||||||
// app.Ajax("/genres/:name", genre.Get)
|
// app.Ajax("/genres/:name", genre.Get)
|
||||||
|
|
||||||
|
// Browser extension
|
||||||
|
app.Ajax("/extension/embed", embed.Get)
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
app.Use(middleware.Log())
|
app.Use(middleware.Log())
|
||||||
app.Use(middleware.Session())
|
app.Use(middleware.Session())
|
||||||
|
@ -152,8 +152,8 @@ component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User, epis
|
|||||||
h3.anime-section-name Latest episodes
|
h3.anime-section-name Latest episodes
|
||||||
else
|
else
|
||||||
h3.anime-section-name Episodes
|
h3.anime-section-name Episodes
|
||||||
table
|
table.episodes
|
||||||
tbody.episodes
|
tbody
|
||||||
each episode in anime.Episodes
|
each episode in anime.Episodes
|
||||||
tr.episode
|
tr.episode
|
||||||
td.episode-number= episode.Number
|
td.episode-number= episode.Number
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.episodes
|
.episodes
|
||||||
//
|
max-width 100%
|
||||||
|
|
||||||
.episode
|
.episode
|
||||||
horizontal
|
horizontal
|
||||||
|
27
pages/editor/editor.go
Normal file
27
pages/editor/editor.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package editor
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"sort"
|
||||||
|
|
||||||
|
"github.com/aerogo/aero"
|
||||||
|
"github.com/animenotifier/arn"
|
||||||
|
"github.com/animenotifier/notify.moe/components"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get ...
|
||||||
|
func Get(ctx *aero.Context) string {
|
||||||
|
missing, err := arn.FilterAnime(func(anime *arn.Anime) bool {
|
||||||
|
return anime.GetMapping("anilist/anime") == ""
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
ctx.Error(http.StatusInternalServerError, "Couldn't filter anime", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
sort.Slice(missing, func(i, j int) bool {
|
||||||
|
return missing[i].StartDate > missing[j].StartDate
|
||||||
|
})
|
||||||
|
|
||||||
|
return ctx.HTML(components.AniListMissingMapping(missing))
|
||||||
|
}
|
14
pages/editor/editor.pixy
Normal file
14
pages/editor/editor.pixy
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
component AniListMissingMapping(missing []*arn.Anime)
|
||||||
|
h1 Anime without Anilist links
|
||||||
|
|
||||||
|
table
|
||||||
|
tbody
|
||||||
|
each anime in missing
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
if len(anime.StartDate) >= 4
|
||||||
|
span= anime.StartDate[:4]
|
||||||
|
td
|
||||||
|
a(href=anime.Link(), target="_blank", rel="noopener")= anime.Title.Canonical
|
||||||
|
td
|
||||||
|
a(href="https://anilist.co/search?type=anime&q=" + anime.Title.Canonical, target="_blank", rel="noopener") Search
|
@ -1,6 +1,2 @@
|
|||||||
.buttons-vertical
|
.buttons-vertical
|
||||||
width 100%
|
width 100%
|
||||||
|
|
||||||
.import-list
|
|
||||||
max-width table-width-normal
|
|
||||||
margin 0 auto
|
|
@ -1,5 +1,7 @@
|
|||||||
table
|
table
|
||||||
width 100%
|
width 100%
|
||||||
|
max-width table-width-normal
|
||||||
|
margin 0 auto
|
||||||
|
|
||||||
tr
|
tr
|
||||||
border-bottom-width 1px
|
border-bottom-width 1px
|
||||||
|
Loading…
x
Reference in New Issue
Block a user