From 9bae97f9dbccdeddd2a50ab59e88833911dca416 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 28 Jun 2017 18:39:52 +0200 Subject: [PATCH] Make Shoboi ID editable --- pages/anime/anime.pixy | 2 +- pages/editanime/editanime.pixy | 11 ++++++++++- patches/add-mappings/main.go | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pages/anime/anime.pixy b/pages/anime/anime.pixy index 0b311b1e..b5a53f32 100644 --- a/pages/anime/anime.pixy +++ b/pages/anime/anime.pixy @@ -23,7 +23,7 @@ component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User) .buttons.anime-actions if user.Role == "editor" || user.Role == "admin" a.button.ajax(href=anime.Link() + "/edit") - Icon("database") + Icon("pencil-square-o") span Edit anime if user.AnimeList().Contains(anime.ID) diff --git a/pages/editanime/editanime.pixy b/pages/editanime/editanime.pixy index 1c1cd3b9..adbf6c61 100644 --- a/pages/editanime/editanime.pixy +++ b/pages/editanime/editanime.pixy @@ -4,4 +4,13 @@ component EditAnime(anime *arn.Anime) .widgets .widget(data-api="/api/anime/" + anime.ID) h3.anime-section-name Mappings - InputText("ShoboiID", anime.GetMapping("shoboi/anime"), "Shoboi TID", "TID on http://cal.syoboi.jp") \ No newline at end of file + InputText("Custom:ShoboiID", anime.GetMapping("shoboi/anime"), "Shoboi TID", "TID on http://cal.syoboi.jp") + + .buttons + a.button.ajax(href="/anime/" + anime.ID) + Icon("arrow-left") + span View anime + + a.button(href="/api/anime/" + anime.ID, target="_blank") + Icon("search-plus") + span JSON API \ No newline at end of file diff --git a/patches/add-mappings/main.go b/patches/add-mappings/main.go index 70cb7cd4..12c2f541 100644 --- a/patches/add-mappings/main.go +++ b/patches/add-mappings/main.go @@ -22,7 +22,7 @@ func main() { } fmt.Println(anime.ID, "=", mapping.Service, mapping.ServiceID) - anime.AddMapping(mapping.Service, mapping.ServiceID) + anime.AddMapping(mapping.Service, mapping.ServiceID, "4J6qpK1ve") anime.Save() } }