From 9fa9ccbe89e6e38164fa2b9c67334770a7eddd9f Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 20 Nov 2017 09:39:47 +0100 Subject: [PATCH] Improved importer --- mixins/ImportButton.pixy | 5 +++++ pages/listimport/listimport.pixy | 3 +++ pages/listimport/listimport.scarlet | 5 ++++- pages/listimport/listimportanilist/anilist.pixy | 9 ++++----- pages/listimport/listimportkitsu/kitsu.pixy | 9 ++++----- pages/listimport/listimportmyanimelist/myanimelist.pixy | 9 ++++----- 6 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 mixins/ImportButton.pixy diff --git a/mixins/ImportButton.pixy b/mixins/ImportButton.pixy new file mode 100644 index 00000000..b1c378b3 --- /dev/null +++ b/mixins/ImportButton.pixy @@ -0,0 +1,5 @@ +component ImportButton(url string) + .buttons.import-buttons + a.button.mountable(href=url) + Icon("refresh") + span Import \ No newline at end of file diff --git a/pages/listimport/listimport.pixy b/pages/listimport/listimport.pixy index aff1e117..411103ca 100644 --- a/pages/listimport/listimport.pixy +++ b/pages/listimport/listimport.pixy @@ -1,4 +1,7 @@ component ImportLists(user *arn.User) + if user.Accounts.AniList.Nick == "" && user.Accounts.Kitsu.Nick == "" && user.Accounts.MyAnimeList.Nick == "" + p Import your list once you enter your username! + if user.Accounts.AniList.Nick != "" label AniList: diff --git a/pages/listimport/listimport.scarlet b/pages/listimport/listimport.scarlet index 5f42a32f..d189b90d 100644 --- a/pages/listimport/listimport.scarlet +++ b/pages/listimport/listimport.scarlet @@ -1,2 +1,5 @@ .buttons-vertical - width 100% \ No newline at end of file + width 100% + +.import-buttons + margin-bottom content-padding \ No newline at end of file diff --git a/pages/listimport/listimportanilist/anilist.pixy b/pages/listimport/listimportanilist/anilist.pixy index 711f7aee..f8f506e3 100644 --- a/pages/listimport/listimportanilist/anilist.pixy +++ b/pages/listimport/listimportanilist/anilist.pixy @@ -1,5 +1,7 @@ component ImportAnilist(user *arn.User, matches []*arn.AniListMatch) - h1= "anilist.co Import (" + user.Accounts.AniList.Nick + ", " + toString(len(matches)) + " anime)" + h1= "Preview: anilist.co (" + user.Accounts.AniList.Nick + ", " + toString(len(matches)) + " anime)" + + ImportButton("/import/anilist/animelist/finish") table.import-list thead @@ -17,7 +19,4 @@ component ImportAnilist(user *arn.User, matches []*arn.AniListMatch) else a(href=match.ARNAnime.Link(), target="_blank", rel="noopener")= match.ARNAnime.Title.Canonical - .buttons - a.button.mountable(href="/import/anilist/animelist/finish") - Icon("refresh") - span Import \ No newline at end of file + ImportButton("/import/anilist/animelist/finish") \ No newline at end of file diff --git a/pages/listimport/listimportkitsu/kitsu.pixy b/pages/listimport/listimportkitsu/kitsu.pixy index 1a39b7a8..f36ba9ff 100644 --- a/pages/listimport/listimportkitsu/kitsu.pixy +++ b/pages/listimport/listimportkitsu/kitsu.pixy @@ -1,5 +1,7 @@ component ImportKitsu(user *arn.User, matches []*arn.KitsuMatch) - h1= "kitsu.io Import (" + user.Accounts.Kitsu.Nick + ", " + toString(len(matches)) + " anime)" + h1= "Preview: kitsu.io (" + user.Accounts.Kitsu.Nick + ", " + toString(len(matches)) + " anime)" + + ImportButton("/import/kitsu/animelist/finish") table.import-list thead @@ -17,7 +19,4 @@ component ImportKitsu(user *arn.User, matches []*arn.KitsuMatch) else a(href=match.ARNAnime.Link(), target="_blank", rel="noopener")= match.ARNAnime.Title.Canonical - .buttons - a.button.mountable(href="/import/kitsu/animelist/finish") - Icon("refresh") - span Import \ No newline at end of file + ImportButton("/import/kitsu/animelist/finish") \ No newline at end of file diff --git a/pages/listimport/listimportmyanimelist/myanimelist.pixy b/pages/listimport/listimportmyanimelist/myanimelist.pixy index 2908e126..f55d336f 100644 --- a/pages/listimport/listimportmyanimelist/myanimelist.pixy +++ b/pages/listimport/listimportmyanimelist/myanimelist.pixy @@ -1,5 +1,7 @@ component ImportMyAnimeList(user *arn.User, matches []*arn.MyAnimeListMatch) - h1= "myanimelist.net Import (" + user.Accounts.MyAnimeList.Nick + ", " + toString(len(matches)) + " anime)" + h1= "Preview: myanimelist.net (" + user.Accounts.MyAnimeList.Nick + ", " + toString(len(matches)) + " anime)" + + ImportButton("/import/myanimelist/animelist/finish") table.import-list thead @@ -17,7 +19,4 @@ component ImportMyAnimeList(user *arn.User, matches []*arn.MyAnimeListMatch) else a(href=match.ARNAnime.Link(), target="_blank", rel="noopener")= match.ARNAnime.Title.Canonical - .buttons - a.button.mountable(href="/import/myanimelist/animelist/finish") - Icon("refresh") - span Import \ No newline at end of file + ImportButton("/import/myanimelist/animelist/finish") \ No newline at end of file