mirror of
https://github.com/writeas/writefreely
synced 2025-02-09 12:48:45 +01:00
Show Reader on home route in chorus mode
Ref T681
This commit is contained in:
parent
7b42efb9d9
commit
006b7a86ea
16
app.go
16
app.go
@ -185,26 +185,26 @@ func (app *App) ReqLog(r *http.Request, status int, timeSince time.Duration) str
|
|||||||
return fmt.Sprintf("\"%s %s\" %d %s \"%s\"", r.Method, r.RequestURI, status, timeSince, r.UserAgent())
|
return fmt.Sprintf("\"%s %s\" %d %s \"%s\"", r.Method, r.RequestURI, status, timeSince, r.UserAgent())
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleViewHome shows page at root path. Will be the Pad if logged in and the
|
// handleViewHome shows page at root path. It checks the configuration and
|
||||||
// catch-all landing page otherwise.
|
// authentication state to show the correct page.
|
||||||
func handleViewHome(app *App, w http.ResponseWriter, r *http.Request) error {
|
func handleViewHome(app *App, w http.ResponseWriter, r *http.Request) error {
|
||||||
if app.cfg.App.SingleUser {
|
if app.cfg.App.SingleUser {
|
||||||
// Render blog index
|
// Render blog index
|
||||||
return handleViewCollection(app, w, r)
|
return handleViewCollection(app, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if app.cfg.App.Chorus {
|
||||||
|
// This instance is focused on reading, so show Reader on home route
|
||||||
|
return viewLocalTimeline(app, w, r)
|
||||||
|
}
|
||||||
|
|
||||||
// Multi-user instance
|
// Multi-user instance
|
||||||
forceLanding := r.FormValue("landing") == "1"
|
forceLanding := r.FormValue("landing") == "1"
|
||||||
if !forceLanding {
|
if !forceLanding {
|
||||||
// Show correct page based on user auth status and configured landing path
|
// Show correct page based on user auth status and configured landing path
|
||||||
u := getUserSession(app, r)
|
u := getUserSession(app, r)
|
||||||
if u != nil {
|
if u != nil {
|
||||||
// User is logged in, so show the Pad or Blogs page, depending on config
|
// User is logged in, so show the Pad
|
||||||
if app.cfg.App.SimpleNav {
|
|
||||||
// Simple nav, so home page is Blogs page
|
|
||||||
return viewCollections(app, u, w, r)
|
|
||||||
}
|
|
||||||
// Default config, so home page is editor
|
|
||||||
return handleViewPad(app, w, r)
|
return handleViewPad(app, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user