Changed main currency to JPY

This commit is contained in:
Eduard Urbach 2017-10-06 05:53:49 +02:00
parent 03c79e2932
commit c0d57e51c9
10 changed files with 81 additions and 81 deletions

View File

@ -3,6 +3,8 @@ package auth
import "github.com/aerogo/aero" import "github.com/aerogo/aero"
import "github.com/animenotifier/notify.moe/utils" import "github.com/animenotifier/notify.moe/utils"
const newUserStartRoute = "/settings"
// Install ... // Install ...
func Install(app *aero.Application) { func Install(app *aero.Application) {
// Google // Google

View File

@ -170,7 +170,7 @@ func InstallFacebookAuth(app *aero.Application) {
// Log // Log
authLog.Info("Registered new user via Facebook", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName()) authLog.Info("Registered new user via Facebook", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName())
// Redirect to frontpage // Redirect to settings
return ctx.Redirect("/") return ctx.Redirect(newUserStartRoute)
}) })
} }

View File

@ -181,6 +181,6 @@ func InstallGoogleAuth(app *aero.Application) {
authLog.Info("Registered new user via Google", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName()) authLog.Info("Registered new user via Google", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName())
// Redirect to frontpage // Redirect to frontpage
return ctx.Redirect("/") return ctx.Redirect(newUserStartRoute)
}) })
} }

2
mixins/FuzzySearch.pixy Normal file
View File

@ -0,0 +1,2 @@
component FuzzySearch
input#search.action(data-action="search", data-trigger="input", type="text", placeholder="Search...", title="Shortcut: F")

View File

@ -1,87 +1,72 @@
component Navigation(user *arn.User) //- component Navigation(user *arn.User)
if user == nil //- if user == nil
LoggedOutMenu //- LoggedOutMenu
else //- else
LoggedInMenu(user) //- LoggedInMenu(user)
component LoggedOutMenu //- component LoggedOutMenu
nav#navigation.logged-out //- nav#navigation.logged-out
#sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu") //- #sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu")
.navigation-button //- .navigation-button
Icon("bars") //- Icon("bars")
span.navigation-text Menu //- span.navigation-text Menu
//- NavigationButton("Explore", "/explore", "th") //- //- NavigationButton("Explore", "/explore", "th")
//- NavigationButton("Forum", "/forum", "comment") //- //- NavigationButton("Forum", "/forum", "comment")
FuzzySearch //- FuzzySearch
//- .extra-navigation //- //- .extra-navigation
//- NavigationButton("Users", "/users", "globe") //- //- NavigationButton("Users", "/users", "globe")
//- NavigationButton("Soundtracks", "/soundtracks", "headphones") //- //- NavigationButton("Soundtracks", "/soundtracks", "headphones")
NavigationButton("Login", "/login", "sign-in") //- NavigationButton("Login", "/login", "sign-in")
component LoggedInMenu(user *arn.User) //- component LoggedInMenu(user *arn.User)
nav#navigation.logged-in //- nav#navigation.logged-in
.extension-navigation //- .extension-navigation
NavigationButton("Watching list", "/extension/embed", "home") //- NavigationButton("Watching list", "/extension/embed", "home")
#sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu") //- #sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu")
.navigation-button //- .navigation-button
Icon("bars") //- Icon("bars")
span.navigation-text Menu //- span.navigation-text Menu
//- .extra-navigation //- //- .extra-navigation
//- NavigationButton("Profile", "/+", "user") //- //- NavigationButton("Profile", "/+", "user")
//- .extra-navigation //- //- .extra-navigation
//- NavigationButton("Forum", "/forum", "comment") //- //- NavigationButton("Forum", "/forum", "comment")
//- .extra-navigation //- //- .extra-navigation
//- NavigationButton("Soundtracks", "/soundtracks", "headphones") //- //- NavigationButton("Soundtracks", "/soundtracks", "headphones")
FuzzySearch //- FuzzySearch
//- .extra-navigation //- //- .extra-navigation
//- NavigationButton("Users", "/users", "globe") //- //- NavigationButton("Users", "/users", "globe")
//- .extra-navigation //- //- .extra-navigation
//- NavigationButton("Explore", "/explore", "th") //- //- NavigationButton("Explore", "/explore", "th")
//- .extra-navigation //- //- .extra-navigation
//- NavigationButton("Statistics", "/statistics", "pie-chart") //- //- NavigationButton("Statistics", "/statistics", "pie-chart")
//- .hide-landscape //- //- .hide-landscape
//- NavigationButton("Settings", "/settings", "cog") //- //- NavigationButton("Settings", "/settings", "cog")
//- .extra-navigation.hide-landscape //- //- .extra-navigation.hide-landscape
//- NavigationButtonNoAJAX("Logout", "/logout", "sign-out") //- //- NavigationButtonNoAJAX("Logout", "/logout", "sign-out")
component FuzzySearch //- component NavigationButton(name string, target string, icon string)
input#search.action(data-action="search", data-trigger="input", type="text", placeholder="Search...", title="Shortcut: F") //- a.navigation-link.ajax(href=target, aria-label=name, title=name)
//- .navigation-button
//- Icon(icon)
//- span.navigation-text= name
component NavigationButton(name string, target string, icon string) //- component NavigationButtonNoAJAX(name string, target string, icon string)
a.navigation-link.ajax(href=target, aria-label=name, title=name) //- a.navigation-link(href=target, aria-label=name)
.navigation-button //- .navigation-button
Icon(icon) //- Icon(icon)
span.navigation-text= name //- span.navigation-text= name
component SidebarButton(name string, target string, icon string)
a.sidebar-link.ajax(href=target, aria-label=name, data-bubble="true")
.sidebar-button
Icon(icon)
span.sidebar-text= name
component NavigationButtonNoAJAX(name string, target string, icon string)
a.navigation-link(href=target, aria-label=name)
.navigation-button
Icon(icon)
span.navigation-text= name
component SidebarButtonNoAJAX(name string, target string, icon string)
a.sidebar-link(href=target, aria-label=name, data-bubble="true")
.sidebar-button
Icon(icon)
span.sidebar-text= name

View File

@ -42,3 +42,15 @@ component Sidebar(user *arn.User)
SidebarButtonNoAJAX("Logout", "/logout", "sign-out") SidebarButtonNoAJAX("Logout", "/logout", "sign-out")
else else
SidebarButton("Login", "/login", "sign-in") SidebarButton("Login", "/login", "sign-in")
component SidebarButton(name string, target string, icon string)
a.sidebar-link.ajax(href=target, aria-label=name, data-bubble="true")
.sidebar-button
Icon(icon)
span.sidebar-text= name
component SidebarButtonNoAJAX(name string, target string, icon string)
a.sidebar-link(href=target, aria-label=name, data-bubble="true")
.sidebar-button
Icon(icon)
span.sidebar-text= name

View File

@ -3,7 +3,7 @@ component Charge(user *arn.User)
h1.mountable Charge up h1.mountable Charge up
p.text-center.mountable You can charge up your balance via PayPal. 1 USD equals 100 gems. p.text-center.mountable You can add balance via PayPal. 1 Japanese Yen equals 1 Gem.
.buttons .buttons
button.action.mountable(data-trigger="click", data-action="chargeUp", data-amount=1000) button.action.mountable(data-trigger="click", data-action="chargeUp", data-amount=1000)
@ -26,4 +26,4 @@ component Charge(user *arn.User)
Icon("diamond") Icon("diamond")
span 12000 span 12000
.footer.text-center.mountable You need to enable popup windows in your browser. .footer.text-center.mountable Different currencies will automatically be converted.

View File

@ -67,7 +67,7 @@ func CreatePayment(ctx *aero.Context) string {
// return ctx.Error(http.StatusInternalServerError, "Could not create PayPal web profile", err) // return ctx.Error(http.StatusInternalServerError, "Could not create PayPal web profile", err)
// } // }
total := amount[:len(amount)-2] + "." + amount[len(amount)-2:] // total := amount[:len(amount)-2] + "." + amount[len(amount)-2:]
// Create payment // Create payment
p := paypalsdk.Payment{ p := paypalsdk.Payment{
@ -77,8 +77,8 @@ func CreatePayment(ctx *aero.Context) string {
}, },
Transactions: []paypalsdk.Transaction{paypalsdk.Transaction{ Transactions: []paypalsdk.Transaction{paypalsdk.Transaction{
Amount: &paypalsdk.Amount{ Amount: &paypalsdk.Amount{
Currency: "USD", Currency: "JPY",
Total: total, Total: amount,
}, },
Description: "Top Up Balance", Description: "Top Up Balance",
}}, }},

View File

@ -327,10 +327,10 @@ export function chargeUp(arn: AnimeNotifier, button: HTMLElement) {
throw "Error finding PayPal payment link" throw "Error finding PayPal payment link"
} }
let url = link.href arn.statusMessage.showInfo("Redirecting to PayPal...", 5000)
console.log(url)
window.open(url, "_blank") let url = link.href
window.location.href = url
}) })
.catch(err => arn.statusMessage.showError(err)) .catch(err => arn.statusMessage.showError(err))
.then(() => arn.loading(false)) .then(() => arn.loading(false))

View File

@ -477,7 +477,6 @@ export class AnimeNotifier {
if(!(actionName in actions)) { if(!(actionName in actions)) {
this.statusMessage.showError(`Action '${actionName}' has not been defined`) this.statusMessage.showError(`Action '${actionName}' has not been defined`)
console.error(element)
continue continue
} }