Make left sidebar into a list of handlers.
This commit is contained in:
parent
cfbe5850b2
commit
ec151a9902
2 changed files with 13 additions and 27 deletions
|
|
@ -26,7 +26,9 @@ fn hide_paths {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sidebar
|
# 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)
|
# 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
|
# /./ to deal with p9p's ls failure to follow dir symlinks otherwise
|
||||||
ls -F $sitedir/./$req_paths_list >[2]/dev/null \
|
ls -F $sitedir/./$req_paths_list >[2]/dev/null \
|
||||||
|
|
@ -135,7 +137,7 @@ path=(. $PLAN9/bin ./bin/ /bin/ /usr/bin)
|
||||||
headers=lib/headers.tpl
|
headers=lib/headers.tpl
|
||||||
master_template=default_master.tpl
|
master_template=default_master.tpl
|
||||||
res_tail='</body></html>'
|
res_tail='</body></html>'
|
||||||
sidebar=sidebar
|
ll_add handlers_bar_left nav_tree
|
||||||
werc_root=`{pwd}
|
werc_root=`{pwd}
|
||||||
for(i in siteTitle siteSubTitle pageTitle extraHeaders)
|
for(i in siteTitle siteSubTitle pageTitle extraHeaders)
|
||||||
$i = ''
|
$i = ''
|
||||||
|
|
|
||||||
|
|
@ -13,33 +13,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
% if(! ~ $#sidebar 0) {
|
|
||||||
<div id="side-bar">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
%{
|
%{
|
||||||
if(! ~ $#sideBarNavTitle 0)
|
if(! ~ $#handlers_bar_left 0) {
|
||||||
echo '<p class="sideBarTitle">'$"sideBarNavTitle':</p>'
|
echo '<div id="side-bar">'
|
||||||
|
for(h in $handlers_bar_left) {
|
||||||
gensidebar
|
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">
|
<div id="main-copy">
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue