Quellcode durchsuchen

Support dedicated signup page in chorus mode

This adds a Sign Up link to site navigation and shows the
otherwise-landing page on /signup when in chorus mode.

Ref T681
pull/157/head
Matt Baer vor 4 Jahren
Ursprung
Commit
f821dbaac4
4 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
  1. +6
    -0
      app.go
  2. +1
    -0
      routes.go
  3. +1
    -0
      templates/base.tmpl
  4. +1
    -0
      templates/user/include/header.tmpl

+ 6
- 0
app.go Datei anzeigen

@@ -213,6 +213,12 @@ func handleViewHome(app *App, w http.ResponseWriter, r *http.Request) error {
}
}

return handleViewLanding(app, w, r)
}

func handleViewLanding(app *App, w http.ResponseWriter, r *http.Request) error {
forceLanding := r.FormValue("landing") == "1"

p := struct {
page.StaticPage
Flashes []template.HTML


+ 1
- 0
routes.go Datei anzeigen

@@ -150,6 +150,7 @@ func InitRoutes(apper Apper, r *mux.Router) *mux.Router {

// Handle special pages first
write.HandleFunc("/login", handler.Web(viewLogin, UserLevelNoneRequired))
write.HandleFunc("/signup", handler.Web(handleViewLanding, UserLevelNoneRequired))
write.HandleFunc("/invite/{code}", handler.Web(handleViewInvite, UserLevelNoneRequired)).Methods("GET")
// TODO: show a reader-specific 404 page if the function is disabled
write.HandleFunc("/read", handler.Web(viewLocalTimeline, UserLevelReader))


+ 1
- 0
templates/base.tmpl Datei anzeigen

@@ -38,6 +38,7 @@
<nav class="tabs">
<a href="/about"{{if eq .Path "/about"}} class="selected"{{end}}>About</a>
{{if and (and (not .SingleUser) .LocalTimeline) .CanViewReader}}<a href="/read"{{if eq .Path "/read"}} class="selected"{{end}}>Reader</a>{{end}}
{{if and (and (and (not .SingleUser) .Chorus) .OpenRegistration) (not .Username)}}<a href="/signup"{{if eq .Path "/signup"}} class="selected"{{end}}>Sign up</a>{{end}}
{{if and (not .SingleUser) (not .Username)}}<a href="/login"{{if eq .Path "/login"}} class="selected"{{end}}>Log in</a>{{else if .SimpleNav}}<a href="/me/logout">Log out</a>{{end}}
</nav>
{{if .SimpleNav}}{{if .Username}}<div class="right-side" style="font-size: 0.86em;">


+ 1
- 0
templates/user/include/header.tmpl Datei anzeigen

@@ -47,6 +47,7 @@
{{if .SimpleNav}}
<a href="/about">About</a>
{{if and (and (not .SingleUser) .LocalTimeline) .CanViewReader}}<a href="/read">Reader</a>{{end}}
{{if and (and (and (not .SingleUser) .Chorus) .OpenRegistration) (not .Username)}}<a href="/signup"{{if eq .Path "/signup"}} class="selected"{{end}}>Sign up</a>{{end}}
{{if .Username}}<a href="/me/logout">Log out</a>{{else}}<a href="/login">Log in</a>{{end}}
{{else}}
<a href="/me/c/"{{if eq .Path "/me/c/"}} class="selected"{{end}}>Blogs</a>


Laden…
Abbrechen
Speichern