torrus, UI, RT10574
[freeside.git] / torrus / templates / default-dir.html
1 [% PROCESS 'html-incblocks.txt' %]
2 [% thepath=path(token) %]
3 [% INCLUDE htmlstart title=xmlnorm(nodeParam(token,'comment')) printpath=1 %]
4
5 [% INCLUDE legend %]
6
7 [% 
8  IF matches(thepath,'Interface_Counters/$');
9    freesideComponent('/elements/init_overlib.html');
10     nms = load_nms();
11     router = nodeName(parent(token));
12     serviceids = get_serviceids(nms,router);
13  END;
14  IF matches(thepath,'Interface_Counters/.*?/$');
15     nms = load_nms();
16     router = nodeName(parent(parent(token)));
17     serviceids = get_serviceids(nms,router);
18
19     # HACK! this doesn't do what you think it does...
20     popup_link('nms-add_iface.html',router,uri_escape(slash2underscore(nodeName(token))),nms,serviceids);
21  END; 
22  IF matches(thepath,'Routers/$');
23    freesideComponent('/elements/init_overlib.html');
24    popup_link('nms-add_router.html');
25  END;
26 %]
27
28 <P>Directories you can jump to:</P>
29 <DIV CLASS="Listing">
30 [%   hasLeaves = 0; hasSubtrees = 0;
31      childCounter = 0;
32      evenRow = 0;
33      FOREACH child = sortTokens(children(token));
34        hidden = 0;
35        IF nodeParam(child,'hidden') == 'yes';
36          hidden = 1;
37        END;
38        comment = nodeParam(child,'comment',1);
39        IF not hidden or variables.SHOWHIDDEN;
40          childCounter = childCounter + 1;
41          evenRow = childCounter % 2 == 0;
42          IF isLeaf(child);
43            hasLeaves = hasLeaves + 1;
44          ELSE;
45            IF isAlias(child);
46              thisIsAlias = 1;
47              urlTitle=' TITLE="Symbolic link to ' _ path(isAlias(child)) _'"';
48              IF isLeaf(isAlias(child));
49                hasLeaves = hasLeaves + 1;
50              END;
51            ELSE;
52              hasSubtrees = 1;
53              urlTitle = '';
54            END;
55          END;
56 %]
57   <DIV CLASS="[% evenRow ? 'ListRowEven' : 'ListRow' %]">
58     <SPAN CLASS="NodeName">
59       [% thisIsAlias ? '<EM CLASS="Alias">':'';
60          hidden ? '<EM CLASS="ShowHidden">':'' %]
61       <A HREF="[%url(child)%]"[%urlTitle%]>[% nodeName(child) %]</A>
62       [% hidden ? '</EM>':'';
63          thisIsAlias ? '</EM>':''; %]
64       [% IF matches(thepath,'Interface_Counters/$') %]
65         <FONT SIZE="-1">
66         [% popup_link('nms-add_iface.html',router,uri_escape(slash2underscore(nodeName(child))),nms,serviceids) %]
67         </FONT>
68       [% END %]
69     </SPAN>
70        [% IF comment %]
71     <SPAN CLASS="NodeDescr">
72       [% hidden ? '<EM CLASS="ShowHidden">':'' %]
73       [% xmlnorm(comment) %]
74       [% hidden ? '</EM>':'' %]
75     </SPAN>
76        [% END %]
77   </DIV>
78     [% END %]
79   [% END %]
80 </DIV>
81
82 <DIV CLASS="BottomShortcuts">
83 [% IF hasLeaves > 1;
84     INCLUDE shortcut url=url(token, 'expanded-dir-html')
85                      text="Expand leaves"
86                      title="Show all leaf graphs in one page";
87    END;
88    IF hasSubtrees and nodeParam(token,'show-recursive',1) == 'yes';
89     INCLUDE shortcut url=url(token, 'recursive-dir-html')
90                      text="Recursive view"
91                      title="Show all subtrees and leaves in one page";
92    
93    END;
94    INCLUDE overviewShortcuts %]
95 </DIV>
96
97 [% INCLUDE bottomline %]
98 [% INCLUDE htmlend %]