This commit is contained in:
parent
f163a24279
commit
5cc70cc656
@ -89,7 +89,7 @@ func MakeMux(argv *args.Arguments, dbConn *sql.DB) *http.ServeMux {
|
|||||||
LogRequestContinuation(requestContext, r, w)(template.TemplateContinuation(templateFile, true), FailurePassingContinuation)(LogExecutionTimeContinuation, LogExecutionTimeContinuation)(IdContinuation, IdContinuation)
|
LogRequestContinuation(requestContext, r, w)(template.TemplateContinuation(templateFile, true), FailurePassingContinuation)(LogExecutionTimeContinuation, LogExecutionTimeContinuation)(IdContinuation, IdContinuation)
|
||||||
})
|
})
|
||||||
|
|
||||||
mux.HandleFunc("GET /chat", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("POST /chat/me", func(w http.ResponseWriter, r *http.Request) {
|
||||||
requestContext := makeRequestContext()
|
requestContext := makeRequestContext()
|
||||||
LogRequestContinuation(requestContext, r, w)(chat.ValidateFren, FailurePassingContinuation)(template.TemplateContinuation("chat.html", true), FailurePassingContinuation)(LogExecutionTimeContinuation, LogExecutionTimeContinuation)(IdContinuation, IdContinuation)
|
LogRequestContinuation(requestContext, r, w)(chat.ValidateFren, FailurePassingContinuation)(template.TemplateContinuation("chat.html", true), FailurePassingContinuation)(LogExecutionTimeContinuation, LogExecutionTimeContinuation)(IdContinuation, IdContinuation)
|
||||||
})
|
})
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
<p>please use this if you know who i am and know how to use this but need to get ahold of me while im away from computers.</p>
|
<p>please use this if you know who i am and know how to use this but need to get ahold of me while im away from computers.</p>
|
||||||
<form action="/chat" method="GET" autocomplete="off">
|
<form action="/chat/me" method="POST" autocomplete="off">
|
||||||
<label for="fren_id">fren id.</label>
|
<label for="fren_id">fren id.</label>
|
||||||
<input type="text" id="fren_id" name="fren_id">
|
<input type="password" id="fren_id" name="fren_id">
|
||||||
<input type="submit" value="login.">
|
<input type="submit" value="login.">
|
||||||
</form>
|
</form>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
<div id="chat-container" class="chat-container">
|
<div id="chat-container" class="chat-container">
|
||||||
|
{{ if (eq (len .Messages) 0) }}
|
||||||
|
<p>nothing here so far...</p>
|
||||||
|
{{ end }}
|
||||||
{{ range $message := .Messages }}
|
{{ range $message := .Messages }}
|
||||||
<div class="message {{if $message.FrenSent}}fren{{end}}">
|
<div class="message {{if $message.FrenSent}}fren{{end}}">
|
||||||
<div class="message-text {{if $message.FrenSent}}fren{{end}}">
|
<div class="message-text {{if $message.FrenSent}}fren{{end}}">
|
||||||
|
Loading…
Reference in New Issue
Block a user