3c52063ee45e

Moar.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 28 Sep 2011 21:10:06 -0400
parents 8d6cf4d81909
children 78a78bfc7d70
branches/tags (none)
files resources/public/css/style.less src/newseasons/models/users.clj src/newseasons/templates/main.clj src/newseasons/views/main.clj

Changes

--- a/resources/public/css/style.less	Wed Sep 28 21:02:32 2011 -0400
+++ b/resources/public/css/style.less	Wed Sep 28 21:10:06 2011 -0400
@@ -20,3 +20,8 @@
         }
     }
 }
+section.message {
+    border-bottom: 2px solid #ddd;
+    margin-top: -12px;
+    margin-bottom: 32px;
+}
--- a/src/newseasons/templates/main.clj	Wed Sep 28 21:02:32 2011 -0400
+++ b/src/newseasons/templates/main.clj	Wed Sep 28 21:10:06 2011 -0400
@@ -1,4 +1,5 @@
 (ns newseasons.templates.main
+  (:require [noir.session :as sess])
   (:use noir.core
         hiccup.core
         hiccup.page-helpers
@@ -27,6 +28,9 @@
               [:body
                [:div.container.clearfix
                 [:header.sixteen.columns [:h1 (link-to "/" "New Seasons")]]
+                (when-let [message (sess/flash-get)]
+                  [:section.message.sixteen.columns
+                   [:p message]])
                 content
                 [:footer.sixteen.columns
                  [:p
--- a/src/newseasons/views/main.clj	Wed Sep 28 21:02:32 2011 -0400
+++ b/src/newseasons/views/main.clj	Wed Sep 28 21:10:06 2011 -0400
@@ -2,6 +2,7 @@
   (:require [newseasons.templates.main :as t])
   (:use noir.core)
   (:require [noir.response :as resp])
+  (:require [noir.session :as sess])
   (:require [clj-http.client :as client])
   (:use [cheshire.core :only (parse-string)]))
 
@@ -43,7 +44,6 @@
 
 
 ; Search ----------------------------------------------------------------------
-
 (defpage [:get "/search"] {:keys [query]}
          ; TODO: Images.
          (let [results (itunes-search-show query)
@@ -54,4 +54,5 @@
 
 ; Add -------------------------------------------------------------------------
 (defpage [:post "/add"] {:as show}
+         (sess/flash-put! "Added a show to your list.")
          (resp/redirect "/"))