2021-11-22 13:00:19 +00:00
|
|
|
package handler
|
|
|
|
|
|
2021-12-02 20:41:17 +00:00
|
|
|
import (
|
2021-12-22 11:04:24 +00:00
|
|
|
"github.com/gorilla/csrf"
|
2021-12-02 20:41:17 +00:00
|
|
|
"net/http"
|
|
|
|
|
"status/model"
|
|
|
|
|
)
|
2021-11-22 13:00:19 +00:00
|
|
|
|
|
|
|
|
func (h *Handler) showNewStatusView(w http.ResponseWriter, r *http.Request) {
|
2021-12-06 06:14:20 +00:00
|
|
|
protectClickJacking(w)
|
2021-11-24 06:30:19 +00:00
|
|
|
_, err := h.getUser(r)
|
2021-11-22 13:00:19 +00:00
|
|
|
if err != nil {
|
2021-12-10 17:56:41 +00:00
|
|
|
unauthorized(w, r)
|
2021-11-22 13:00:19 +00:00
|
|
|
return
|
|
|
|
|
}
|
2021-12-22 11:04:24 +00:00
|
|
|
h.view("create_status").Execute(w, map[string]interface{}{"status": &model.Status{}, csrf.TemplateTag: csrf.TemplateField(r)})
|
2021-11-22 13:00:19 +00:00
|
|
|
}
|