diff --git a/resources/public/css/screen.css b/resources/public/css/screen.css index eb470df..6343efe 100644 --- a/resources/public/css/screen.css +++ b/resources/public/css/screen.css @@ -4,6 +4,11 @@ body { height: 100%; padding-top: 40px; } + +textarea { + height: 350px !important; +} + {% if cljs %} @-moz-keyframes three-quarters-loader { 0% { diff --git a/resources/templates/home.html b/resources/templates/home.html index 30c1125..1b3d4a2 100644 --- a/resources/templates/home.html +++ b/resources/templates/home.html @@ -2,7 +2,14 @@ {% block content %}
- +

Use this form to analyze a e-mail header. Just paste the whole e-mail in raw mode here and hit the analyze button. The e-mail will be analyzed and an visual representation will be generated. Use this tool o analyze e-mail problems or to see which servers, locations and companies the e-mail passed.

+
+ {% csrf-field %} +
+ +
{% endblock %} diff --git a/resources/templates/result.html b/resources/templates/result.html new file mode 100644 index 0000000..ced0cb5 --- /dev/null +++ b/resources/templates/result.html @@ -0,0 +1,3 @@ +This is the result .... + +{{ mailheader }} diff --git a/src/mailhead/routes/home.clj b/src/mailhead/routes/home.clj index fd88adc..a36ca75 100644 --- a/src/mailhead/routes/home.clj +++ b/src/mailhead/routes/home.clj @@ -1,6 +1,6 @@ (ns mailhead.routes.home (:require [mailhead.layout :as layout] - [compojure.core :refer [defroutes GET]] + [compojure.core :refer [defroutes GET POST]] [ring.util.http-response :refer [ok]] [clojure.java.io :as io])) @@ -10,7 +10,11 @@ (defn about-page [] (layout/render "about.html")) +(defn analyze-mailheader [mailheader] + (layout/render "result.html" {:mailheader mailheader})) + (defroutes home-routes (GET "/" [] (home-page)) + (POST "/analyze" [mailheader] (analyze-mailheader mailheader)) (GET "/about" [] (about-page)))