%# Foris - web administration interface for OpenWrt based on NETCONF %# Copyright (C) 2013 CZ.NIC, z.s.p.o. %# %# This program is free software: you can redistribute it and/or modify %# it under the terms of the GNU General Public License as published by %# the Free Software Foundation, either version 3 of the License, or %# (at your option) any later version. %# %# This program is distributed in the hope that it will be useful, %# but WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %# GNU General Public License for more details. %# %# You should have received a copy of the GNU General Public License %# along with this program. If not, see . %# %rebase("_layout.tpl", **locals()) %def render_buttons(element): %if not element.final: %if element.tag == "section": Add option | Add list %else: Add value %end %end %if element.tag == "option" or element.tag == "value": Edit %end %if element.tag != "config": | Remove %end | Debug %end %def treenode(element, node_path, depth=0):
  • %if not element.final or depth == 0: depth and node_path[depth] == element.key else "" }}> %render_buttons(element) %end
      %for child in element.children: %if not child.final: %treenode(child, node_path, depth + 1) %else:
    • {{child}} %render_buttons(child)
    • %end %end
  • %end %############################## PAGE ITSELF STARTS HERE ############################################

    Foris

    about:config

    %if tree:
      %for config in tree.children: %treenode(config, node_path) %end
    %end