Login Small RSS Icon
Edit | History | Small RSS Icon

Content page templates

This Lua code parses correctly.
1 --- this is the template that generates the outer tags of the page ---
2
3 TRANSLATIONS = "Translations:Main"
4
5 --------------------------------------------------------------------------------
6 ------- BASIC TEMPLATES --------------------------------------------------------
7 --------------------------------------------------------------------------------
8
9 MAIN = [===[
10 <?xml version="1.0" encoding="UTF-8"?>
11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
12 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
13 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
14 lang="en">
15 <head>
16 <meta http-equiv="Content-Type"
17 content="text/html; charset=UTF-8" />
18 $if_no_index[[
19 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>
20 ]] <title>$site_title: $title</title>
21 ]===]--[===[
22 $do_stylesheets[[
23 <!--<link type="text/css" rel="stylesheet" href="$url" />-->
24 ]]
25 ]===]..[===[
26 <link type="text/css" rel="stylesheet" href="]===]..NICE_URL..[===[_style.css" />
27 <link type="text/css" rel="stylesheet" href="]===]..NICE_URL..[===[_style2.css" />
28 <link rel="alternate" type="application/rss+xml" title="_(RECENT_EDITS_TO_SITE)" $site_rss_link/>
29 <link rel="alternate" type="application/rss+xml" title="_(RECENT_EDITS_TO_node)" $node_rss_link/>
30 <link rel="icon" href="/favicon.ico" type="image/x-icon" />
31 </head>
32
33 <body>
34
35 <div id="top">
36 <h1> </h1>
37 </div>
38
39 <div id="page">
40 <div id="wrapper3col">
41 <div id="main">
42 <div id="content">
43
44 <div class="post">
45 <h2 class="post-title">$title</h2>
46 $content
47 <p class="post-info">
48 ]===]--[===[
49 Par Doub
50 | mardi 29 janvier 2008 &agrave; 02:58
51 | <a href="/doub/index.php?Electron-meat">Electron Meat</a>
52 | <a href="/doub/index.php?2008/01/29/210-optimisations" title="Lien permanent vers : Optimisations"><img src="/doub/themes/doub19th/img/permalien.png" alt="Permalien" /></a>
53 | <a href="/doub/rss.php?type=co&amp;post=210" title="fil RSS des commentaires de : Optimisations"><img src="/doub/themes/doub19th/img/rss_comment.png" alt="RSS" /></a>
54 | <a $node_rss_link><img src="$icons_url/feed-icon-12x12.png" class="rss_icon" title="RSS for edits to this node" alt="Small RSS Icon" /></a>
55 ]===]..[===[
56 <a $edit_link>_(EDIT)</a>
57 | <a $history_link>_(HISTORY)</a>
58 | <a $node_rss_link><img src="/img/rss_comment.png" class="rss_icon" title="RSS for edits to this node" alt="Small RSS Icon" /></a>
59 </p>
60 ]===]--[===[
61 <div id='doc2' class='yui-t4'>
62 <div id="login"> <!--login and search (in the upper right corner) -->
63 $if_search[[<form action="$base_url" style="margin-right: 0px; padding-right: 0px;">
64 <input class="hidden" type="hidden" name="p" value="_search"/>
65 <input class="search_box" type="text" name="q" size="16" value="$search_box_content"/>
66 <input class="small_submit" type="submit" name="Search" value="_(SEARCH)" 
67 title="_(TOOLTIP_FOR_SEARCH)"/></form><br/>]]    
68 $if_logged_in[[ _(HI_USER) (<a $logout_link>_(LOGOUT)</a>) ]]
69 $if_not_logged_in[[<a $login_link>_(LOGIN)</a>]]
70 <a $site_rss_link><img src="$icons_url/feed-icon-12x12.png" id="rss_icon" title="RSS for edits to this wiki" alt="Small RSS Icon" /></a>
71 </div>
72 <!--
73 <div id="logo">
74 <a class="logo" href="$home_page_url">
75 <img src="$logo_url" alt="_(LOGO)" /> 
76 </a>
77 </div>
78 -->
79 <div id='hd'><!--navigation bar -->$nav_bar</div>
80
81 <div id='bd'><!--the body, consisting of the page and the sidebar-->
82 <div id="yui-main" $if_old_version[[style='background-color:#ddd;']]><!--this just marks the page as "main" -->
83 <div class="yui-b" id='page'>
84
85 <span class="toolbar">
86 <a $edit_link >_(EDIT)</a>
87 | <a $history_link>_(HISTORY)</a>
88 | <a $node_rss_link><img src="$icons_url/feed-icon-12x12.png"
89 class="rss_icon" title="RSS for edits to this node" alt="Small RSS Icon" /></a>
90 </span>
91
92 <h1 class="title"><a $show_link >$title</a> $if_old_version[[<span class="from_version">($version)</span>]]</h1>
93
94 <div class='content'>$content</div>
95
96 </div>  <!-- end of div .yui-b#page -->     
97 </div>  <!-- end of div #yui-main (end of body)-->
98
99 <div class="yui-b" id="sidebar">$sidebar</div>
100 </div>  <!-- end of div #bd -->
101 _(POWERED_BY_SPUTNIK)
102 </div> <!-- end of div.yui-t4#doc2 -->
103
104 <br/>
105 ]===]..[===[
106 </div>
107 ]===]--[===[
108 <div id="comments">
109 <h3 id="co">Comments</h3>
110 <p>No comment yet.</p>
111
112 <h3>Add a comment</h3>
113 </div>
114
115 <div id="trackbacks">
116 <h3 id="tb">Trackbacks</h3>
117 <p>Aucun trackback.</p>
118 <p>Pour faire un tracback sur ce billet&nbsp;:
119 http://blogs.lifelongvirgins.net/doub/tb.php?id=208</p>
120 </div>
121 ]===]..[===[
122 </div>
123 </div>
124 <div class="sidebar" id="sidebar2">
125 <div id="sidebarheader"></div>
126 <div class="sidebar" id="sidebar3">
127 <div id="login">
128 $if_logged_in[[ _(HI_USER) (<a $logout_link>_(LOGOUT)</a>) ]]
129 $if_not_logged_in[[<a $login_link>_(LOGIN)</a>]]
130 <!-- <a $site_rss_link><img src="$icons_url/feed-icon-12x12.png" id="rss_icon" title="RSS for edits to this site" alt="Small RSS Icon" /></a>-->
131 </div>
132 <div id="search">
133 <h2><label for="q">Search</label></h2>
134 <form action="/doub/index.php" method="get">
135 <p class="field">
136 <input name="q" id="q" type="text" size="15" value="" accesskey="4" />
137 <input type="submit" class="submit" value="ok" />
138 </p>
139 </form>
140 $if_search[[
141 <form action="$base_url" style="margin-right: 0px; padding-right: 0px;">
142 <input class="hidden" type="hidden" name="p" value="_search"/>
143 <input class="search_box" type="text" name="q" size="16" value="$search_box_content"/>
144 <input class="small_submit" type="submit" name="Search" value="_(SEARCH)" 
145 title="_(TOOLTIP_FOR_SEARCH)"/>
146 </form><br/>
147 ]] </div>
148 <div id="syndicate">
149 <!-- <h2>Coulisses</h2>-->
150 <ul>
151 <li><a $site_rss_link><img src="/img/rss_1.png" alt="fil RSS 1.0" /></a></li>
152 <!--
153 <li><a href="/doub/rss.php?type=co"><img src="/doub/themes/doub19th/img/rss_co.png" alt="fil RSS Commentaires" /></a></li>
154 <li><a href="/doub/atom.php"><img src="/doub/themes/doub19th/img/atom_03.png" alt="fil Atom 0.3" /></a></li>
155 <li><a href="/doub/atom.php?type=co"><img src="/doub/themes/doub19th/img/atom_co.png" alt="fil Atom Commentaires" /></a></li>
156 <li><a href="http://www.mozilla.org/projects/seamonkey/"><img src="/doub/themes/doub19th/img/seamonkey.png" alt="Get Seamonkey!" /></a></li>
157 <li><a href="http://www.mozilla-europe.org/fr/products/firefox/"><img src="/doub/themes/doub19th/img/firefox.png" alt="Get Firefox!" /></a></li>
158 <li><a href="http://httpd.apache.org/"><img src="/doub/themes/doub19th/img/apache.png" alt="Powered by Apache" /></a></li>
159 <li><a href="http://www.mysql.com/"><img src="/doub/themes/doub19th/img/mysql.png" alt="Powered by MySQL" /></a></li>
160 <li><a href="http://www.php.net/"><img src="/doub/themes/doub19th/img/php.png" alt="Powered by PHP" /></a></li>
161 <li><a href="http://www.dotclear.net/"><img src="/doub/themes/doub19th/img/dotclear.png" alt="propulsé par DotClear" /></a></li>
162 -->
163 <li><a href="http://www.arvixe.com"><img src="/img/arvixe.png" alt="Arvixe Web Hosting" /></a></li>
164 </ul>
165 </div>
166 </div>
167 </div>
168 </div> <!-- id="wrapper3col" -->
169
170 <div class="sidebar" id="sidebar">
171 <div id="navigation">
172 $flat_nav_bar
173 </div>
174 </div>
175 <hr class="invisible" />
176 </div> <!-- end #page -->
177
178 <p id="footer">
179 _(POWERED_BY_SPUTNIK)
180 </p>
181
182 </body>
183 </html>
184 ]===]
185
186 NAV_BAR = [===[
187 <h2>Sections</h2>
188 <ul id='menu'>
189 $do_sections[[
190 <li class='$class' id='$id'><a $link>$label</a></li>
191 ]] </ul>
192 <h2>Sub-sections</h2>
193 <ul id='submenu'>
194 $do_subsections[[
195 <li class='$class'><a $link>$label</a></li>
196 ]] </ul>
197 ]===]
198
199 FLAT_NAV_BAR = [===[
200 $do_sections[=[
201 <h2 id='$id'>$label</h2>
202 <ul id='$id'>
203 $do_subsections[[
204 <li class='$class'><a $link>$label</a></li>
205 ]] </ul>
206 ]=]]===]
207
208 LOGGED_OUT = [===[_(YOU_ARE_NOW_LOGGED_OUT)]===]
209
210 --------------------------------------------------------------------------------
211 ------- HISTORY, ETC -----------------------------------------------------------
212 --------------------------------------------------------------------------------
213
214 DATE_SELECTOR = [===[
215       <div id="date_selector" style="border:1px solid #bbb; background: #eee8aa; padding: 5 5 5 5">
216        _(CHANGES_BY_DATE) ($current_month):
217        <span class="history_dates">
218         $do_dates[=[$if_current_date[[$date]]|[[<a $date_link>$date</a>]]
219         ]=]
220        </span>
221        <br/>
222        _(CHOOSE_ANOTHER_MONTH) ($current_year) :
223        <span class="history_months">
224         $do_months[=[$if_current_month[[$month]]$if_other_month[[<a $month_link>$month</a>]]
225         ]=]
226        </span>
227        <br/>
228       </div> <!-- end of "date_selector" div-->
229       <br/>
230 ]===]
231
232 HISTORY = [===[
233       <form action="$base_url">
234        <input type="hidden" class="hidden" name="p" value="$node_name.diff"/>
235        <input type="submit" value="_(DIFF_SELECTED_VERSIONS)"/>
236        <table width="100%">
237         <tbody>
238          $do_revisions[==[
239           <tr> 
240             <td width="100px" $if_minor[[bgcolor="#f0f0f0"]]>
241              <a $version_link>$version</a>
242             </td>
243             <td width="5px" $if_minor[[bgcolor="#f0f0f0"]]>
244              <input class="diff_radio" type="radio" value="$version" name="other"/>
245             </td>
246             <td width="5px" $if_minor[[bgcolor="#f0f0f0"]]>
247              <input class="diff_radio" type="radio" value="$version" name="version"/>
248             </td>
249             <td width="50%" $if_minor[[bgcolor="#f0f0f0"]]>
250              _(BY_AUTHOR) $if_summary[[<ul><li>$summary</li></ul>]]
251             </td>
252           </tr>
253          ]==]
254         </tbody>
255        </table>
256       </form>
257 ]===]
258
259
260 COMPLETE_HISTORY = [===[
261       <table width="100%">
262         <tbody>
263          $do_revisions[==[
264           <tr> 
265             <td width="50px" $if_stale[[style="display:none"]] rowspan="$row_span">
266              &nbsp;
267              <a $latest_link>$title</a>
268              <a class="help" $history_link>_(HISTORY)</a>
269             </td>
270             <td width="100px" $if_minor[[bgcolor="#f0f0f0"]]>
271              <a $version_link>$version</a>
272              <a class="help" $diff_link>_(DIFF)</a>
273             </td>
274             <td width="50%" $if_minor[[bgcolor="#f0f0f0"]]>
275              _(BY_AUTHOR) $if_summary[[<ul><li>$summary</li></ul>]]
276             </td>
277           </tr>
278          ]==]
279         </tbody>
280        </table>
281 ]===]
282
283 DIFF = [===[
284         <ul> 
285          <li><a $link1><ins class='diffmod'>$version1</ins></a>_(BY_AUTHOR1)</li>
286          <li><a $link2><del class='diffmod'>$version2</del></a>_(BY_AUTHOR2)</li>
287         </ul>
288         $diff
289 ]===]
290
291 RSS = [===[<rss version="2.0">
292  <channel>
293   <title>$title</title>
294   <description/>
295    <link>$baseurl</link>
296      $items[[
297    <item>
298     <link>$link</link>
299     <title>$title</title>
300     <guid isPermalink="$ispermalink">$guid</guid>
301     <description>$summary</description>
302    </item>]]
303  </channel>
304 </rss>
305 ]===]
306
307 LIST_OF_ALL_PAGES = [===[
308        <H2>Regular Nodes</H2>
309        $do_regular_nodes[[<a href="$url">$name</a><br/>]]
310
311        <H2>Special Nodes</H2>
312        $do_special_nodes[[<a href="$url">$name</a><br/>]]
313 ]===]
314
315
316 SITEMAP_XML = [===[<?xml version="1.0" encoding="UTF-8"?>
317 <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
318 xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" 
319 xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
320    $do_urls[[<url>
321       <loc>$url</loc>
322       <lastmod>$lastmod</lastmod>
323       <changefreq>$changefreq</changefreq>
324       <priority>$priority</priority>
325    </url>]]
326 </urlset> 
327 ]===]
328
329 --------------------------------------------------------------------------------
330 ------- MISCELLANEOUS ----------------------------------------------------------
331 --------------------------------------------------------------------------------
332
333 EDIT = [===[
334       $if_try_again[[
335        <br/><font color='red'><b>$alert</b></font><br/><br/>
336       ]]
337    
338       <form method="post" action="$action_url">
339        <script type="text/javascript">
340          function toggleElements(class_name) {
341             var re = new RegExp('\\b' + "advanced_field" + '\\b');
342             var els = document.getElementsByTagName("div");
343             for(var i=0,j=els.length; i<j; i++) {
344                var elem = els[i];
345                if(re.test(elem.className)) {
346                   if (elem.style.display=="block") {
347                      elem.style.display = "none";
348                      document.getElementById("toggle_advanced_fields").innerHTML="_(SHOW_ADVANCED_OPTIONS)"
349                   } else {
350                      elem.style.display = "block";
351                      document.getElementById("toggle_advanced_fields").innerHTML="_(HIDE_ADVANCED_OPTIONS)"
352                   }
353                }
354             }
355          }
356          function expandTextArea() {
357             var elem = document.getElementById("main_text_area");
358             elem.style.width="915px";
359             elem.style.height="800px";
360             elem.style.margin="10px 10px 10px -205px";
361          }
362        </script>
363        <input class="hidden" type="hidden" name="p" value="$node_name.post"/>
364        <input class="hidden" type="hidden" name="post_token" value="$post_token"/>
365        <input class="hidden" type="hidden" name="post_timestamp" value="$post_timestamp"/>
366        <input class="hidden" type="hidden" name="post_fields" value="$post_fields"/>
367        $if_preview[[
368         <h2>_(PREVIEWING_UNSAVED_CHANGES)</h2>
369         <div class="preview">$preview</div>
370         <a href="#new_page_content_header" class="button">_(CHANGE)</a>
371         <input class="submit" type="submit" accesskey="s" name="action_save"    value="_(SAVE)"/>
372         <input class="submit" type="submit" accesskey="c" name="action_show"    value="_(CANCEL)"/>
373         <br/>
374        ]]
375        $html_for_fields
376        <input class="submit" type="submit" accesskey="s" name="action_save"    value="_(SAVE)"/>
377        <input class="submit" type="submit" accesskey="p" name="action_preview" value="_(PREVIEW)"/>
378        <input class="submit" type="submit" accesskey="c" name="action_show"    value="_(CANCEL)"/>
379       </form> 
380 ]===]
381
382 EDIT_FORM_HEADER        = [[<a name="$anchor"></a><h2>$label</h2>]]
383 EDIT_FORM_NOTE          = [[<h3>$label</h3>]]
384 EDIT_FORM_LABEL         = [[<label>$label</label>]]
385 EDIT_FORM_HONEYPOT      = [[<input type="text" value="$value" name="$name"/>]]
386 EDIT_FORM_TEXT_FIELD    = [[<input type="text" value="$value" name="$name"/>]]
387 EDIT_FORM_READONLY_TEXT = [[<input type="text" value="$value" name="$name" class="readonly" readonly="readonly" />]]
388 EDIT_FORM_PASSWORD      = [[<input type="password" value="$value" name="$name" size="20"></input>]]
389 --EDIT_FORM_TEXTAREA      = [[<textarea class="small" name="$name" rows="$rows">$value</textarea>]]
390 EDIT_FORM_TEXTAREA      = [[<textarea class="small" name="$name">$value</textarea>]]
391 --EDIT_FORM_BIG_TEXTAREA  = [[<textarea name="$name" id="main_text_area" rows="$rows" wrap="off">$value</textarea><br/>
392 --                            <a href="#" onclick="expandTextArea(); return false;">expand</a>]]
393 EDIT_FORM_BIG_TEXTAREA  = [[<textarea name="$name" id="main_text_area" rows="$rows">$value</textarea><br/>
394                             <a href="#" onclick="expandTextArea(); return false;">expand</a>]]
395 EDIT_FORM_CHECKBOX      = [[<input class="checkbox" style="border:1px solid black" 
396                                    type="checkbox" name="$name" value="yes"
397                                    $if_checked[=[checked="checked"]=] /><br/>]]
398 EDIT_FORM_SELECT        = [[<select name="$name">
399                                $do_options[===[<option $if_selected[=[selected="yes"]=]>$option</option>]===]
400                             </select>]]
401 EDIT_FORM_SHOW_ADVANCED = [[<a id="more_fields" href="#" class="local" onclick="toggleElements('advanced_field')">
402                              <div id="toggle_advanced_fields">_(SHOW_ADVANCED_OPTIONS)</div></a>]]
403
404
405 LOGIN_FORM              = [===[      
406       $if_try_again[[
407        <br/><font color='red'><b>$alert</b></font><br/><br/>
408       ]]
409    
410       <form method="post" action="$action_url">
411        <input class="hidden" type="hidden" name="p" value="$node_name.post"/>
412        <input class="hidden" type="hidden" name="post_token" value="$post_token"/>
413        <input class="hidden" type="hidden" name="post_timestamp" value="$post_timestamp"/>
414        <input class="hidden" type="hidden" name="post_fields" value="$post_fields"/>
415        $html_for_fields
416        <input class="submit" type="submit" accesskey="c" name="action_show_login_form"    value="_(LOGIN)"/>
417       </form> 
418
419 ]===]
420 --------------------------------------------------------------------------------
421 ------- DEALING WITH LUA CODE --------------------------------------------------
422 --------------------------------------------------------------------------------
423
424 LUA_CODE = [===[
425        $if_ok[[<font color="green">_(THIS_LUA_CODE_PARSES_CORRECTLY)</font>]]
426        $if_errors[[
427  <font color='red'>
428             <p><b>_(THIS_LUA_CODE_HAS_PROBLEMS)</b></p>
429     <code> $errors </code>
430          </font>]]
431
432        <div width="100%">
433         <style>
434          table.code {
435            width: 100%;
436            border-collapse: collapse
437            background: red;
438            border-style: none;
439          }
440  table.body {
441            background: yellow;
442  }
443  table.code tbody th {
444            font-size: 90%;
445  }
446  table.code tbody th a{
447     text-decoration: none;
448     color: white;
449  }
450          table.code th.lineno { 
451            width: 4em;
452          }
453          table.code th.bad {
454    background: red;
455  }
456          table.code tbody td {
457            //font: normal 120% monospace;
458            border: none;
459    //color: black;
460  }
461  table.code tbody td code {
462    background: white;
463          }
464  table.code tbody td code.bad{
465    background: yellow;
466  }
467         </style>
468         <table class="code">
469          <tbody>
470          $do_lines[[
471              <tr>
472               <th id="L$i" class="$class"><a href="#L$i">$i</a></th>
473               <td><code class="$class">$line</code></td>
474              </tr>
475          ]]
476         </tbody>
477        </table>
478       </div>
479 ]===]
480
481 ACTION_NOT_FOUND = [===[
482 <div class="error_message">
483   <p>_(PAGE_DOES_NOT_SUPPORT_ACTION)</p>
484   $if_custom_actions[[
485      <p>_(THIS_PAGE_DEFINED_THE_FOLLOWING_ACTIONS)</p>
486      <pre><code>$actions</code></pre>
487   ]]
488 </div>
489 ]===]
490
Powered by Sputnik