Started working on the shop
This commit is contained in:
parent
b6d6ce92da
commit
aec23d0b6e
2
main.go
2
main.go
@ -39,6 +39,7 @@ import (
|
|||||||
"github.com/animenotifier/notify.moe/pages/profile"
|
"github.com/animenotifier/notify.moe/pages/profile"
|
||||||
"github.com/animenotifier/notify.moe/pages/search"
|
"github.com/animenotifier/notify.moe/pages/search"
|
||||||
"github.com/animenotifier/notify.moe/pages/settings"
|
"github.com/animenotifier/notify.moe/pages/settings"
|
||||||
|
"github.com/animenotifier/notify.moe/pages/shop"
|
||||||
"github.com/animenotifier/notify.moe/pages/soundtrack"
|
"github.com/animenotifier/notify.moe/pages/soundtrack"
|
||||||
"github.com/animenotifier/notify.moe/pages/soundtracks"
|
"github.com/animenotifier/notify.moe/pages/soundtracks"
|
||||||
"github.com/animenotifier/notify.moe/pages/statistics"
|
"github.com/animenotifier/notify.moe/pages/statistics"
|
||||||
@ -94,6 +95,7 @@ func configure(app *aero.Application) *aero.Application {
|
|||||||
app.Ajax("/users/anime/watching", users.AnimeWatching)
|
app.Ajax("/users/anime/watching", users.AnimeWatching)
|
||||||
app.Ajax("/statistics", statistics.Get)
|
app.Ajax("/statistics", statistics.Get)
|
||||||
app.Ajax("/statistics/anime", statistics.Anime)
|
app.Ajax("/statistics/anime", statistics.Anime)
|
||||||
|
app.Ajax("/shop", shop.Get)
|
||||||
app.Ajax("/login", login.Get)
|
app.Ajax("/login", login.Get)
|
||||||
|
|
||||||
// User profiles
|
// User profiles
|
||||||
|
@ -20,12 +20,10 @@ component Sidebar(user *arn.User)
|
|||||||
//- SidebarButton("Search", "/search", "search")
|
//- SidebarButton("Search", "/search", "search")
|
||||||
|
|
||||||
if user != nil
|
if user != nil
|
||||||
|
SidebarButton("Shop", "/shop", "shopping-cart")
|
||||||
SidebarButton("Statistics", "/statistics", "pie-chart")
|
SidebarButton("Statistics", "/statistics", "pie-chart")
|
||||||
SidebarButton("Settings", "/settings", "cog")
|
SidebarButton("Settings", "/settings", "cog")
|
||||||
|
|
||||||
if user.Role == "admin" || user.Role == "editor"
|
|
||||||
SidebarButton("Admin", "/admin", "wrench")
|
|
||||||
|
|
||||||
.spacer
|
.spacer
|
||||||
|
|
||||||
.sidebar-link(aria-label="Search")
|
.sidebar-link(aria-label="Search")
|
||||||
@ -33,6 +31,9 @@ component Sidebar(user *arn.User)
|
|||||||
Icon("search")
|
Icon("search")
|
||||||
FuzzySearch
|
FuzzySearch
|
||||||
|
|
||||||
|
if user != nil && (user.Role == "admin" || user.Role == "editor")
|
||||||
|
SidebarButton("Admin", "/admin", "wrench")
|
||||||
|
|
||||||
SidebarButton("Help", "/thread/I3MMiOtzR", "question-circle")
|
SidebarButton("Help", "/thread/I3MMiOtzR", "question-circle")
|
||||||
|
|
||||||
if user != nil
|
if user != nil
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
component AdminTabs
|
component AdminTabs
|
||||||
.tabs
|
.tabs
|
||||||
Tab("Server", "server", "/admin")
|
Tab("Server", "server", "/admin")
|
||||||
|
Tab("WebDev", "html5", "/admin/webdev")
|
||||||
Tab("Shoboi", "calendar", "/admin/shoboi")
|
Tab("Shoboi", "calendar", "/admin/shoboi")
|
||||||
Tab("AniList", "list", "/admin/anilist")
|
Tab("AniList", "list", "/admin/anilist")
|
||||||
Tab("WebDev", "html5", "/admin/webdev")
|
|
||||||
|
|
||||||
component Admin(user *arn.User, cpuUsage, memUsage, diskUsage float64, platform, family, platformVersion, kernelVersion string)
|
component Admin(user *arn.User, cpuUsage, memUsage, diskUsage float64, platform, family, platformVersion, kernelVersion string)
|
||||||
h1.page-title Admin Panel
|
h1.page-title Admin Panel
|
||||||
|
9
pages/shop/pro-account.md
Normal file
9
pages/shop/pro-account.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
PRO account for 1 anime season (3 months).
|
||||||
|
|
||||||
|
Includes:
|
||||||
|
|
||||||
|
* Avatar highlight on the forums
|
||||||
|
* Customizable cover image for your profile
|
||||||
|
* Custom title for profile and forums
|
||||||
|
* Your suggestions will have a high priority
|
||||||
|
* Access to the VIP channel on Discord
|
28
pages/shop/shop.go
Normal file
28
pages/shop/shop.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package shop
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/aerogo/aero"
|
||||||
|
"github.com/animenotifier/notify.moe/components"
|
||||||
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
var proAccount = ""
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
data, _ := ioutil.ReadFile("pages/shop/pro-account.md")
|
||||||
|
proAccount = string(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get shop page.
|
||||||
|
func Get(ctx *aero.Context) string {
|
||||||
|
user := utils.GetUser(ctx)
|
||||||
|
|
||||||
|
if user == nil {
|
||||||
|
return ctx.Error(http.StatusUnauthorized, "Not logged in", nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.HTML(components.Shop(user, proAccount))
|
||||||
|
}
|
29
pages/shop/shop.pixy
Normal file
29
pages/shop/shop.pixy
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
component Shop(user *arn.User, proAccountMarkdown string)
|
||||||
|
h1.page-title Shop
|
||||||
|
|
||||||
|
.user-balance-bar
|
||||||
|
Icon("diamond")
|
||||||
|
span.user-balance 0
|
||||||
|
|
||||||
|
.tabs
|
||||||
|
.tab Goods
|
||||||
|
.tab Top-Up
|
||||||
|
|
||||||
|
.widgets.shop-items
|
||||||
|
ShopItem("PRO Account", "3 months", "900", "star", proAccountMarkdown)
|
||||||
|
ShopItem("PRO Account", "6 months", "1700", "star", strings.Replace(strings.Replace(proAccountMarkdown, "3 months", "6 months", 1), "1 anime season", "2 anime seasons", 1))
|
||||||
|
ShopItem("PRO Account", "1 year", "3000", "star", strings.Replace(strings.Replace(proAccountMarkdown, "3 months", "12 months", 1), "1 anime season", "4 anime seasons", 1))
|
||||||
|
ShopItem("PRO Account", "2 years", "5900", "star", strings.Replace(strings.Replace(proAccountMarkdown, "3 months", "24 months", 1), "1 anime season", "8 anime seasons", 1))
|
||||||
|
ShopItem("Anime Support Ticket", "", "100", "ticket", "Support the makers of your favourite anime by using an anime support ticket. Anime Notifier uses 8% of the money to handle the transaction fees while the remaining 92% go directly to the studios involved in the creation of your favourite anime.")
|
||||||
|
|
||||||
|
component ShopItem(name string, duration string, price string, icon string, description string)
|
||||||
|
.widget.shop-item
|
||||||
|
h3.widget-title.shop-item-name
|
||||||
|
Icon(icon)
|
||||||
|
span= name
|
||||||
|
span.shop-item-duration= " " + duration
|
||||||
|
.shop-item-description!= aero.Markdown(description)
|
||||||
|
.buttons.shop-buttons
|
||||||
|
button.shop-button-buy
|
||||||
|
span.shop-item-price= price
|
||||||
|
Icon("diamond")
|
33
pages/shop/shop.scarlet
Normal file
33
pages/shop/shop.scarlet
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
.shop-items
|
||||||
|
// ...
|
||||||
|
|
||||||
|
.shop-item
|
||||||
|
// ...
|
||||||
|
|
||||||
|
.shop-item-name
|
||||||
|
// ...
|
||||||
|
|
||||||
|
.shop-item-price
|
||||||
|
// ...
|
||||||
|
|
||||||
|
.shop-item-price-currency
|
||||||
|
margin-left 0.3rem
|
||||||
|
margin-right 0
|
||||||
|
|
||||||
|
.shop-item-duration
|
||||||
|
opacity 0.5
|
||||||
|
text-align right
|
||||||
|
float right
|
||||||
|
|
||||||
|
.shop-buttons
|
||||||
|
margin-top 1rem
|
||||||
|
|
||||||
|
.shop-button-buy
|
||||||
|
.icon-diamond
|
||||||
|
margin-left 0.3rem
|
||||||
|
margin-right 0
|
||||||
|
|
||||||
|
.user-balance-bar
|
||||||
|
text-align center
|
||||||
|
font-size 2.5rem
|
||||||
|
margin-bottom 2rem
|
Loading…
Reference in New Issue
Block a user