aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2009-03-01 13:59:31 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2009-03-01 13:59:31 +0100
commit97a850b1d882e6eb9400601734f0856e8f36fd3e (patch)
tree984c7a26fa1f134fe7c36d06f164e9cebb010812
parentf3342af8c57225091ff32d6747a45783df62f9c3 (diff)
Apply a column-based layout to the main page via CSS.
-rw-r--r--cljssss-g.clj3
-rw-r--r--header.st1
-rw-r--r--index.st12
-rw-r--r--public/layout.css50
4 files changed, 62 insertions, 4 deletions
diff --git a/cljssss-g.clj b/cljssss-g.clj
index ad466d0..159cd48 100644
--- a/cljssss-g.clj
+++ b/cljssss-g.clj
@@ -124,6 +124,7 @@
feed
active-entry-id))
"active_feed_id" feed
+ "active_feed_title" (and feed (select-feed-name feed user))
"title" "Subscriptions"})))))
(defmacro with-session
@@ -160,6 +161,8 @@
(with-session (show-subscriptions (session :id) (params :feed) nil)))
(GET "/entries/*"
(with-session (show-subscriptions (session :id) (params :feed) 5)))
+ (GET "/layout.css"
+ (serve-file "layout.css"))
(ANY "*"
(page-not-found)))
diff --git a/header.st b/header.st
index 146addf..2f56d2d 100644
--- a/header.st
+++ b/header.st
@@ -5,6 +5,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$title$ &mdash; G&ouml;del-Gentzen Clojure Syndication Services Super System</title>
+ <link rel="stylesheet" href="/layout.css" type="text/css" />
</head>
<body>
diff --git a/index.st b/index.st
index c00eea9..ffd8aee 100644
--- a/index.st
+++ b/index.st
@@ -2,18 +2,21 @@ $header(title=title)$
<h1 class="title">$title$</h1>
+<div id="feed-list-container">
<div id="feed-list">
<h2>Feeds</h2>
- <ul>
+ <ul>
$feeds:{feed |
<li><a href="/?feed=$feed.id$">$feed.title$</a></li>
}$
- </ul>
+ </ul>
+</div>
</div>
$if(entries)$
+<div id="feed-content-container">
<div id="feed-content">
- <h2>Entries</h2>
+ <h2>$active_feed_title$</h2>
<ul>
$entries:{entry |
$if(entry.active_p)$
@@ -22,9 +25,10 @@ $if(entries)$
$else$
<li><a id="entry-$entry.id$" href="/entries/$entry.id$?feed=$active_feed_id$#entry-$entry.id$">$entry.title$</a></li>
$endif$
- }$
+ }$
</ul>
</div>
+</div>
$endif$
$footer()$
diff --git a/public/layout.css b/public/layout.css
new file mode 100644
index 0000000..2b47eb3
--- /dev/null
+++ b/public/layout.css
@@ -0,0 +1,50 @@
+/* -*- mode: css -*- */
+
+h1 {
+ font-size: 2em;
+ margin: 0 0 0.75em 0.75em;
+}
+
+#feed-list-container {
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 30%;
+ bottom: 0;
+ overflow: auto;
+ clear: none;
+ float: left;
+ z-index: 0;
+}
+
+#feed-list {
+ position: relative;
+ margin: 0 5px 0 5px;
+ padding: 0 5px 0 5px;
+ top: 3.5em;
+ border: 1px solid #888;
+
+}
+
+body {
+ /* width: 80%; */
+ margin: 10px;
+}
+
+#feed-content-container {
+ position: absolute;
+ /* width: 70%; */
+ top: 0;
+ left: 30%;
+ right: 0;
+ display: block;
+ z-index: 1;
+}
+
+#feed-content {
+ padding: 0 5px 0 5px;
+ margin: 0 5px 0 5px;
+ position: relative;
+ top: 3.5em;
+ border: solid 1px #888;
+}