online help facility
This commit is contained in:
parent
6df0094a68
commit
3c2088bac9
|
@ -52,6 +52,8 @@ table.results { margin-top: 1em;
|
||||||
margin-left: 2em;
|
margin-left: 2em;
|
||||||
font-size: smaller; }
|
font-size: smaller; }
|
||||||
|
|
||||||
|
img { max-width: 100%; }
|
||||||
|
|
||||||
/* Header and footer lines. */
|
/* Header and footer lines. */
|
||||||
|
|
||||||
table.head { width: 100%;
|
table.head { width: 100%;
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
<li><a href="/hfcs">hfcs</a>
|
<li><a href="/hfcs">hfcs</a>
|
||||||
<li><a href="/funzone">funzone</a>
|
<li><a href="/funzone">funzone</a>
|
||||||
<li><a href="/account">account</a>
|
<li><a href="/account">account</a>
|
||||||
|
<li><a href="/help/honk.1.html">help</a>
|
||||||
<li>
|
<li>
|
||||||
<form action="/q" method="GET">
|
<form action="/q" method="GET">
|
||||||
<input type="text" name="q" autocomplete=off size=10 placeholder="search">
|
<input type="text" name="q" autocomplete=off size=10 placeholder="search">
|
||||||
|
|
6
web.go
6
web.go
|
@ -1449,6 +1449,11 @@ func serveasset(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Cache-Control", "max-age=7776000")
|
w.Header().Set("Cache-Control", "max-age=7776000")
|
||||||
http.ServeFile(w, r, "views"+r.URL.Path)
|
http.ServeFile(w, r, "views"+r.URL.Path)
|
||||||
}
|
}
|
||||||
|
func servehelp(w http.ResponseWriter, r *http.Request) {
|
||||||
|
name := mux.Vars(r)["name"]
|
||||||
|
w.Header().Set("Cache-Control", "max-age=0")
|
||||||
|
http.ServeFile(w, r, "docs/" + name)
|
||||||
|
}
|
||||||
func servehtml(w http.ResponseWriter, r *http.Request) {
|
func servehtml(w http.ResponseWriter, r *http.Request) {
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
err := readviews.Execute(w, r.URL.Path[1:]+".html", templinfo)
|
err := readviews.Execute(w, r.URL.Path[1:]+".html", templinfo)
|
||||||
|
@ -1615,6 +1620,7 @@ func serve() {
|
||||||
getters.HandleFunc("/login", servehtml)
|
getters.HandleFunc("/login", servehtml)
|
||||||
posters.HandleFunc("/dologin", login.LoginFunc)
|
posters.HandleFunc("/dologin", login.LoginFunc)
|
||||||
getters.HandleFunc("/logout", login.LogoutFunc)
|
getters.HandleFunc("/logout", login.LogoutFunc)
|
||||||
|
getters.HandleFunc("/help/{name:[[:alnum:]_.-]+}", servehelp)
|
||||||
|
|
||||||
loggedin := mux.NewRoute().Subrouter()
|
loggedin := mux.NewRoute().Subrouter()
|
||||||
loggedin.Use(login.Required)
|
loggedin.Use(login.Required)
|
||||||
|
|
Loading…
Reference in New Issue