Permalink
Browse files

Associate checked state defaults with feed list. Use labels after che…

…ckboxes, adjust CSS.
  • Loading branch information...
1 parent fa16ed1 commit 8581b47c29a8638c1cb2e57bd7a1ce65c80f9bd2 @thorwil committed Oct 30, 2011
Showing with 24 additions and 17 deletions.
  1. +8 −4 src/tlog/conf.clj
  2. +5 −4 src/tlog/views/html.clj
  3. +1 −5 src/tlog/views/utility.clj
  4. +10 −4 war/main.css
View
@@ -37,7 +37,11 @@
;; Used in html.clj:
;; Feeds of selected articles will change rarely, if ever, so they are hard-coded:
-(def feeds '[journal
- planet-ubuntu ;; http://planet.ubuntu.com/
- planet-linuxaudio ;; http://planet.linuxaudio.org/
- graphicsplanet]) ;; http://www.graphicsplanet.org/
+;; (def feeds '[journal
+;; planet-ubuntu ;; http://planet.ubuntu.com/
+;; planet-linuxaudio ;; http://planet.linuxaudio.org/
+;; graphicsplanet]) ;; http://www.graphicsplanet.org/
+(def feeds (array-map "journal" true
+ "planet-ubuntu" true ;; http://planet.ubuntu.com/
+ "planet-linuxaudio" false ;; http://planet.linuxaudio.org/
+ "graphicsplanet" false)) ;; http://www.graphicsplanet.org/
View
@@ -144,7 +144,7 @@
(html
[:script "var serverNow = " (System/currentTimeMillis) ";"]
[:script {:src "/scripts/time.js"}]))
- :collected-scripts)
+ :collected-scripts)
(def option-footer
{:option-footer
@@ -402,9 +402,10 @@
[]
[:fieldset
[:legend "Include in the following feeds:"]
- (mapcat #(html [:input (into {:type "checkbox"}
- (when %1 {:checked "checked"}))
- %2]) true-before-falses conf/feeds)])
+ (for [[label checked] conf/feeds]
+ [:input (into {:type "checkbox" :name label}
+ (when checked {:checked "checked"}))
+ [:label label]])])
(defhtml article-form-rendition
[_]
@@ -44,8 +44,4 @@
(def ms-to-day (ms-to* "yyyy-MM-dd"))
(def ms-to-day-time (ms-to* "yyyy-MM-dd '<span class=\"hour-minute\">'H:mm'</span>'"))
(def ms-to-datetime (ms-to* "yyyy-MM-dd'T'H:mm:ss'+00:00'"))
-(def ms-to-rfc-3339 (ms-to* "yyyy-MM-dd'T'HH:mm:ssZ")) ;; as required for Atom feeds
-
-(def true-before-falses
- "Lazy list of true followed by infinte times false."
- (lazy-cat [true] (repeat false)))
+(def ms-to-rfc-3339 (ms-to* "yyyy-MM-dd'T'HH:mm:ssZ")) ;; as required for Atom feeds
View
@@ -209,16 +209,22 @@ a.comment-anchor {
p#slug * {
margin-top:1.3em;
}
-label {
- margin-right:1ex;
-}
table.form {
border-collapse:collapse;
margin-top:-0.2em;
}
-label:after {
+label {
+ margin-right:1ex;
+}
+input+label {
+ margin-right:1.5em;
+}
+label:after { /* colon after labels ... */
content:":";
}
+input+label:after { /* ... but not for labels following inputs */
+ content:"";
+}
input {
font-size:100%;
margin-right:0.5ex!important; /* has to top ext.js CSS */

0 comments on commit 8581b47

Please sign in to comment.