From b7ddc0a4437e85508802899fa270c6a32e9378ed Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sun, 22 Jul 2018 09:24:37 +0100 Subject: [PATCH] Servlet-context fixes --- resources/templates/base.html | 3 --- resources/templates/call-me.html | 2 +- resources/templates/issue-expert/list.html | 5 +---- resources/templates/login.html | 2 +- resources/templates/{about.html => md.html} | 2 +- resources/templates/roles.html | 2 +- resources/templates/untitled.html | 0 src/clj/youyesyet/routes/home.clj | 4 ++-- src/clj/youyesyet/routes/logged_in.clj | 5 ++--- 9 files changed, 9 insertions(+), 16 deletions(-) rename resources/templates/{about.html => md.html} (85%) delete mode 100644 resources/templates/untitled.html diff --git a/resources/templates/base.html b/resources/templates/base.html index 26ecb00..54b4f02 100644 --- a/resources/templates/base.html +++ b/resources/templates/base.html @@ -63,9 +63,6 @@ {% endblock %} -

- User: {{user}} -


{% block foot %} diff --git a/resources/templates/call-me.html b/resources/templates/call-me.html index bb2414e..d24f4b6 100644 --- a/resources/templates/call-me.html +++ b/resources/templates/call-me.html @@ -3,7 +3,7 @@

Use this form to request someone to phone you to discuss your concerns about independence.

-
+ {% csrf-field %}

diff --git a/resources/templates/issue-expert/list.html b/resources/templates/issue-expert/list.html index 629fc72..0cd0efc 100644 --- a/resources/templates/issue-expert/list.html +++ b/resources/templates/issue-expert/list.html @@ -1,7 +1,4 @@ {% extends "base.html" %} - - {% block back-links %}

@@ -31,7 +28,7 @@ Add a new Followuprequest {% endblock %} {% block content %} - + {% csrf-field %} diff --git a/resources/templates/login.html b/resources/templates/login.html index d813e31..25550d0 100644 --- a/resources/templates/login.html +++ b/resources/templates/login.html @@ -11,7 +11,7 @@ {% endblock %} {% block content %} - + {% csrf-field %}

Or use a test username and password diff --git a/resources/templates/about.html b/resources/templates/md.html similarity index 85% rename from resources/templates/about.html rename to resources/templates/md.html index 0812752..0421e30 100644 --- a/resources/templates/about.html +++ b/resources/templates/md.html @@ -2,6 +2,6 @@ {% block big-links %} {% endblock %} {% block content %} -{{motd|safe}} +{{content|safe}} {% endblock %} diff --git a/resources/templates/roles.html b/resources/templates/roles.html index 0cc87ea..5e81c44 100644 --- a/resources/templates/roles.html +++ b/resources/templates/roles.html @@ -5,7 +5,7 @@ {% block big-links %} {% for role in roles %} {% endfor %} {% endblock %} diff --git a/resources/templates/untitled.html b/resources/templates/untitled.html deleted file mode 100644 index e69de29..0000000 diff --git a/src/clj/youyesyet/routes/home.clj b/src/clj/youyesyet/routes/home.clj index 68408f5..896e7e1 100644 --- a/src/clj/youyesyet/routes/home.clj +++ b/src/clj/youyesyet/routes/home.clj @@ -49,9 +49,9 @@ (defn about-page [] - (layout/render "about.html" {:title + (layout/render "md.html" {:title (str "About " (:site-title env)) - :motd (md-to-html-string (slurp (io/resource "about.md")))})) + :content (md-to-html-string (slurp (io/resource "about.md")))})) (defn call-me-page [request] diff --git a/src/clj/youyesyet/routes/logged_in.clj b/src/clj/youyesyet/routes/logged_in.clj index 8c33dc6..cb97171 100644 --- a/src/clj/youyesyet/routes/logged_in.clj +++ b/src/clj/youyesyet/routes/logged_in.clj @@ -115,7 +115,7 @@ (defn handle-logout [request] - (let [r (response/found "home")] + (let [r (response/found (str (:servlet-context request) "/home"))] (assoc r :session (dissoc (:session r) :user)))) @@ -123,5 +123,4 @@ (defroutes logged-in-routes (GET "/logout" request (handle-logout request)) (GET "/profile" request (route/restricted (profile-page request))) - (GET "/app" [request] (route/restricted (app-page request))) - ) + (GET "/app" [request] (route/restricted (app-page request))))