]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/navbar
A little bit of refactoring and documentation.
[maypole.git] / templates / factory / navbar
index 3e5c1c5e4f6b6787ffd265b9e052b0350a387277..b2dac727dd7af23a6d7f5ff5156b0c59769f4a17 100644 (file)
@@ -1,14 +1,25 @@
+[%#
+
+=head1 navbar
+
+This is a navigation bar to go across the page. (Or down the side, or
+whatetver you want to do with it.) It displays all the tables which are
+accessible, with a link to the list page for each one.
+
+#%]
+[% PROCESS macros %]
 <div id="navcontainer">
 <ul id="navlist">
 [%
     FOR table = config.display_tables;
-        '<LI '; 'id="active"' IF table == classmetadata.moniker;
-        '>';
-        '<A HREF="';
-        base; table; "/list/";
-        '"';
-        ' id="current"' IF table == classmetadata.moniker;
-        '> '; table; "</A>";
+        '<LI '; 'id="active"' IF table == classmetadata.moniker; '>';
+
+        # Hack
+        SET active = '" id="current' IF table == classmetadata.moniker;
+
+        link(table, "list", active, table);
+        SET active = "";
+        '</LI>';
     END;
 %]
 </ul>