diff --git a/pages/apiview/api.pixy b/pages/apiview/api.pixy index 4ff6fc7d..44f2af54 100644 --- a/pages/apiview/api.pixy +++ b/pages/apiview/api.pixy @@ -1,13 +1,14 @@ component API(types []string) - h1 API - - table - //- thead - //- tr - //- th Table - tbody - each typeName in types - tr - td= typeName - td - a(href="/api/" + strings.ToLower(typeName) + "/")= "/api/" + strings.ToLower(typeName) + "/" \ No newline at end of file + .api-docs-page + h1 API + + table + //- thead + //- tr + //- th Table + tbody + each typeName in types + tr + td= typeName + td + a(href="/api/" + strings.ToLower(typeName) + "/")= "/api/" + strings.ToLower(typeName) + "/" \ No newline at end of file diff --git a/pages/apiview/apidocs/apidocs.pixy b/pages/apiview/apidocs/apidocs.pixy index fc402671..6ddc6dd8 100644 --- a/pages/apiview/apidocs/apidocs.pixy +++ b/pages/apiview/apidocs/apidocs.pixy @@ -1,17 +1,17 @@ component APIDocs(t reflect.Type, examples []string, fields []*utils.APIField) .api-docs-page - h1= "API: " + t.Name() + h1= t.Name() h2 Examples if len(examples) == 0 - p.no-data No examples have been added to this type yet. + p.no-data No examples available yet. else .buttons each example in examples - a.button(href="https://notify.moe" + example, target="_blank") + a.button(href=example, target="_blank") Icon("external-link") - span= example + span= strings.TrimPrefix(example, "/api") h2 Fields diff --git a/pages/apiview/apidocs/apidocs.scarlet b/pages/apiview/apidocs/apidocs.scarlet index 5e7c4ada..ac4da4a4 100644 --- a/pages/apiview/apidocs/apidocs.scarlet +++ b/pages/apiview/apidocs/apidocs.scarlet @@ -1,6 +1,7 @@ .api-docs-page h1, - h2 + h2, + p text-align left table diff --git a/pages/notifications/notifications.pixy b/pages/notifications/notifications.pixy index f981421a..4bdedc9c 100644 --- a/pages/notifications/notifications.pixy +++ b/pages/notifications/notifications.pixy @@ -24,7 +24,7 @@ component AllNotifications(notifications []*arn.Notification) a(href=notification.User().Link())= notification.User().Nick component Notification(notification *arn.Notification) - a.notification(href=notification.Link, target="_blank", data-seen=notification.Seen) + a.notification(href=notification.Link, target="_blank", data-seen=notification.Seen, data-id=notification.ID) .notification-icon img.lazy(data-src=notification.Icon, alt=notification.Title) diff --git a/pages/shop/buyitem.go b/pages/shop/buyitem.go index df2b1d78..bc61ba4d 100644 --- a/pages/shop/buyitem.go +++ b/pages/shop/buyitem.go @@ -32,7 +32,7 @@ func BuyItem(ctx *aero.Context) string { return ctx.Error(http.StatusBadRequest, "Invalid item quantity", err) } - item, err := arn.GetItem(itemID) + item, err := arn.GetShopItem(itemID) if err != nil { return ctx.Error(http.StatusInternalServerError, "Error fetching item data", err) diff --git a/pages/shop/shop.go b/pages/shop/shop.go index 16ec90a1..7ea235d0 100644 --- a/pages/shop/shop.go +++ b/pages/shop/shop.go @@ -19,7 +19,7 @@ func Get(ctx *aero.Context) string { return ctx.Error(http.StatusUnauthorized, "Not logged in", nil) } - items, err := arn.AllItems() + items, err := arn.AllShopItems() if err != nil { return ctx.Error(http.StatusInternalServerError, "Error fetching shop item data", err) diff --git a/patches/add-item/add-item.go b/patches/add-item/add-item.go index 85ad81d5..bf9baec5 100644 --- a/patches/add-item/add-item.go +++ b/patches/add-item/add-item.go @@ -29,7 +29,7 @@ func main() { user, err := arn.GetUserByNick(nick) arn.PanicOnError(err) - item, err := arn.GetItem(itemID) + item, err := arn.GetShopItem(itemID) arn.PanicOnError(err) if item == nil { diff --git a/patches/add-shop-items/add-shop-items.go b/patches/add-shop-items/add-shop-items.go index 300be2d8..1eb1cd83 100644 --- a/patches/add-shop-items/add-shop-items.go +++ b/patches/add-shop-items/add-shop-items.go @@ -2,8 +2,8 @@ package main import "github.com/animenotifier/arn" -var items = []*arn.Item{ - &arn.Item{ +var items = []*arn.ShopItem{ + &arn.ShopItem{ ID: "pro-account-3", Name: "PRO Account (1 season)", Price: 900, @@ -20,11 +20,11 @@ Includes: * Access to the VIP channel on Discord * Early access to new features`, Icon: "star", - Rarity: arn.ItemRaritySuperior, + Rarity: arn.ShopItemRaritySuperior, Order: 1, Consumable: true, }, - &arn.Item{ + &arn.ShopItem{ ID: "pro-account-6", Name: "PRO Account (2 seasons)", Price: 1600, @@ -41,11 +41,11 @@ Includes: * Access to the VIP channel on Discord * Early access to new features`, Icon: "star", - Rarity: arn.ItemRarityRare, + Rarity: arn.ShopItemRarityRare, Order: 2, Consumable: true, }, - &arn.Item{ + &arn.ShopItem{ ID: "pro-account-12", Name: "PRO Account (4 seasons)", Price: 3000, @@ -62,11 +62,11 @@ Includes: * Access to the VIP channel on Discord * Early access to new features`, Icon: "star", - Rarity: arn.ItemRarityUnique, + Rarity: arn.ShopItemRarityUnique, Order: 3, Consumable: true, }, - &arn.Item{ + &arn.ShopItem{ ID: "pro-account-24", Name: "PRO Account (8 seasons)", Price: 5900, @@ -83,7 +83,7 @@ Includes: * Access to the VIP channel on Discord * Early access to new features`, Icon: "star", - Rarity: arn.ItemRarityLegendary, + Rarity: arn.ShopItemRarityLegendary, Order: 4, Consumable: true, }, diff --git a/utils/routetests/All.go b/utils/routetests/All.go index ceca6b80..4c4d641d 100644 --- a/utils/routetests/All.go +++ b/utils/routetests/All.go @@ -104,19 +104,19 @@ var routeTests = map[string][]string{ // Pages "/anime/:id": []string{ - "/anime/1", + "/anime/323", }, "/anime/:id/characters": []string{ - "/anime/1/characters", + "/anime/323/characters", }, "/anime/:id/episodes": []string{ - "/anime/1/episodes", + "/anime/323/episodes", }, "/anime/:id/tracks": []string{ - "/anime/1/tracks", + "/anime/323/tracks", }, "/thread/:id": []string{ @@ -201,7 +201,7 @@ var routeTests = map[string][]string{ // API "/api/anime/:id": []string{ - "/api/anime/1", + "/api/anime/323", }, "/api/thread/:id": []string{ @@ -252,14 +252,14 @@ var routeTests = map[string][]string{ "/api/userfollows/4J6qpK1ve", }, - "/api/anilisttoanime/:id": []string{ - "/api/anilisttoanime/527", - }, - "/api/animecharacters/:id": []string{ "/api/animecharacters/323", }, + "/api/animerelations/:id": []string{ + "/api/animerelations/323", + }, + "/api/animeepisodes/:id": []string{ "/api/animeepisodes/323", }, @@ -272,12 +272,36 @@ var routeTests = map[string][]string{ "/api/character/6556", }, - "/api/pushsubscriptions/:id": []string{ - "/api/pushsubscriptions/4J6qpK1ve", + "/api/company/:id": []string{ + "/api/company/xCAUr7UkRaz", }, - "/api/myanimelisttoanime/:id": []string{ - "/api/myanimelisttoanime/527", + "/api/draftindex/:id": []string{ + "/api/draftindex/4J6qpK1ve", + }, + + "/api/inventory/:id": []string{ + "/api/inventory/4J6qpK1ve", + }, + + "/api/shopitem/:id": []string{ + "/api/shopitem/pro-account-3", + }, + + "/api/notification/:id": []string{ + "/api/notification/u2WHJpkigm", + }, + + "/api/quote/:id": []string{ + "/api/quote/GXp675zmR", + }, + + "/api/usernotifications/:id": []string{ + "/api/usernotifications/4J6qpK1ve", + }, + + "/api/pushsubscriptions/:id": []string{ + "/api/pushsubscriptions/4J6qpK1ve", }, // Images