Make support page accessible when logged out
This commit is contained in:
parent
0b9e441d64
commit
136f6f4e7a
@ -10,6 +10,8 @@ component Shop(user *arn.User, items []*arn.Item)
|
|||||||
component ShopTabs(user *arn.User)
|
component ShopTabs(user *arn.User)
|
||||||
.tabs
|
.tabs
|
||||||
Tab("Support", "heart", "/support")
|
Tab("Support", "heart", "/support")
|
||||||
|
|
||||||
|
if user != nil
|
||||||
Tab("Shop", "shopping-cart", "/shop")
|
Tab("Shop", "shopping-cart", "/shop")
|
||||||
Tab("Inventory", "briefcase", "/inventory")
|
Tab("Inventory", "briefcase", "/inventory")
|
||||||
Tab("History", "history", "/shop/history")
|
Tab("History", "history", "/shop/history")
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package support
|
package support
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/aerogo/aero"
|
"github.com/aerogo/aero"
|
||||||
"github.com/animenotifier/notify.moe/components"
|
"github.com/animenotifier/notify.moe/components"
|
||||||
"github.com/animenotifier/notify.moe/utils"
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
@ -11,10 +9,11 @@ import (
|
|||||||
// Get support page.
|
// Get support page.
|
||||||
func Get(ctx *aero.Context) string {
|
func Get(ctx *aero.Context) string {
|
||||||
user := utils.GetUser(ctx)
|
user := utils.GetUser(ctx)
|
||||||
|
profileLink := "/"
|
||||||
|
|
||||||
if user == nil {
|
if user != nil {
|
||||||
return ctx.Error(http.StatusUnauthorized, "Not logged in", nil)
|
profileLink = "/+" + user.Nick
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.Support(user))
|
return ctx.HTML(components.Support(profileLink, user))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
component Support(user *arn.User)
|
component Support(profileLink string, user *arn.User)
|
||||||
ShopTabs(user)
|
ShopTabs(user)
|
||||||
|
|
||||||
h1.mountable Why support us?
|
h1.mountable Why support us?
|
||||||
@ -79,7 +79,7 @@ component Support(user *arn.User)
|
|||||||
|
|
||||||
p.feature-card-text Lastly, activate the freshly bought item in your inventory.
|
p.feature-card-text Lastly, activate the freshly bought item in your inventory.
|
||||||
|
|
||||||
a.feature-card.mountable.ajax(href="/+" + user.Nick)
|
a.feature-card.mountable.ajax(href=profileLink)
|
||||||
.feature-card-icon
|
.feature-card-icon
|
||||||
RawIcon("user-circle")
|
RawIcon("user-circle")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user