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/animenotifier/notify.moe/utils"
const newUserStartRoute = "/settings"
// Install ...
func Install(app *aero.Application) {
// Google

View File

@ -170,7 +170,7 @@ func InstallFacebookAuth(app *aero.Application) {
// Log
authLog.Info("Registered new user via Facebook", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName())
// Redirect to frontpage
return ctx.Redirect("/")
// Redirect to settings
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())
// 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)
if user == nil
LoggedOutMenu
else
LoggedInMenu(user)
//- component Navigation(user *arn.User)
//- if user == nil
//- LoggedOutMenu
//- else
//- LoggedInMenu(user)
component LoggedOutMenu
nav#navigation.logged-out
#sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu")
.navigation-button
Icon("bars")
span.navigation-text Menu
//- component LoggedOutMenu
//- nav#navigation.logged-out
//- #sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu")
//- .navigation-button
//- Icon("bars")
//- span.navigation-text Menu
//- NavigationButton("Explore", "/explore", "th")
//- NavigationButton("Forum", "/forum", "comment")
//- //- NavigationButton("Explore", "/explore", "th")
//- //- NavigationButton("Forum", "/forum", "comment")
FuzzySearch
//- FuzzySearch
//- .extra-navigation
//- NavigationButton("Users", "/users", "globe")
//- //- .extra-navigation
//- //- 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)
nav#navigation.logged-in
.extension-navigation
NavigationButton("Watching list", "/extension/embed", "home")
//- component LoggedInMenu(user *arn.User)
//- nav#navigation.logged-in
//- .extension-navigation
//- NavigationButton("Watching list", "/extension/embed", "home")
#sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu")
.navigation-button
Icon("bars")
span.navigation-text Menu
//- #sidebar-toggle.navigation-link.action(data-action="toggleSidebar", data-trigger="click", aria-label="Menu", title="Menu")
//- .navigation-button
//- Icon("bars")
//- span.navigation-text Menu
//- .extra-navigation
//- NavigationButton("Profile", "/+", "user")
//- //- .extra-navigation
//- //- NavigationButton("Profile", "/+", "user")
//- .extra-navigation
//- NavigationButton("Forum", "/forum", "comment")
//- //- .extra-navigation
//- //- NavigationButton("Forum", "/forum", "comment")
//- .extra-navigation
//- NavigationButton("Soundtracks", "/soundtracks", "headphones")
//- //- .extra-navigation
//- //- NavigationButton("Soundtracks", "/soundtracks", "headphones")
FuzzySearch
//- FuzzySearch
//- .extra-navigation
//- NavigationButton("Users", "/users", "globe")
//- //- .extra-navigation
//- //- NavigationButton("Users", "/users", "globe")
//- .extra-navigation
//- NavigationButton("Explore", "/explore", "th")
//- //- .extra-navigation
//- //- NavigationButton("Explore", "/explore", "th")
//- .extra-navigation
//- NavigationButton("Statistics", "/statistics", "pie-chart")
//- //- .extra-navigation
//- //- NavigationButton("Statistics", "/statistics", "pie-chart")
//- .hide-landscape
//- NavigationButton("Settings", "/settings", "cog")
//- //- .hide-landscape
//- //- NavigationButton("Settings", "/settings", "cog")
//- .extra-navigation.hide-landscape
//- NavigationButtonNoAJAX("Logout", "/logout", "sign-out")
//- //- .extra-navigation.hide-landscape
//- //- NavigationButtonNoAJAX("Logout", "/logout", "sign-out")
component FuzzySearch
input#search.action(data-action="search", data-trigger="input", type="text", placeholder="Search...", title="Shortcut: F")
//- component NavigationButton(name string, target string, icon string)
//- 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)
a.navigation-link.ajax(href=target, aria-label=name, title=name)
.navigation-button
Icon(icon)
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
//- component NavigationButtonNoAJAX(name string, target string, icon string)
//- a.navigation-link(href=target, aria-label=name)
//- .navigation-button
//- Icon(icon)
//- span.navigation-text= name

View File

@ -42,3 +42,15 @@ component Sidebar(user *arn.User)
SidebarButtonNoAJAX("Logout", "/logout", "sign-out")
else
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
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
button.action.mountable(data-trigger="click", data-action="chargeUp", data-amount=1000)
@ -26,4 +26,4 @@ component Charge(user *arn.User)
Icon("diamond")
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)
// }
total := amount[:len(amount)-2] + "." + amount[len(amount)-2:]
// total := amount[:len(amount)-2] + "." + amount[len(amount)-2:]
// Create payment
p := paypalsdk.Payment{
@ -77,8 +77,8 @@ func CreatePayment(ctx *aero.Context) string {
},
Transactions: []paypalsdk.Transaction{paypalsdk.Transaction{
Amount: &paypalsdk.Amount{
Currency: "USD",
Total: total,
Currency: "JPY",
Total: amount,
},
Description: "Top Up Balance",
}},

View File

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

View File

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