Permalink
Browse files

Merge branch 'hotfix/1.4.3.2'

  • Loading branch information...
2 parents 04d857c + c1f8a65 commit f46bd4aeadee92a1b3de6b8aa937f6debc2c7be4 @amalloy amalloy committed Oct 1, 2011
Showing with 21 additions and 18 deletions.
  1. +1 −1 project.clj
  2. +2 −1 src/foreclojure/static.clj
  3. +18 −16 src/foreclojure/utils.clj
View
@@ -1,4 +1,4 @@
-(defproject foreclojure "1.4.3.1"
+(defproject foreclojure "1.4.3.2"
:description "4clojure - a website for lisp beginners"
:dependencies [[clojure "1.2.1"]
[clojure-contrib "1.2.0"]
@@ -2,6 +2,7 @@
(:use [compojure.core :only [defroutes GET]]
[foreclojure.problems :only [solved-stats]]
[foreclojure.config :only [repo-url]]
+ [foreclojure.utils :only [static-url]]
[foreclojure.template :only [def-page]]))
(def df
@@ -30,7 +31,7 @@
[:div
[:h3 "So wait, I can't buy cheap real estate here?"]
[:p "At this time, 4clojure.com does not provide information regarding the sale of foreclosed homes, and has no plans of doing so in the future."]]
- [:img {:src "/images/PoweredMongoDBbeige50.png"
+ [:img {:src (static-url "/images/PoweredMongoDBbeige50.png")
:alt "Powered by MongoDB"
:width 129 :height 61}]]})
View
@@ -82,22 +82,6 @@
([m ks f & args]
(maybe-update m ks #(apply f % args))))
-(defn image-builder
- "Return a function for constructing an [:img] element from a keyword.
-
- data should be a map from image \"names\" to pairs [src, alt]. The function
- returned by image-builder will look up its argument as an image name, and
- return an img element with the appropriate src and alt attributes.
-
- Optionally, additional keyword arguments :alt and :src may be supplied to
- image-builder - these functions will be called to transform the alt and src
- attributes of the returned img."
- [data & {:keys [alt src] :or {alt identity, src identity}}]
- (fn [key]
- (let [[src-prop alt-prop] (get data key)]
- [:img {:src (src src-prop)
- :alt (alt alt-prop)}])))
-
(defn login-url
([] (login-url *url*))
([location]
@@ -189,6 +173,24 @@
(def js (wrap-versioning hiccup/include-js))
(def css (wrap-versioning hiccup/include-css)))
+
+
+(defn image-builder
+ "Return a function for constructing an [:img] element from a keyword.
+
+ data should be a map from image \"names\" to pairs [src, alt]. The function
+ returned by image-builder will look up its argument as an image name, and
+ return an img element with the appropriate src and alt attributes.
+
+ Optionally, additional keyword arguments :alt and :src may be supplied to
+ image-builder - these functions will be called to transform the alt and src
+ attributes of the returned img."
+ [data & {:keys [alt src] :or {alt identity, src identity}}]
+ (fn [key]
+ (let [[src-prop alt-prop] (get data key)]
+ [:img {:src (src (static-url src-prop))
+ :alt (alt alt-prop)}])))
+
(defn form-row [[type name info value]]
[:tr
[:td (label name info)]

0 comments on commit f46bd4a

Please sign in to comment.