changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Make left sidebar into a list of handlers.

changeset 327: b57d9377edf9
parent 326: 9de1c7f5672a
child 328: 6cc3ea4c97b3
author: uriel@engel.se.cat-v.org
date: Sat, 17 Jan 2009 03:05:19 +0100
files: bin/werc.rc lib/default_master.tpl
description: Make left sidebar into a list of handlers.
     1.1--- a/bin/werc.rc	Sat Jan 17 03:04:43 2009 +0100
     1.2+++ b/bin/werc.rc	Sat Jan 17 03:05:19 2009 +0100
     1.3@@ -26,7 +26,9 @@
     1.4 }
     1.5 
     1.6 # Sidebar 
     1.7-fn gensidebar {
     1.8+fn nav_tree {
     1.9+    if(! ~ $#sideBarNavTitle 0)
    1.10+        echo '<p class="sideBarTitle">'$"sideBarNavTitle':</p>'
    1.11     # Ignore stderr, last path element might be a file that doesn't exist (eg., foo for foo.md)
    1.12     # /./ to deal with p9p's ls failure to follow dir symlinks otherwise
    1.13     ls -F $sitedir/./$req_paths_list >[2]/dev/null \
    1.14@@ -135,7 +137,7 @@
    1.15 headers=lib/headers.tpl
    1.16 master_template=default_master.tpl
    1.17 res_tail='</body></html>'
    1.18-sidebar=sidebar
    1.19+ll_add handlers_bar_left nav_tree
    1.20 werc_root=`{pwd}
    1.21 for(i in siteTitle siteSubTitle pageTitle extraHeaders)
    1.22     $i = ''
     2.1--- a/lib/default_master.tpl	Sat Jan 17 03:04:43 2009 +0100
     2.2+++ b/lib/default_master.tpl	Sat Jan 17 03:05:19 2009 +0100
     2.3@@ -13,33 +13,17 @@
     2.4     </div>
     2.5 </div>
     2.6 
     2.7-% if(! ~ $#sidebar 0) {
     2.8-<div id="side-bar">
     2.9-
    2.10-<div>
    2.11 %{
    2.12-if(! ~ $#sideBarNavTitle 0)
    2.13-    echo '<p class="sideBarTitle">'$"sideBarNavTitle':</p>'
    2.14-
    2.15-gensidebar
    2.16-
    2.17+if(! ~ $#handlers_bar_left 0) {
    2.18+    echo '<div id="side-bar">'
    2.19+    for(h in $handlers_bar_left) {
    2.20+        echo '<div>'
    2.21+        run_handler $$h
    2.22+        echo '</div>'
    2.23+    }
    2.24+    echo '<div><!-- Bottom filler div --></div> </div>'
    2.25+}
    2.26 %}
    2.27-</div>
    2.28-
    2.29-% if(! ~ $#wiki 0 && test -f $local_path.md  && check_user $wiki_editors_group) {
    2.30-<div> 
    2.31-    <form action="/_apps/dirdir/edit" method="POST">
    2.32-        <input type="hidden" name="edit_wiki_page" value="%($req_path%)" />
    2.33-        <input type="submit" name="" value="Edit page" />
    2.34-    </form>
    2.35-</div>
    2.36-% }
    2.37-
    2.38-<div>
    2.39-</div>
    2.40-
    2.41-</div>
    2.42-% }
    2.43 
    2.44 <div id="main-copy">
    2.45