Changed editor panel links

This commit is contained in:
Eduard Urbach 2018-03-09 12:38:46 +01:00
parent fa719fb13b
commit b77dcfb98c
11 changed files with 36 additions and 32 deletions

View File

@ -1,5 +1,5 @@
component AnimeEditorListFull(title string, missing []*arn.Anime, count int, pageURI string, generateSearchLink func(*arn.Anime) string)
EditorTabs
EditorTabs(pageURI)
h1.editor-list-title.mountable= title
.footer.editor-list-entry-count.mountable= strconv.Itoa(count) + " anime"
AnimeEditorList(missing, pageURI, generateSearchLink)

View File

@ -7,5 +7,5 @@ import (
// Get the dashboard.
func Get(ctx *aero.Context) string {
return ctx.HTML(components.Database())
return ctx.HTML(components.Database(ctx.URI()))
}

View File

@ -1,5 +1,5 @@
component Database
EditorTabs
component Database(url string)
EditorTabs(url)
.widget-form
.widget

View File

@ -51,7 +51,7 @@ func AniList(ctx *aero.Context) string {
"Anime without Anilist links",
missing,
count,
"/editor/anilist",
"/editor/anime/missing/anilist",
func(anime *arn.Anime) string {
return "https://anilist.co/search?type=anime&q=" + anime.Title.Canonical
},

View File

@ -14,5 +14,5 @@ func Get(ctx *aero.Context) string {
return ctx.Redirect("/")
}
return ctx.HTML(components.Editor())
return ctx.HTML(components.Editor(ctx.URI(), user))
}

View File

@ -1,17 +1,21 @@
component Editor
EditorTabs
component Editor(url string, user *arn.User)
EditorTabs(url)
h1.page-title Editor Panel
p.text-center.mountable Welcome to the Editor Panel!
p.text-center.mountable= "Welcome to the Editor Panel, " + user.Nick + "!"
component EditorTabs
component EditorTabs(url string)
.tabs
Tab("Editor", "pencil", "/editor")
Tab("Shoboi", "list", "/editor/shoboi")
Tab("AniList", "list", "/editor/anilist")
Tab("Genres", "list", "/editor/genres")
Tab("MAL", "list", "/editor/mal")
Tab("MAL", "exchange", "/editor/anime/maldiff")
Tab("Missing", "list", "/editor/anime/missing/shoboi")
Tab("Search", "search", "/database")
if strings.Contains(url, "/editor/anime/missing/")
.tabs
Tab("Shoboi", "list", "/editor/anime/missing/shoboi")
Tab("AniList", "list", "/editor/anime/missing/anilist")
Tab("Genres", "list", "/editor/anime/missing/genres")
//- a.tab.ajax(href="/admin", aria-label="Admin")
//- Icon("wrench")
//- span.tab-text Admin

View File

@ -51,7 +51,7 @@ func Genres(ctx *aero.Context) string {
"Anime without genres",
missing,
count,
"/editor/genres",
"/editor/anime/missing/genres",
nil,
))
}

View File

@ -109,5 +109,5 @@ func CompareMAL(ctx *aero.Context) string {
}
}
return ctx.HTML(components.CompareMAL(comparisons, user))
return ctx.HTML(components.CompareMAL(comparisons, ctx.URI(), user))
}

View File

@ -1,5 +1,5 @@
component CompareMAL(comparisons []*utils.MALComparison, user *arn.User)
EditorTabs
component CompareMAL(comparisons []*utils.MALComparison, url string, user *arn.User)
EditorTabs(url)
h1.mountable MAL comparison
.data-comparisons

View File

@ -51,7 +51,7 @@ func Shoboi(ctx *aero.Context) string {
"Anime without Shoboi links",
missing,
count,
"/editor/shoboi",
"/editor/anime/missing/shoboi",
func(anime *arn.Anime) string {
return "http://cal.syoboi.jp/find?type=quick&sd=1&kw=" + anime.Title.Japanese
},

View File

@ -199,16 +199,16 @@ func Configure(app *aero.Application) {
// Editor
l.Page("/editor", editor.Get)
l.Page("/editor/anilist", editor.AniList)
l.Page("/editor/anilist/:year", editor.AniList)
l.Page("/editor/anilist/:year/:type", editor.AniList)
l.Page("/editor/shoboi", editor.Shoboi)
l.Page("/editor/shoboi/:year", editor.Shoboi)
l.Page("/editor/shoboi/:year/:type", editor.Shoboi)
l.Page("/editor/genres", editor.Genres)
l.Page("/editor/genres/:year", editor.Genres)
l.Page("/editor/genres/:year/:type", editor.Genres)
l.Page("/editor/mal", editor.CompareMAL)
l.Page("/editor/anime/missing/anilist", editor.AniList)
l.Page("/editor/anime/missing/anilist/:year", editor.AniList)
l.Page("/editor/anime/missing/anilist/:year/:type", editor.AniList)
l.Page("/editor/anime/missing/shoboi", editor.Shoboi)
l.Page("/editor/anime/missing/shoboi/:year", editor.Shoboi)
l.Page("/editor/anime/missing/shoboi/:year/:type", editor.Shoboi)
l.Page("/editor/anime/missing/genres", editor.Genres)
l.Page("/editor/anime/missing/genres/:year", editor.Genres)
l.Page("/editor/anime/missing/genres/:year/:type", editor.Genres)
l.Page("/editor/anime/maldiff", editor.CompareMAL)
// Mixed
l.Page("/database", database.Get)