add search form to menu, remove styling from inputs/selects other than the submit button
authorTero Marttila <terom@fixme.fi>
Sun, 08 Feb 2009 04:59:22 +0200
changeset 49 aaa62c8e5bd5
parent 48 7858b7b8ffe3
child 50 f13cf27a360b
add search form to menu, remove styling from inputs/selects other than the submit button
handlers.py
static/irclogs.css
templates/channel.tmpl
urls.py
--- a/handlers.py	Sun Feb 08 04:41:00 2009 +0200
+++ b/handlers.py	Sun Feb 08 04:59:22 2009 +0200
@@ -59,7 +59,7 @@
     else :
         raise http.ResponseError("Unknown filetype %r" % format)
 
-def channel_search (request, channel) :
+def channel_search (request, channel, q) :
     """
         Display the search form for the channel for GET, or do the search for POST
     """
--- a/static/irclogs.css	Sun Feb 08 04:41:00 2009 +0200
+++ b/static/irclogs.css	Sun Feb 08 04:59:22 2009 +0200
@@ -79,21 +79,17 @@
     margin: 0px;
 }
 
-#menu form select,
-#menu form input {
+#menu form input[type=submit] {
     padding: 9px;
     margin: 0px;
 
     border: none;
     background-color: inherit;
-}
 
-#menu form input {
     cursor: pointer;
 }
 
-#menu form select:hover,
-#menu form input:hover {
+#menu form input[type=submit]:hover {
     background-color: #d0d0d0;
 }
 
--- a/templates/channel.tmpl	Sun Feb 08 04:41:00 2009 +0200
+++ b/templates/channel.tmpl	Sun Feb 08 04:59:22 2009 +0200
@@ -32,7 +32,14 @@
 
     <li><a href="#">Browse by Date</a></li>
 
-    <li><a href="#">Search</a></li>
+    <li>
+        <form action="${urls.channel_search.build(req, channel=channel.id)}" method="GET">
+            <label for="q">Search:</label>
+
+            <input name="q"></input>
+            <input type="submit" value="Go &raquo;" />
+        </form>
+    </li>
 
     <li><a href="#">[RSS]</a></li>
 </ul>
--- a/urls.py	Sun Feb 08 04:41:00 2009 +0200
+++ b/urls.py	Sun Feb 08 04:59:22 2009 +0200
@@ -29,7 +29,7 @@
 channel_select  = url('/channel_select/?channel:cid',                                   handlers.channel_select         )
 channel_view    = url('/channels/{channel:cid}/?count:str=10',                          handlers.channel_view           )
 channel_last    = url('/channels/{channel:cid}/last/{count:int=100}/{format=html}',     handlers.channel_last           )
-channel_search  = url('/channels/{channel:cid}/search',                                 handlers.channel_search         )
+channel_search  = url('/channels/{channel:cid}/search/?q',                               handlers.channel_search         )
 
 # mapper
 mapper = URLTree(