Added a watch/unwatch button to user pages.
[zzz-floof.git] / floof / templates / base.mako
index 19f8455..60e8adb 100644 (file)
 <div id="header">
 <a href="${h.url_for("/")}">Home</a>
 
-${h.form (h.url_for(controller="search", action="results"))}
-${h.text('query')} ${h.submit('search','Search')}
+% if c.user:
+| <a href="${h.url("new_art")}">Add Art</a>
+| <a href="${h.url_for(controller="search", action="list")}">Your Searches</a>
+| <a href="${h.url_for(controller="art", action="watchstream", name=c.user.name.lower())}">Watchstream</a>
+## | <a href="${h.url_for("/users/"+c.user}">Your Page</a>
+% endif
+
+${h.form(url('search'), method='GET')}
+${h.text('query', c.query)}
+${h.submit('button', 'Search')}
+
+% if c.user:
+${h.submit('button', 'Save')}
+% endif
+
+## Note: should probably only display "save" when we're on a results page
+## Also, what if we had it save a hidden form containing the search result that was
+## actually rendered?  Might be confusing though.
 ${h.end_form()}
 
     <div id="user">
         % if c.user:
-        <p>Logged in as ${c.user.name}</p>
+        <form action="${url(controller='account', action='logout')}" method="POST">
+        <p>Logged in as <a href="${h.url('user_page', name=c.user.name.lower())}">${c.user.name}</a>.  ${h.submit(None, 'Log out')}</p>
+        </form>
         % else:
         <form action="${url(controller='account', action='login_begin')}" method="POST">
         <p>
@@ -29,6 +47,17 @@ ${h.end_form()}
 
 
 </div>
+
+<% messages = h.flash.pop_messages() %>
+% if messages:
+<ul id="flash-messages">
+    % for message in messages:
+    <li>${message}</li>
+    % endfor
+</ul>
+% endif
+
+
 <div id="body">
 ${next.body()}
 </div>