Procházet zdrojové kódy

Add current path to the global context

master
Dejan Strbac před 4 roky
committed by Simon Ser
rodič
revize
83a5132d15
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: FDE7BE0E88F5E48
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. +4
    -0
      template.go

+ 4
- 0
template.go Zobrazit soubor

@@ -14,6 +14,8 @@ const themesDir = "themes"

// GlobalRenderData contains data available in all templates.
type GlobalRenderData struct {
Path string

LoggedIn bool

// if logged in
@@ -70,6 +72,8 @@ func NewBaseRenderData(ctx *Context) *BaseRenderData {
global.Username = ctx.Session.username
}

global.Path = ctx.Request().URL.String()

return &BaseRenderData{
GlobalData: global,
Extra: make(map[string]interface{}),


Načítá se…
Zrušit
Uložit