Make left sidebar into a list of handlers.
This commit is contained in:
parent
85cf543972
commit
6aac4ce54c
@ -26,7 +26,9 @@ fn hide_paths {
|
||||
}
|
||||
|
||||
# Sidebar
|
||||
fn gensidebar {
|
||||
fn nav_tree {
|
||||
if(! ~ $#sideBarNavTitle 0)
|
||||
echo '<p class="sideBarTitle">'$"sideBarNavTitle':</p>'
|
||||
# Ignore stderr, last path element might be a file that doesn't exist (eg., foo for foo.md)
|
||||
# /./ to deal with p9p's ls failure to follow dir symlinks otherwise
|
||||
ls -F $sitedir/./$req_paths_list >[2]/dev/null \
|
||||
@ -135,7 +137,7 @@ path=(. $PLAN9/bin ./bin/ /bin/ /usr/bin)
|
||||
headers=lib/headers.tpl
|
||||
master_template=default_master.tpl
|
||||
res_tail='</body></html>'
|
||||
sidebar=sidebar
|
||||
ll_add handlers_bar_left nav_tree
|
||||
werc_root=`{pwd}
|
||||
for(i in siteTitle siteSubTitle pageTitle extraHeaders)
|
||||
$i = ''
|
||||
|
@ -13,33 +13,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
% if(! ~ $#sidebar 0) {
|
||||
<div id="side-bar">
|
||||
|
||||
<div>
|
||||
%{
|
||||
if(! ~ $#sideBarNavTitle 0)
|
||||
echo '<p class="sideBarTitle">'$"sideBarNavTitle':</p>'
|
||||
|
||||
gensidebar
|
||||
|
||||
if(! ~ $#handlers_bar_left 0) {
|
||||
echo '<div id="side-bar">'
|
||||
for(h in $handlers_bar_left) {
|
||||
echo '<div>'
|
||||
run_handler $$h
|
||||
echo '</div>'
|
||||
}
|
||||
echo '<div><!-- Bottom filler div --></div> </div>'
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
|
||||
% if(! ~ $#wiki 0 && test -f $local_path.md && check_user $wiki_editors_group) {
|
||||
<div>
|
||||
<form action="/_apps/dirdir/edit" method="POST">
|
||||
<input type="hidden" name="edit_wiki_page" value="%($req_path%)" />
|
||||
<input type="submit" name="" value="Edit page" />
|
||||
</form>
|
||||
</div>
|
||||
% }
|
||||
|
||||
<div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
% }
|
||||
|
||||
<div id="main-copy">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user