torrus skinning improvements, RT#10574
[freeside.git] / torrus / templates / html-incblocks.txt
1 [%#
2   $Id: html-incblocks.txt,v 1.4 2010-12-29 03:12:19 ivan Exp $
3   All BLOCK statements are defined here
4 %]
5
6 [%#  ###########    Initialize globals   ################ %]
7 [% global.setDateDialog = 0; %]
8
9
10 [%#  ###########    Print the starting HTML blahblah   ################ %]
11
12 [% BLOCK htmlstart;
13    IF ! contentClass; contentClass="Content"; END %]
14
15 [% freesideHeader(title, style('stylesheet')) %]
16
17 <SCRIPT language="JavaScript"> 
18 <!--
19 function helpwindow() 
20
21 window.open('[%url(token) _ '&view=helptext-html'%]','helpwindow',
22 'width=600,height=400,resizable=yes,left=200,top=100'); 
23
24 //--> 
25 </SCRIPT>
26
27 <DIV CLASS="CurrentTime">[% timestamp %]</DIV>
28 [% IF printpath %]
29   <DIV CLASS="PathMenu">
30     [% INCLUDE treename %]
31     <DIV CLASS="CurrentPath">
32       <SPAN CLASS="PathMenuHeader">Current path:</SPAN>
33       <SPAN CLASS="PathURLs">[% splitUrls(token) %]</SPAN>
34     </DIV>
35   </DIV>
36 [% END %]
37 [% IF not noTopMenu %]
38 <DIV CLASS="TopMenu">
39 [% INCLUDE shortcut url=topURL text="Top"
40                     title="Choose from the list of trees"%]
41 [% theParent=parent(token);
42    IF theParent and theParent != token;
43      INCLUDE shortcut url=url(theParent) text="Up"
44                     title="Climb up the tree";
45    END %]
46 [% INCLUDE helpshortcut %]
47 [% IF mayDisplayAdmInfo(token);
48      INCLUDE shortcut url=url(token,'adminfo')
49                       text="AdmInfo"
50                       title="Administrative details"
51                       newwindow=1;
52    END
53 %]
54
55 </DIV>
56 [% END %]
57 <DIV CLASS="[%contentClass%]">
58 [% global.contentFinished = 0 %]
59 [% IF global.printError %]
60 <DIV CLASS="ErrorMessage">[% global.printError %]</DIV>
61 [% global.printError = '' %]
62 [% END %]
63 [% END %]
64
65 [%#  ###########    Print the legend   ################ %]
66
67 [% BLOCK legend %]
68 [%   legend = nodeParam(token, 'legend') %]
69 [%   IF legend.length > 0 %]
70 <DIV CLASS="Legend">
71 [%     FOREACH legpairstring = legend.split(';') %]
72 [%       SET legpair = legpairstring.split(':') %]
73          <DIV CLASS="LegendRow">
74            <SPAN CLASS="LegendName">[% xmlnorm(legpair.0) %]:</SPAN>
75            <SPAN CLASS="LegendValue">[% xmlnorm(legpair.1) %]</SPAN>
76          </DIV>
77 [%     END %]
78 </DIV>
79 [%   END %]
80 [% END %]
81
82 [%# ###########    Print the TZ and NOW variables   ################ %]
83
84 [% BLOCK variables %]
85 [%   IF variables.TZ or variables.NOW %]
86 <P CLASS="Variables">
87 [%     IF variables.TZ %]
88           <SPAN CLASS="VariableName">Timezone:</SPAN>
89           <SPAN CLASS="VariableValue">[% variables.TZ %].</SPAN>
90 [%     END %]
91 [%     IF variables.NOW %]
92           <SPAN CLASS="VariableName">Report date:</SPAN>
93           <SPAN CLASS="VariableValue">[% variables.NOW %].</SPAN>
94 [%     END %]
95 </P>
96 [%   END %]
97 [% END %]
98
99
100 [%# ###########    Print the current tree name   ################ %]
101
102 [% BLOCK treename %]
103     <DIV CLASS="CurrentTree">
104       <SPAN CLASS="PathMenuHeader">Tree:</SPAN>
105       <SPAN CLASS="TreeName">[% treeName %]</SPAN>
106     </DIV>
107 [% END %]
108
109 [%# ###########    Print the shortcut   ################ %]
110
111 [% BLOCK shortcut %]
112   <SPAN CLASS="Shortcut">
113   [&nbsp;<A TITLE="[%title%]" HREF="[%url%]"
114             [%IF newwindow; 'TARGET="_blank"'; END%]>[%text%]</A>&nbsp;]
115   </SPAN>
116 [% END %]
117
118 [%# ###########    Print the Help shortcut   ################ %]
119 [% BLOCK helpshortcut;
120      IF nodeParam(token, 'help-text', 1);
121        INCLUDE shortcut
122          url="javascript:helpwindow()"
123          text="Help"
124          title="Open a help window for this page";
125      END;
126    END %]
127
128 [%# ###########    Print the common bottomline   ################ %]
129
130 [% BLOCK bottomline %]
131 </DIV><!-- Content -->[% global.contentFinished = 1 %]
132 <DIV CLASS="BottomMenu">
133 [% INCLUDE shortcut url=persistentUrl(token,view,global.bookmarkVars)
134                     text="Bookmark"
135                     title="Permanent link to this page"%]
136 [% INCLUDE shortcut url=url('SS')           text="Tokensets"
137                     title="List of non-empty tokensets"%]
138 [%# INCLUDE shortcut url=url(token,view,'MEDIA','printer','OVS',ovs)
139   #                  text="Printable view"
140   #                  title="Prepare this page for printing"
141   #                  newwindow=1%]
142 [% IF mayDisplayReports();
143      INCLUDE shortcut url=reportsUrl
144                       text="Reports"
145                       title="Show reports page"
146                       newwindow=1;
147    END %]
148 [% IF global.setDateDialog; INCLUDE enterdate; END %]
149 [% INCLUDE searchdialog %]
150 </DIV>
151 [% END %]
152
153 [%# ###########    Print the Tokensets bottomline   ################ %]
154
155 [% BLOCK tsetbottomline %]
156 </DIV><!-- Content -->[% global.contentFinished = 1 %]
157 <DIV CLASS="BottomMenu">
158 [% INCLUDE shortcut url=url(pathToken('/')) text="Datasources tree"
159                     title="Back to the datasources tree" %]
160 [% INCLUDE shortcut url=url(token,view,'MEDIA','printer')
161                     text="Printable view"
162                     title="Prepare this page for printing"
163                     newwindow=1%]
164 [% INCLUDE helpshortcut %]
165 [% INCLUDE searchdialog %]
166 </DIV>
167 [% END %]
168
169
170 [%# ###########    Print the ending HTML blahblah   ################ %]
171
172 [% BLOCK htmlend %]
173 [% IF ! global.contentFinished %]</DIV><!-- Content -->[% END %]
174 [% freesideFooter %]
175 [% END %]
176
177 [%# ########   Print the RRD graph image   ####### %]
178
179 [% BLOCK rrgraph %]
180 <DIV CLASS="GraphImage">
181 <IMG SRC="[%url(token, view, vars)%]"
182      ALT="[% param(view, 'description') %]">
183 </DIV>
184 [% END %]
185
186
187 [%# ########   Print the short-term RRD graph image   ####### %]
188
189 [% BLOCK shortgraph %]
190 [%
191   hidden = 0;
192   IF nodeParam(token,'hidden') == 'yes';
193     hidden = 1;
194   END;
195   IF not hidden or variables.SHOWHIDDEN
196 %]
197 <DIV CLASS="ShortGraph">
198       [% IF not urltoken; urltoken = token; END %]
199       [% hidden ? '<SPAN CLASS="ShowHidden">':'' %]
200       <DIV CLASS="NodeName">
201         <A HREF="[%url(urltoken,urlview)%]">[% nodename %]</A>
202       </DIV>
203       [%IF comment%]<DIV CLASS="NodeDescr">[%xmlnorm(comment)%]</DIV>[%END%]
204       [% hidden ? '</SPAN>':'' %]
205       
206       [%
207         shortView = nodeParam(token,'rrgraph-views').split(',').0;
208         shortvars = [];
209         IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and
210            param(view, 'rrd-hwpredict') != 'disabled';
211           global.hwpredict = 1;
212           IF variables.NOHW;
213             shortvars = ['NOHW', 1];
214           ELSE;
215             shortvars = ['NOHW', ''];          
216           END;
217         END
218       %]
219       <DIV CLASS="GraphImage">
220       <A HREF="[%url(urltoken,urlview)%]">
221       <IMG SRC="[%url(token, shortView, shortvars)%]"
222            ALT="[% param(shortView, 'description') %]">
223       </A>
224       </DIV>
225 </DIV>
226   [% END %]
227 [% END %]
228
229
230 [%# ########   Print the overview shortcuts   ####### %]
231 [% BLOCK overviewShortcuts %]
232 [%
233   IF nodeParam(token, 'has-overview-shortcuts', 1) == 'yes';
234     FOREACH ovs = nodeParam(token,'overview-shortcuts').split('\s*,\s*');
235      p1 = 'overview-shortcut-text-' _ ovs;
236      p2 = 'overview-shortcut-title-' _ ovs;
237      INCLUDE shortcut
238         url=url(token, 'overview-subleaves-html', 'OVS', ovs)
239         text=nodeParam(token, p1, 1)
240         title=nodeParam(token, p2, 1);
241     END;
242   END %]
243 [% END %]
244
245
246 [%# ########   Set the date variable   ####### %]
247 [% BLOCK setdate %]
248 [% IF variables.SETDATE == 1;
249      thedate = verifyDate( variables.SETDATEV );
250      IF thedate.length == 0;
251          global.printError = 'Incorrect date format';
252          clearVar('SETDATE');
253      ELSE;
254          variables.NOW = thedate;
255      END;
256    ELSE;
257      clearVar('NOW');
258      clearVar('SETDATE');
259      clearVar('SETDATEV');
260    END;
261    global.setDateDialog = 1;
262 %]
263 [% END %]
264
265
266 [%# ########   Print the date selection elements   ####### %]
267 [% BLOCK enterdate %]
268 <SPAN CLASS="SetDateDialog">
269 <FORM METHOD=GET ACTION="[%topUrl()%]">
270 <INPUT TYPE="hidden" NAME="token" VALUE="[%token%]"/>
271 <INPUT TYPE="hidden" NAME="view" VALUE="[%view%]"/>
272 [% IF ovs %]<INPUT TYPE="hidden" NAME="OVS" VALUE="[%ovs%]"/>[% END %]
273 <LABEL>
274 <INPUT TYPE="checkbox" NAME="SETDATE" VALUE="1"
275 [%variables.SETDATE ? 'CHECKED':''%]/>
276 Set date</LABEL>
277 <INPUT TYPE="text" NAME="SETDATEV" SIZE="22" VALUE="[%variables.SETDATEV%]"/>
278 <INPUT TYPE="submit" VALUE="&gt;"/>
279 </FORM>
280 </SPAN>
281 [% END %]
282
283
284 [%# ########   Print the searchform HTML   ####### %]
285 [% BLOCK searchdialog %]
286 [% IF searchEnabled %]
287 <SPAN CLASS="SearchDialog">
288 <FORM METHOD=GET ACTION="[%topUrl()%]">
289 <INPUT TYPE="hidden" NAME="token" VALUE="[%pathToken('/')%]"/>
290 <INPUT TYPE="hidden" NAME="view" VALUE="search"/>
291 <LABEL>Search</LABEL>
292 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
293 <INPUT TYPE="submit" VALUE="&gt;"/>
294 </FORM>
295 </SPAN>
296 [% END %]
297 [% END %]
298
299 [%# ########   Print the Global searchform HTML   ####### %]
300 [% BLOCK globalsearchdialog %]
301 [% IF mayGlobalSearch() %]
302 <SPAN CLASS="SearchDialog">
303 <FORM METHOD=GET ACTION="[%topUrl()%]">
304 <LABEL>Search</LABEL>
305 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
306 <INPUT TYPE="submit" VALUE="&gt;"/>
307 </FORM>
308 </SPAN>
309 [% END %]
310 [% END %]