Start with a simple GUI

This commit is contained in:
Aaron Fischer 2015-12-05 11:31:48 +01:00
parent 21ca97bb75
commit edbc2d432d
4 changed files with 21 additions and 2 deletions

View file

@ -4,6 +4,11 @@ body {
height: 100%;
padding-top: 40px;
}
textarea {
height: 350px !important;
}
{% if cljs %}
@-moz-keyframes three-quarters-loader {
0% {

View file

@ -2,7 +2,14 @@
{% block content %}
<div class="row">
<div class="span12">
<img src="http://tclhost.com/eCel6N8.gif">
<p>Use this form to analyze a e-mail header. Just paste the whole e-mail in <strong>raw mode</strong> 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.</p>
<form action="/analyze" method="post">
{% csrf-field %}
<textarea class="form-control" name="mailheader">
Paste here your E-Mail in source format (with headers)
</textarea><br>
<input class="btn btn-success form-control" type="submit" name="send" value="Analyze the header">
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,3 @@
This is the result ....
{{ mailheader }}

View file

@ -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)))