jablonka.czprosek.czf

websvn

Subversion Repositories:
[/] [doc/] [templates.html] - Blame information for rev 6

 

Line No. Rev Author Line
11simandl<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3<head>
4 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
5 <meta http-equiv="content-script-type" content="text/javascript" />
6 <meta http-equiv="content-style-type" content="text/css" />
7 <title>WebSVN Templating System</title>
8 <link rel="stylesheet" type="text/css" href="style.css" />
9</head>
10 
11<body>
12 
13<h1>WebSVN Templating System</h1>
14 
15<div class="misc">
16<h2><a name="content"></a>Content</h2>
17<ul>
18 <li><a href="#intro">Introduction</a></li>
19</ul>
20</div>
21 
22<div class="content">
23<h2><a name="intro"></a>Introduction</h2>
24 
25<p><em>The documentation of the variables for each template is currently not up to date due to major changes on the trunk. User defined templates will not work with the current development version.</em></p>
26 
27<p>Everyone wants their view onto their SVN repository to fit in with their look
28and feel. With WebSVN's templating system this is very possible.</p>
29 
30<p>To create your own templates, you first need to change your config.php file to
31tell WebSVN where the templates are stored. For example:</p>
32 
33<pre class="code">
343simandl$config->setTemplatePath("./templates/calm/");
351simandl</pre>
36 
37<p>This directory should contain at least the following files:</p>
38 
39<dl>
403simandl<dt>header.tmpl</dt><dd>Header template included before any other</dd>
41<dt>footer.tmpl</dt><dd>Footer template included after any other</dd>
421simandl 
43<dt>index.tmpl</dt><dd>The main project page template</dd>
44 
45<dt>directory.tmpl</dt><dd>Listing of a directory</dd>
463simandl<dt>log.tmpl</dt><dd>Log of a directory or file</dd>
471simandl<dt>file.tmpl</dt><dd>Contents of a text file</dd>
48<dt>diff.tmpl</dt><dd>Differences between text files</dd>
49<dt>blame.tmpl</dt><dd>Blame information for a file</dd>
50</dl>
51 
52<p>Each template file should be written in HTML, but is allowed to contain certain
53WebSVN controls. There are two control types, commands and variables.</p>
54 
55 
56<h2><a name="commands"></a>Commands</h2>
57 
58<p>NOTE: Commands MUST appear on their own line</p>
59 
60<pre class="code">
61[websvn-test:varname]
62...
63[websvn-else]
64...
65[websvn-endtest]
66</pre>
67 
68<p>If the variable is non-0 write out the first part else write out the second</p>
69 
70<pre class="code">
71[websvn-startlisting]
72...
73[websvn-endlisting]
74</pre>
75 
76<p>Used in pages that contain listings of files, logs, etc. Everything between
77the controls is repeated for each item in the list</p>
78 
79<pre class="code">
80[websvn-defineicons] (used in directory.tmpl only)
81...
82[websvn-enddefineicons]
83...
84 
85[websvn-treenode]
86[websvn-icon]
87</pre>
88 
89<p>These commands are used to display certain icons next to certain file types in
90the directory view.</p>
91 
92<p>The [websvn-defineicons] block should contain a line for each file type,
93defining the HTML to be used for that file type. To define the HTML for a
94particular extension use the syntax:</p>
95 
96<pre class="code">
97.&lt;extension>=&lt;HTML code>
98</pre>
99 
100<p>There are also some special filetypes:</p>
101 
102<dl>
103<dt>dir=&lt;HTML code></dt><dd>is used for directory icons</dd>
104<dt>diropen=&lt;HTML code></dt><dd>is used for open directory icons</dd>
105<dt>*=&lt;HTML code></dt><dd>is used for all filetypes which have no other definition</dd>
106 
107<dt>i-node</dt><dd>| shaped node of the tree view</dd>
108<dt>t-node</dt><dd>T shaped node of the tree view</dd>
109<dt>l-node</dt><dd>L shaped node of the tree view</dd>
110<dt>e-node</dt><dd>Empty node of the tree view</dd>
111</dl>
112 
113<p>Example from the BlueGrey scheme:</p>
114 
115<pre class="code">
116[websvn-defineicons]
117dir=&lt;img align="middle" valign="center" src="[websvn:locwebsvnhttp]/templates/BlueGrey/folder.png" alt="[FOLDER]">
118diropen=&lt;img align="middle" valign="center" src="[websvn:locwebsvnhttp]/templates/BlueGrey/folder-open.png" alt="[FOLDER]">
119*=&lt;img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/file.png" alt="[FILE]">
120.c=&lt;img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/filec.png" alt="[C-FILE]">
121.h=&lt;img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/fileh.png" alt="[H-FILE]">
122.s=&lt;img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/files.png" alt="[S-FILE]">
123 
124i-node=&lt;img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/i-node.png" alt="[NODE]">
125t-node=&lt;img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/t-node.png" alt="[NODE]">
126l-node=&lt;img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/l-node.png" alt="[NODE]">
127e-node=&lt;img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/e-node.png" alt="[NODE]">
128[websvn-enddefineicons]
129</pre>
130 
131<p>Inside the [websvn-startlisting] block, the command [websvn-treeview] will
132output the HTML code defined for the appropriate tree view icon.
133[websvn-icon] will output the HTML code defined for the type of the current
134file.</p>
135 
136 
137<pre class="code">
138[websvn-getlisting] (used in file.tmpl only)
139</pre>
140 
141<p>Get the contents of the file being viewed and output it exactly (surrounded
142with &lt;PRE> .. &lt;/PRE>).</p>
143 
144<h2><a name="variables"></a>Variables</h2>
145 
146<p>Variables are written in the form [websvn:varname] where varname is the name of
147a variable passed to the template. The control is replaced with the variable
148required.</p>
149 
150<p>The variables available are described below for each template.
151You may also access the language file using ?varname? is order to keep your
152templates international!</p>
153 
154<p>Take special notice of the use of the locwebsvnhttp variable. It should be used
155to locate other files and graphics that your templates need. For example:</p>
156 
157<pre class="code">
158&lt;link href="[websvn:locwebsvnhttp]/templates/tmptname/styles.css" ...
159</pre>
160 
161<p>You may imagine that simply using . in place should work, however this isn't
162the case when MultiViews are turned on. Using this variable gives you a way to
163access your template files in all cases.</p>
164 
165<h2><a name="varsall"></a>Variables defined for all scripts</h2>
166 
167<dl>
168<dt>locwebsvnhttp</dt><dd>Root of websvn directory</dd>
169<dt>indexurl</dt><dd>The URL to the WebSVN index page</dd>
170<dt>charset</dt><dd>The charset requested by the user</dd>
171 
172<dt>projects_form</dt><dd>HTML &lt;form> specification for the projects selection box</dd>
173<dt>projects_select</dt><dd>HTML &lt;select>...&lt;/select> specification for the project
174 options</dd>
175<dt>projects_submit</dt><dd>HTML &lt;input> specification for the projects selection GO
176 button</dd>
177<dt>projects_hidden</dt><dd>Hidden parameters that need to be passed from this form</dd>
178<dt>projects_endform</dt><dd>HTML &lt;/form> specification for the projects selection
179 box (includes hidden field declarations)</dd>
180 
181<dt>lang_code</dt><dd>The RFC 2616 language code of the selected language</dd>
182 
183<dt>lang_form</dt><dd>HTML &lt;form> specification for the language selection box</dd>
184<dt>lang_select</dt><dd>HTML &lt;select>...&lt;/select> specification for the language options</dd>
185<dt>lang_submit</dt><dd>HTML &lt;input> specification for the language selection GO button</dd>
186<dt>lang_endform</dt><dd>HTML &lt;/form> specification for the language selection box</dd>
187 
188<dt>noaccess</dt><dd>True if the user should be blocked from accessing this page due
189 to insufficient access rights.</dd>
190</dl>
191 
192<h2><a name="varsindex"></a>Variables defined for index.tmpl</h2>
193 
194<dl>
195<dt>treeview</dt><dd>true if the index should be displayed as a tree of grouped projects</dd>
196<dt>flatview</dt><dd>true if the index should be displayed as a simple list of projects</dd>
197<dt>opentree</dt><dd>true if the tree viewed should be open by default</dd>
198</dl>
199 
200Used in [websvn-startlisting] ... [websvn-endlisting] block of a flat view:
201 
202<dl>
203<dt>projlink</dt><dd>Link to the project</dd>
204<dt>rowparity</dt><dd>Parity of the row (0 or 1). Used to generate striped tables</dd>
205</dl>
206 
207Used in [websvn-startlisting] ... [websvn-endlisting] block of a tree view:
208 
209<dl>
210<dt>isprojlink</dt><dd>This item is a project link</dd>
211<dt>isgrouphead</dt><dd>This item is a group name</dd>
212<dt>rowparity</dt><dd>Parity of the row (0 or 1). Used to generate striped tables</dd>
213<dt>listitem</dt><dd>The item to display</dd>
214</dl>
215 
216<h2><a name="varsdir"></a>Variables defined for directory.tmpl</h2>
217 
218<dl>
219<dt>restricted</dt><dd>True if the users has restricted access to this directory (to
220 allow access to a readable directory lower down only)</dd>
221<dt>repname</dt><dd>Name of the repository</dd>
222<dt>rev</dt><dd>Revision being viewed</dd>
223<dt>path</dt><dd>Path of item being logged</dd>
224<dt>author</dt><dd>Author of current revision</dd>
225<dt>date</dt><dd>Date that revision was committed</dd>
226<dt>log</dt><dd>Log message of revision</dd>
227<dt>lastchangedrev</dt><dd>Revision of the last modification to current directory</dd>
228<dt>goyoungestlink</dt><dd>Link to head revision of repository</dd>
229 
230<dt>showchanges</dt><dd>1 if showing changes (for websvn-test)</dd>
231<dt>hidechanges</dt><dd>1 if hiding changes (for websvn-test)</dd>
232<dt>showchangeslink</dt><dd>Link to page with changes hidden</dd>
233<dt>hidechangeslink</dt><dd>Link to page with changes shown</dd>
234 
235<dt>newfilesbr</dt><dd>list of the new files separated by &lt;BR>'s</dd>
236<dt>changedfilesbr</dt><dd>list of the changed files separated by &lt;BR>'s</dd>
237<dt>deletedfilesbr</dt><dd>list of the deleted files separated by &lt;BR>'s</dd>
238 
239<dt>newfiles</dt><dd>list of the new files separated by spaces</dd>
240<dt>changedfiles</dt><dd>list of the changed files separated by spaces</dd>
241<dt>deletedfiles</dt><dd>list of the deleted files separated by spaces</dd>
242 
243<dt>curdirlinks</dt><dd>List of the path of this directory with links to each one</dd>
244<dt>curdirloglink</dt><dd>Link to the log view of current directory</dd>
245<dt>curdirrsslink</dt><dd>Link to the RSS feed for the current directory</dd>
246<dt>curdirrssanchor</dt><dd>The &lt;a href=...> tag to the RSS feed for the current directory</dd>
247<dt>curdirrsshref</dt><dd>URL of the feed for the current directory (without anchor tag)</dd>
248<dt>curdirdllink</dt><dd>Link to the tarball of current directory</dd>
249<dt>curdircomplink</dt><dd>Link to comparison with previously changed revision</dd>
250 
251<dt>allowdownload</dt><dd>True if downloading has been configured</dd>
252 
253<dt>compare_form</dt><dd>HTML &lt;form> specification for the comparison form</dd>
254<dt>compare_submit</dt><dd>HTML &lt;input> specification for the comparison button</dd>
255<dt>compare_endform</dt><dd>HTML &lt;/form> specification for the comparison form</dd>
256</dl>
257 
258Used in [websvn-startlisting] ... [websvn-endlisting] block:
259 
260<dl>
261<dt>compare_box</dt><dd>HTML checkbox specification for the comparison option</dd>
262<dt>filelink</dt><dd>Link to the file</dd>
263<dt>rowparity</dt><dd>Parity of the row (0 or 1). Used to generate striped tables</dd>
264<dt>fileviewloglink</dt><dd>Link to the log page for the file</dd>
265<dt>fileviewdllink</dt><dd>Link to the tarball of current directory</dd>
266<dt>isDir</dt><dd>true if the current file is a directory (use with [websvn-test:isDir]
267 to display icons)</dd>
268<dt>rsslink</dt><dd>Link to the RSS feed for this file/directory</dd>
269<dt>rssanchor</dt><dd>The &lt;a href=...> tag to the RSS feed for this file/directory</dd>
270</dl>
271 
272<h2><a name="varslog"></a>Variables defined for log.tmpl</h2>
273 
274<dl>
275<dt>action</dt><dd>Action being performed ("Log")</dd>
276 
277<dt>repname</dt><dd>Name of the repository</dd>
278<dt>rev</dt><dd>Revision being viewed</dd>
279<dt>path</dt><dd>Path of item being logged</dd>
280<dt>curdirlinks</dt><dd>List of the path of this directory with links to each one</dd>
281<dt>error</dt><dd>Error message when results not available</dd>
282 
283<dt>pagelinks</dt><dd>List of list to all the pages of the log</dd>
284<dt>showalllink</dt><dd>Link to show the entire log in one go</dd>
285 
286<dt>prevdifflink</dt><dd>Link to comparison with previous revision</dd>
287<dt>blamelink</dt><dd>Link to the blame information for this file</dd>
288<dt>fileviewloglink</dt><dd>Link to the log page for the file</dd>
289 
290<dt>logsearch_form</dt><dd>HTML &lt;form> specification for the log search box</dd>
291<dt>logsearch_inputbox</dt><dd>HTML &lt;input> specification for the log search box</dd>
292<dt>logsearch_submit</dt><dd>HTML &lt;input> specification for the log search GO button</dd>
293<dt>logsearch_endform</dt><dd>HTML &lt;/form> specification for the log search box box
294 (includes hidden field declarations)</dd>
295<dt>logsearch_clearloglink</dt><dd>Link to unfiltered display (remove current search
296 criteria)</dd>
297 
298<dt>logsearch_resultsfound</dt><dd>true when there are logs to display</dd>
299<dt>logsearch_nomatches</dt><dd>true when there are no matches for the current request</dd>
300<dt>logsearch_nomorematches</dt><dd>true when there are no further matches to the current
301 request (but there have been previous pages,
302 for example)</dd>
303 
304<dt>compare_form</dt><dd>HTML &lt;form> specification for the comparison form</dd>
305<dt>compare_submit</dt><dd>HTML &lt;input> specification for the comparison button</dd>
306<dt>compare_endform </dt><dd>HTML &lt;/form> specification for the comparison form</dd>
307</dl>
308 
309Used in [websvn-startlisting] ... [websvn-endlisting] block:
310 
311<dl>
312<dt>compare_box</dt><dd>HTML checkbox specification for the comparison option</dd>
313<dt>revpathlink</dt><dd>Link to revision</dd>
314<dt>revauthor</dt><dd>Author of this revision</dd>
315<dt>revage</dt><dd>Age of revision</dd>
316<dt>revlog</dt><dd>Log message of revision</dd>
317</dl>
318 
319<h2><a name="varsfile"></a>Variables defined for file.tmpl</h2>
320 
321<dl>
322<dt>repname</dt><dd>Name of the repository</dd>
323<dt>rev</dt><dd>Revision being viewed</dd>
324<dt>path</dt><dd>Path of item being logged</dd>
325<dt>curdirlinks</dt><dd>List of the path of this directory with links to each one</dd>
326<dt>goyoungestlink</dt><dd>Link to head revision of repository</dd>
327 
328<dt>prevdifflink</dt><dd>Link to comparison with previous revision</dd>
329<dt>blamelink</dt><dd>Link to the blame information for this file</dd>
330<dt>fileviewloglink</dt><dd>Link to the log page for the file</dd>
331</dl>
332 
333Note: Use command [websvn-getlisting] to display the listing.
334 
335 
336<h2><a name="varsdiff"></a>Variables defined for diff.tmpl</h2>
337 
338<dl>
339<dt>action</dt><dd>Action being performed ("Diff")</dd>
340<dt>locwebsvnhttp</dt><dd>Root of websvn directory</dd>
341<dt>charset</dt><dd>The charset requested by the user</dd>
342 
343<dt>repname</dt><dd>Name of the repository</dd>
344<dt>rev</dt><dd>Revision being viewed</dd>
345<dt>path</dt><dd>Path of item being logged</dd>
346<dt>curdirlinks</dt><dd>List of the path of this directory with links to each one</dd>
347<dt>goyoungestlink</dt><dd>Link to head revision of repository</dd>
348 
349<dt>prevdifflink</dt><dd>Link to comparison with previous revision</dd>
350<dt>blamelink</dt><dd>Link to the blame information for this file</dd>
351<dt>fileviewloglink</dt><dd>Link to the log page for the file</dd>
352 
353<dt>rev1</dt><dd>Revision of the older file</dd>
354<dt>rev2</dt><dd>Revision of the newer file</dd>
355 
356<dt>showcompactlink</dt><dd>Link to compact view</dd>
357<dt>showalllink</dt><dd>Link to full view</dd>
358</dl>
359 
360Used in [websvn-startlisting] ... [websvn-endlisting] block:
361 
362<dl>
363<dt>rev1lineno / rev2lineno</dt><dd>Line number of the next difference block. Only
364 defined at the start of the block.</dd>
365<dt>rev2diffclass / rev2diffclass</dt><dd>Class name of the diff block used for colouring
366 differences. The result is one of:
367 * diff (no changes)
368 * diffadded
369 * diffchanged
370 * diffdeleted</dd>
371<dt>rev1line / rev2line</dt><dd>The line under comparison</dd>
372</dl>
373 
374<h2><a name="varsblame"></a>Variables defined for blame.tmpl</h2>
375 
376<dl>
377<dt>locwebsvnhttp</dt><dd>Root of websvn directory</dd>
378<dt>charset</dt><dd>The charset requested by the user</dd>
379 
380<dt>repname</dt><dd>Name of the repository</dd>
381<dt>rev</dt><dd>Revision being viewed</dd>
382<dt>path</dt><dd>Path of item being logged</dd>
383<dt>curdirlinks</dt><dd>List of the path of this directory with links to each one</dd>
384 
385<dt>prevdifflink</dt><dd>Link to comparison with previous revision</dd>
386<dt>blamelink</dt><dd>Link to the blame information for this file</dd>
387<dt>fileviewloglink</dt><dd>Link to the log page for the file</dd>
388</dl>
389 
390Used in [websvn-startlisting] ... [websvn-endlisting] block:
391 
392<dl>
393<dt>lineno</dt><dd>Line number of the line</dd>
394<dt>revision</dt><dd>Revision in which the line changed</dd>
395<dt>author</dt><dd>Last author to modify the line</dd>
396<dt>line</dt><dd>The line itself</dd>
397</dl>
398 
399<h2><a name="varscompare"></a>Variables defined for compare.tmpl</h2>
400 
401<dl>
402<dt>action</dt><dd>Action being performed ("Path Comparison")</dd>
403<dt>repname</dt><dd>Name of the repository</dd>
404<dt>path1</dt><dd>First path being compared</dd>
405<dt>rev1</dt><dd>Revision of first path</dd>
406<dt>path2</dt><dd>Second path being compared</dd>
407<dt>rev2</dt><dd>Revision of second path</dd>
408 
409<dt>success</dt><dd>true if the comparison succeeded</dd>
410 
411<dt>revlink</dt><dd>Link to reverse comparison</dd>
412 
413<dt>compare_form</dt><dd>HTML &lt;form> specification for the comparison form</dd>
414<dt>compare_path1input/compare_path2input</dt><dd>HTML specifications for the path input areas</dd>
415<dt>compare_rev1input/compare_rev2input</dt><dd>HTML specifications for the revision input areas </dd>
416<dt>compare_submit</dt><dd>HTML &lt;input> specification for the comparison button</dd>
417<dt>compare_endform</dt><dd>HTML &lt;/form> specification for the comparison form</dd>
418</dl>
419 
420Used in [websvn-startlisting] ... [websvn-endlisting] block:
421 
422<dl>
423<dt>newpath</dt><dd>Name of new file under comparison (only defined at start of block)</dd>
424<dt>difflines</dt><dd>Lines changed information for this file. Start of diff lines.
425 (only defined after newpath)</dd>
426<dt>diffclass</dt><dd>Class name of the diff block used for colouring
427 differences. The result is one of:
428 * diff (no changes)
429 * diffadded
430 * diffdeleted</dd>
431<dt>line</dt><dd>The line under comparison</dd>
432<dt>enddifflines</dt><dd>End of diff lines</dd>
433<dt>properties</dt><dd>Property changes</dd>
434<dt>endpath</dt><dd>End of current path</dd>
435</dl>
436 
437</div>
438 
439</body>
440</html>

Powered by WebSVN 2.2.1