Changeset 540

Show
Ignore:
Timestamp:
2007-05-19 11:51:09 (2 years ago)
Author:
gaspard
Message:

[change] syntax for zafu changed from '<z:method>' to '<r:method>' better reflecting the fact that we "render"

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/nodes_controller.rb

    r530 r540  
    131131        # store the id used to preview versions 
    132132        session[:preview_id] = params[:preview_id] if params[:preview_id] 
     133        @title_for_layout = @node.rootpath 
    133134      end 
    134135      format.js do 
  • trunk/app/controllers/versions_controller.rb

    r527 r540  
    6161        # store the id used to preview when editing 
    6262        session[:preview_id] = params[:node_id] 
     63        @title_for_layout = @node.rootpath 
    6364        @edit = true 
    6465      end 
  • trunk/app/models/image.rb

    r518 r540  
    4747 
    4848Same example in a zafu template: 
    49  <z:img src='icon' format='pv'/> 
     49 <r:img src='icon' format='pv'/> 
    5050 
    5151or to create a link to the article using the icon: 
    52  <z:img src='icon' format='pv' href='self'/> 
     52 <r:img src='icon' format='pv' href='self'/> 
    5353  
    5454=end 
  • trunk/db/init/base/skins/default/Contact.html

    r480 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='body/container/content/main'> 
     1<r:include template='layout.html'> 
     2  <r:with part='body/container/content/main'> 
    33    <h1 do='title' attr='c_fullname' actions='all'>Gaspard Bucher</h1> 
    4   </z:with> 
    5 </z:include> 
     4  </r:with> 
     5</r:include> 
  • trunk/db/init/base/skins/default/Node.html

    r518 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='body/container/context'> 
    3     <z:project> 
     1<r:include template='layout.html'> 
     2  <r:with part='body/container/context'> 
     3    <r:project> 
    44      <h2 do='show' attr='name'>zena</h2> 
    5       <z:icon store='project'> 
    6         <z:img id='project_icon' mode='side' link='stored_project'/> 
    7         <z:else> 
     5      <r:icon store='project'> 
     6        <r:img id='project_icon' mode='side' link='stored_project'/> 
     7        <r:else> 
    88          <div class='header'> 
    99            <p class='sign' do='version' do='author' do='show' attr='initials'>GB</p> 
    1010          </div> 
    11           <z:summary or='v_text'/> 
    12         </z:else> 
    13       </z:icon> 
    14     </z:project> 
    15   </z:with> 
    16   <z:with part='body/container/content/main'> 
     11          <r:summary or='v_text'/> 
     12        </r:else> 
     13      </r:icon> 
     14    </r:project> 
     15  </r:with> 
     16  <r:with part='body/container/content/main'> 
    1717    <div class='header'> 
    1818      <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> 
    1919      <div class='subtitle'> 
    20         <z:case> 
    21           <z:when test='[user_id] == [v_user_id]'> 
    22             <z:trans>posted by</z:trans> <b do='author' do='show' attr='fullname'>Super Man</b> 
    23           </z:when> 
    24           <z:else> 
    25             <z:trans>original by</z:trans> <b do='show' attr='fullname'>Platon</b> 
    26             <z:trans>modified by</z:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b> 
    27           </z:else> 
    28         </z:case> 
     20        <r:case> 
     21          <r:when test='[user_id] == [v_user_id]'> 
     22            <r:trans>posted by</r:trans> <b do='author' do='show' attr='fullname'>Super Man</b> 
     23          </r:when> 
     24          <r:else> 
     25            <r:trans>original by</r:trans> <b do='show' attr='fullname'>Platon</b> 
     26            <r:trans>modified by</r:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b> 
     27          </r:else> 
     28        </r:case> 
    2929      </div> 
    3030    </div> 
    3131     
    32     <z:summary text=''/> 
    33     <z:text/> 
     32    <r:summary text=''/> 
     33    <r:text/> 
    3434    <!-- FIXME: comments --> 
    35   </z:with> 
    36 </z:include> 
     35  </r:with> 
     36</r:include> 
  • trunk/db/init/base/skins/default/Node_admin_layout.html

    r531 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='head/stylesheets' do='stylesheets' list='zen,comment,admin,search'/> 
     1<r:include template='layout.html'> 
     2  <r:with part='head/stylesheets'> 
     3    <r:stylesheets list='zen,comment,admin,search'/> 
     4    <link href="default.css" rel="Stylesheet" type="text/css"/> 
     5  </r:with> 
    36   
    4   <z:with part='body/container'> 
     7  <r:with part='body/container'> 
    58    <div id='context' do='void' name='context'> 
    69      <ul> 
     
    811      </ul> 
    912    </div> 
    10     <z:content_for_layout> 
     13    <r:content_for_layout> 
    1114      <div id='content' do='void' name='content'> 
    1215        <div id='main' do='void' name='main'> 
    13           <h2><z:trans>home of</z:trans> <z:user do='show' attr='fullname'>Panther Tigris</z:user></h2> 
     16          <h2><r:trans>home of</r:trans> <r:user do='show' attr='fullname'>Panther Tigris</r:user></h2> 
    1417        </div> 
    1518 
    1619        <div id='related' do='void' name='related'> 
    1720          <ul class='actions' do='user'> 
    18             <li do='to_publish'><z:trans>to publish</z:trans> 
     21            <li do='to_publish'><r:trans>to publish</r:trans> 
    1922              <ul class='list'> 
    20                 <li do='each' set_class='li_s[status]'><z:link attr='title'>title</z:show></li> 
     23                <li do='each' set_class='li_s[status]'><r:link attr='title'>title</r:show></li> 
    2124              </ul> 
    2225            </li> 
    23             <li do='comments_to_publish'><z:trans>comments to publish</z:trans> 
     26            <li do='comments_to_publish'><r:trans>comments to publish</r:trans> 
    2427              <ul class='list'> 
    25                 <li do='each'><z:show attr='title'>title</z:show></li> 
     28                <li do='each'><r:show attr='title'>title</r:show></li> 
    2629              </ul> 
    2730            </li> 
    28             <li do='proposed'><z:trans>waiting for publication</z:trans> 
     31            <li do='proposed'><r:trans>waiting for publication</r:trans> 
    2932              <ul class='list'> 
    30                 <li do='each'><z:show attr='title'>title</z:show></li> 
     33                <li do='each'><r:show attr='title'>title</r:show></li> 
    3134              </ul> 
    3235            </li> 
    33             <li do='redactions'><z:trans>redactions</z:trans> 
     36            <li do='redactions'><r:trans>redactions</r:trans> 
    3437              <ul class='list'> 
    35                 <li do='each' set_class='li_s[status]'><z:link attr='title'>title</z:show></li> 
     38                <li do='each' set_class='li_s[status]'><r:link attr='title'>title</r:show></li> 
    3639              </ul> 
    3740            </li> 
     
    3942        </div> 
    4043      </div> 
    41     </z:content_for_layout> 
    42   </z:with> 
    43 </z:include> 
     44    </r:content_for_layout> 
     45  </r:with> 
     46</r:include> 
  • trunk/db/init/base/skins/default/Node_index.html

    r471 r540  
    1 <z:include template='Project.html'/> 
     1<r:include template='Project.html'/> 
  • trunk/db/init/base/skins/default/Node_login.html

    r523 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='head'> 
     1<r:include template='layout.html'> 
     2  <r:with part='head'> 
    33  <title do='title_for_layout' do='trans'>login</title> 
    44  <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
    55  <meta http-equiv="Content-Language" do='void' content="fr-fr" tset_content='[v_lang]_content' /> 
    66 
    7   <z:stylesheets name='stylesheets' list='reset,zena,code'/> 
     7  <r:stylesheets name='stylesheets' list='reset,zena,code'/> 
    88 
    9   <z:javascripts list='prototype,effects,zena'/> 
    10   <z:uses_calendar/> 
     9  <r:javascripts list='prototype,effects,zena'/> 
     10  <r:uses_calendar/> 
    1111<style> 
    1212/* login, not found */ 
     
    5959.search p { font-size:0.85em; } 
    6060</style> 
    61 </z:with> 
    62   <z:with part='body/navigation/menu'/> 
    63   <z:with part='body/container'> 
     61</r:with> 
     62  <r:with part='body/navigation/menu'/> 
     63  <r:with part='body/container'> 
    6464    <div id='login_form'><div> 
    6565      <form action="/session" method="post">    <table> 
     
    7676        </table> 
    7777      </form></div></div> 
    78   </z:with> 
    79   <z:with part='body/siteinfo'/> 
    80 </z:include> 
     78  </r:with> 
     79  <r:with part='body/siteinfo'/> 
     80</r:include> 
  • trunk/db/init/base/skins/default/Node_not_found.html

    r489 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='body/navigation/menu'/> 
    3   <z:with part='body/container'> 
     1<r:include template='layout.html'> 
     2  <r:with part='body/navigation/menu'/> 
     3  <r:with part='body/container'> 
    44    <div id="not_found"><div> 
    5       <p><b><z:trans>Sorry, the requested page could not be found.</z:trans></b></p> 
    6       <p><z:trans>Please go </z:trans><a do='link' href='root' do='trans'>home</a>, 
    7          <a onclick="history.go(-2)" href="#"><z:trans>back</z:trans></a> 
    8          <z:trans>or</z:trans> <a href="/login" do='trans'>login</a> 
     5      <p><b><r:trans>Sorry, the requested page could not be found.</r:trans></b></p> 
     6      <p><r:trans>Please go </r:trans><a do='link' href='root' do='trans'>home</a>, 
     7         <a onclick="history.go(-2)" href="#"><r:trans>back</r:trans></a> 
     8         <r:trans>or</r:trans> <a href="/login" do='trans'>login</a> 
    99      </p> 
    1010    </div></div> 
    11   </z:with> 
    12 </z:include> 
     11  </r:with> 
     12</r:include> 
  • trunk/db/init/base/skins/default/Node_popup_layout.html

    r517 r540  
    88  <meta http-equiv="Content-Language" content="fr-fr" /> 
    99   
    10   <z:stylesheets list='popup,zena,search'/> 
    11   <z:javascripts list='prototype,effects,dragdrop,zena'/> 
     10  <r:stylesheets list='popup,zena,search'/> 
     11  <r:javascripts list='prototype,effects,dragdrop,zena'/> 
    1212<script type="text/javascript" charset="utf-8"> 
    1313// <![CDATA[ 
     
    1616// ]]> 
    1717</script> 
    18   <z:uses_calendar/> 
     18  <r:uses_calendar/> 
    1919</head> 
    2020 
    2121<body onLoad='popup_loaded();'> 
    2222  <div id='messages'> 
    23     <div id='loader'><img src='/images/ajax-loader.gif'/> <z:trans text='uploading'/></div> 
     23    <div id='loader'><img src='/images/ajax-loader.gif'/> <r:trans text='uploading'/></div> 
    2424  </div> 
    2525   
    26 <z:content_for_layout/> 
     26<r:content_for_layout/> 
    2727 
    2828</body> 
  • trunk/db/init/base/skins/default/Node_search.html

    r530 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='body/container/context'/> 
     1<r:include template='layout.html'> 
     2  <r:with part='body/container/context'/> 
    33 
    4   <z:with part='body/container/content/main'> 
     4  <r:with part='body/container/content/main'> 
    55     
    66    <h2 do=trans>search results</h2> 
     
    88    <ul id='search_results' do='search_results'> 
    99      <li class='result_entry' do='each'> 
    10         <p class='result_image'><z:img mode='pv'/></p> 
    11         <p class='result_name'><em><z:show attr='score' format='%.1f'/>%</em> <z:link/></p>       
    12         <p class='result_path'><z:show attr='rootpath'/></p> 
    13         <z:summary/> 
     10        <p class='result_image'><r:img mode='pv'/></p> 
     11        <p class='result_name'><em><r:show attr='score' format='%.1f'/>%</em> <r:link/></p>       
     12        <p class='result_path'><r:show attr='rootpath'/></p> 
     13        <r:summary/> 
    1414        <div class='clear'></div> 
    1515      </li> 
    16       <z:else> 
     16      <r:else> 
    1717        <p do='trans'>no result found</p> 
    18       </z:else> 
     18      </r:else> 
    1919    </ul> 
    20   </z:with> 
    21 </z:include> 
     20  </r:with> 
     21</r:include> 
  • trunk/db/init/base/skins/default/Node_tree.html

    r500 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='body/navigation/menu'/> 
     1<r:include template='layout.html'> 
     2  <r:with part='body/navigation/menu'/> 
    33   
    4   <z:with part='body/container/content/main'> 
     4  <r:with part='body/container/content/main'> 
    55  <div class='header'><h1 do='title' class='s30' status='true' actions='all'>this is the title</h1></div> 
    66    <ul class='tree' do='nodes'> 
    7       <li class='parent' do='parent'><z:title actions='all' link='tree'/></li> 
    8       <li class='current'><z:show attr='name'/></li> 
    9       <li do='each'><z:show attr='name' edit='true'/> 
     7      <li class='parent' do='parent'><r:title actions='all' link='tree'/></li> 
     8      <li class='current'><r:show attr='name'/></li> 
     9      <li do='each'><r:show attr='name' edit='true'/> 
    1010        <ul do='nodes' name='tree'> 
    1111          <li do='each'> 
    12             <z:link mode='tree' attr='name'/> 
     12            <r:link mode='tree' attr='name'/> 
    1313          </li> 
    1414        </ul> 
    1515      </li> 
    1616    </ul> 
    17   </z:with> 
     17  </r:with> 
    1818 
    19 </z:include> 
     19</r:include> 
  • trunk/db/init/base/skins/default/Project.html

    r532 r540  
    1 <z:include template='layout.html'> 
    2   <z:with part='body/container/context'> 
     1<r:include template='layout.html'> 
     2  <r:with part='body/container/context'> 
    33    <div id='small_calendar' do='calendar'/> 
    4     <z:hot> 
     4    <r:hot> 
    55      <div class='header'> 
    66        <h2 do='title' actions='all'>hot news</h2> 
    77        <p class='sign' do='version' do='author' do='show' attr='initials'>GB</p> 
    88      </div> 
    9       <z:summary or='v_text'/> 
    10     </z:hot> 
    11   </z:with> 
    12   <z:with part='body/container/content/main'> 
     9      <r:summary or='v_text'/> 
     10    </r:hot> 
     11  </r:with> 
     12  <r:with part='body/container/content/main'> 
    1313     
    14     <z:home> 
     14    <r:home> 
    1515      <div class='header'> 
    1616        <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> 
    1717        <div class='subtitle'> 
    18           <z:case> 
    19             <z:when test='[user_id] == [v_user_id]'> 
    20               <z:trans>posted by</z:trans> <b do='author' do='show' attr='fullname'>Super Man</b> 
    21             </z:when> 
    22             <z:else> 
    23               <z:trans>original by</z:trans> <b do='show' attr='fullname'>Platon</b> 
    24               <z:trans>modified by</z:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b> 
    25             </z:else> 
    26           </z:case> 
     18          <r:case> 
     19            <r:when test='[user_id] == [v_user_id]'> 
     20              <r:trans>posted by</r:trans> <b do='author' do='show' attr='fullname'>Super Man</b> 
     21            </r:when> 
     22            <r:else> 
     23              <r:trans>original by</r:trans> <b do='show' attr='fullname'>Platon</b> 
     24              <r:trans>modified by</r:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b> 
     25            </r:else> 
     26          </r:case> 
    2727        </div> 
    2828      </div> 
    2929 
    30       <z:summary text=''/> 
    31       <z:text/> 
    32       <z:else> 
     30      <r:summary text=''/> 
     31      <r:text/> 
     32      <r:else> 
    3333        <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> 
    34       </z:else> 
    35     </z:home> 
     34      </r:else> 
     35    </r:home> 
    3636     
    3737    <div id='largecal' style='display:none;'></div> 
    38     <z:include template='notes.html'/> 
    39   </z:with> 
    40 </z:include> 
     38    <r:include template='notes.html'/> 
     39  </r:with> 
     40</r:include> 
  • trunk/db/init/base/skins/default/layout.html

    r532 r540  
    77  <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
    88  <meta http-equiv="Content-Language" do='void' content="fr-fr" tset_content='[v_lang]_content' /> 
     9  <r:void name='stylesheets'> 
     10    <r:stylesheets list='reset,zena,code'/> 
     11    <link href="default.css" rel="Stylesheet" type="text/css"/> 
     12  </r:void> 
    913 
    10   <z:stylesheets name='stylesheets' list='reset,zena,code'/> 
    11   <link href="default.css" rel="Stylesheet" type="text/css"/> 
    12  
    13   <z:javascripts list='prototype,effects,zena'/> 
    14   <z:uses_calendar/> 
     14  <r:javascripts list='prototype,effects,zena'/> 
     15  <r:uses_calendar/> 
    1516</head> 
    1617 
     
    2728    <div id='nav_menu' do='node' name='menu' select='root'> 
    2829      <ul do='pages'> 
    29         <li do='each'><z:link attr='name'/> 
     30        <li do='each'><r:link attr='name'/> 
    3031          <ul do='pages'> 
    31             <li do='each'><z:link attr='name'/></li> 
     32            <li do='each'><r:link attr='name'/></li> 
    3233          </ul> 
    3334        </li> 
    3435      </ul> 
    3536    </div> 
    36     <div id='branding' do='link' href='root'><img src='/img/logo.png' width='220' height='100'/></div> 
     37    <div id='branding' do='link' name='branding' href='root'><img src='/img/logo.png' width='220' height='100'/></div> 
    3738  </div> 
    3839 
    3940 
    40   <z:flash_messages/> 
     41  <r:flash_messages/> 
    4142 
    42   <z:void name='container'> 
     43  <r:void name='container'> 
    4344    <div id='context' do='void' name='context'> 
    4445    </div> 
     
    4950 
    5051      <div id='related' do='void' name='related'> 
    51           <z:documents name='documents'><h3 class='group'>documents</h3> 
     52          <r:documents name='documents'><h3 class='group'>documents</h3> 
    5253            <ol> 
    53               <li do='each' set_class='li_s[v_status]'><z:link format='data'><z:img mode='tiny'/></z:link> <z:link><z:show attr='name'/>.<z:show attr='c_ext'/></z:link></li> 
    54               <li do='add'><a href='#' do='void' set_onclick='uploader=window.open("/documents/new?parent_id=[id]", "uploader", "location=1,width=400,height=300");return false;' set_href='/documents/new?parent_id=[id]'><z:trans>btn_add_doc</z:trans></a></li> 
     54              <li do='each' set_class='li_s[v_status]'><r:link format='data'><r:img mode='tiny'/></r:link> <r:link><r:show attr='name'/>.<r:show attr='c_ext'/></r:link></li> 
     55              <li do='add'><a href='#' do='void' set_onclick='uploader=window.open("/documents/new?parent_id=[id]", "uploader", "location=1,width=400,height=300");return false;' set_href='/documents/new?parent_id=[id]'><r:trans>btn_add_doc</r:trans></a></li> 
    5556            </ol> 
    56           </z:documents> 
    57           <z:if kind_of='Page' do='pages' name='pages'><h3 class='group'>pages</h3> 
     57          </r:documents> 
     58          <r:if kind_of='Page' do='pages' name='pages'><h3 class='group'>pages</h3> 
    5859            <ol> 
    5960              <li do='each' set_class='li_s[v_status]' do='link'/> 
    60               <z:add before='self' tag='li'/> 
    61               <z:form> 
     61              <r:add before='self' tag='li'/> 
     62              <r:form> 
    6263                <li class='inline_form'> 
    6364                  <form> 
    6465                    <p class='hidden'>      <input type='hidden' name='node[parent_id]' value='' do='void' set_value='[id]'/></p> 
    65                     <p class='node_klass'>  <z:input type='select' attr='klass' options='Page,Section,Skin,Project'/></p> 
     66                    <p class='node_klass'>  <r:input type='select' attr='klass' options='Page,Section,Skin,Project'/></p> 
    6667                    <p class='node_v_title'><input type='text' name='node[v_title]' value=''/></p> 
    6768                    <p class='btn_validate'><input type="submit" value='validate' do='void' tset_value='validate'/></p> 
    6869                  </form> 
    6970                </li> 
    70               </z:form> 
     71              </r:form> 
    7172            </ol> 
    72           </z:if> 
     73          </r:if> 
    7374      </div> 
    7475    </div> 
    75   </z:void> 
     76  </r:void> 
    7677  <ul id='siteinfo' do='void' name='siteinfo'> 
    7778    <li do='design'><a href='http://teti.ch'>teti.ch</a></li> 
  • trunk/db/init/base/skins/default/notes.html

    r497 r540  
    11<div id='notes' do='notes_all' limit='10' order='log_at DESC'> 
    22  <ul class='note_list'> 
    3     <z:add after='self' tag='li'/> 
    4     <z:form><li class='inline_form'><form> 
     3    <r:add after='self' tag='li'/> 
     4    <r:form><li class='inline_form'><form> 
    55        <p class='hidden'>      <input type='hidden' name='node[parent_id]' value='' do='void' set_value='[project_id]'/></p> 
    6         <p class='node_klass'>  <z:input type='select' attr='klass' options='Post,Letter'/></p> 
    7         <p class='node_log_at'> <z:input type='date_box' attr='log_at'/></p> 
     6        <p class='node_klass'>  <r:input type='select' attr='klass' options='Post,Letter'/></p> 
     7        <p class='node_log_at'> <r:input type='date_box' attr='log_at'/></p> 
    88        <p class='node_v_title'><input type='text' name='node[v_title]' do='void' set_value='[v_title]' size='25'/></p> 
    99        <p class='validate'>    <input type="submit" value='validate' do='void' tset_value='validate'/></p> 
    1010      </form></li> 
    11     </z:form> 
     11    </r:form> 
    1212    <li class='note' do='each'> 
    1313      <div class='header'> 
     
    1616          <p class='title' do='title'>our new cms runs in a zen garden</p> 
    1717          <p class='sign' do='version' do='author' do='show' attr='initials'>GB</p> 
    18           <z:actions select='all'/> 
     18          <r:actions select='all'/> 
    1919        </div> 
    2020      </div> 
    21       <z:summary or='v_text' limit='2'/> 
     21      <r:summary or='v_text' limit='2'/> 
    2222      <div class='clear'></div> 
    2323    </li> 
  • trunk/lib/parser/lib/rules/code_syntax.rb

    r513 r540  
    101101class ZafuTokenizer < Syntax::Tokenizer 
    102102  def step 
    103     if ztag = scan(/\A<\/?z:[^>]+>/)   
    104       ztag =~ /<(\/?)z:([^> ]+)([^>]*)(\/?)>/ 
    105       start_group :tag, "<#{$1}z:" 
     103    if ztag = scan(/\A<\/?r:[^>]+>/)   
     104      ztag =~ /<(\/?)r:([^> ]+)([^>]*)(\/?)>/ 
     105      start_group :tag, "<#{$1}r:" 
    106106      start_group :ztag, $2 
    107107      trailing = $4 
  • trunk/lib/parser/lib/rules/zafu.rb

    r513 r540  
    123123       
    124124      # end_tag 
    125       @end_tag = @html_tag || @options.delete(:end_do) || "z:#{@method}" 
     125      @end_tag = @html_tag || @options.delete(:end_do) || "r:#{@method}" 
    126126      @end_tag_count  = 1 
    127127       
     
    206206            flush $& 
    207207          end 
    208         elsif $1[0..1] == 'z:' 
    209           # /ztag 
     208        elsif $1[0..1] == 'r:' 
     209          # /rtag 
    210210          eat $& 
    211211          if $1 != @end_tag 
     212            puts [@end_tag, $1].inspect 
    212213            # error bad closing ztag 
    213214            store "<span class='parser_error'>#{$&.gsub('<', '&lt;').gsub('>','&gt;')}</span>" 
     
    240241    def scan_tag(opts={}) 
    241242      # puts "TAG(#{@method}): [#{@text}]" 
    242       if @text =~ /\A<z:([\w_]+)([^>]*?)(\/?)>/ 
    243         # puts "ZTAG:#{$~.to_a.inspect}}" # ztag 
     243      if @text =~ /\A<r:([\w_]+)([^>]*?)(\/?)>/ 
     244        # puts "RTAG:#{$~.to_a.inspect}}" # ztag 
    244245        eat $& 
    245246        opts.merge!(:method=>$1, :params=>$2) 
  • trunk/lib/parser/lib/rules/zena.rb

    r539 r540  
    325325     
    326326    # TODO: add parent_id into the form ! 
    327     # FIXME: use <z:form href='self'> or <z:form action='...'> 
     327    # FIXME: use <r:form href='self'> or <r:form action='...'> 
    328328    def r_form 
    329329      @pass[:form] = self 
     
    683683    # Shows a 'made with zena' link or logo. ;-) Thanks for using this ! 
    684684    # TODO: test and add translation. 
    685     # <z:zena show='logo'/> or <z:zena show='text'/> == <z:zena/> 
     685    # <r:zena show='logo'/> or <r:zena show='text'/> == <r:zena/> 
    686686    def r_zena 
    687687      if @params[:show] == 'logo' 
     
    715715    # :tattr (translated attribute used as text link) 
    716716    # :attr (attribute used as text link) 
    717     # <z:link href='node'><z:trans attr='lang'/></z:link> 
    718     # <z:link href='node' tattr='lang'/> 
     717    # <r:link href='node'><r:trans attr='lang'/></r:link> 
     718    # <r:link href='node' tattr='lang'/> 
    719719    def r_link 
    720720      # text 
     
    850850         
    851851        # FIXME: stored should be clarified and managed in a single way through links and contexts. 
    852         # <z:link href='stored_whatever'/> 
    853         # <z:pages from='stored_whatever'/> 
    854         # <z:pages from='project' project='stored_whatever'/> 
    855         # <z:img link='stored_whatever'/> 
     852        # <r:link href='stored_whatever'/> 
     853        # <r:pages from='stored_whatever'/> 
     854        # <r:pages from='project' project='stored_whatever'/> 
     855        # <r:img link='stored_whatever'/> 
    856856        # ... 
    857857        if value = @params[:author] 
     
    916916      end 
    917917    end 
    918     # <z:hot else='project'/> 
    919     # <z:relation role='hot,project'> = get relation if empty get project 
     918    # <r:hot else='project'/> 
     919    # <r:relation role='hot,project'> = get relation if empty get project 
    920920    # relation ? get ? role ? go ? 
    921921     
  • trunk/lib/parser/test/zafu.yml

    r503 r540  
    44 
    55hello: 
    6   src: "<z:hello/>" 
     6  src: "<r:hello/>" 
    77  res: "hello world!" 
    88   
    99double_hello: 
    10   src: "<z:hello/> <z:hello/>" 
     10  src: "<r:hello/> <r:hello/>" 
    1111  res: "hello world! hello world!" 
    1212 
     
    1616 
    1717hello_skip_content: 
    18   src: "<z:hello>I want to live forever</z:hello>" 
     18  src: "<r:hello>I want to live forever</r:hello>" 
    1919  res: "hello world!" 
    2020 
    2121tag_not_closed: 
    22   src: "this is <z:test super='life' is = \"fine\"" 
    23   res: "this is <z:test super='life' is = \"fine\"" 
     22  src: "this is <r:test super='life' is = \"fine\"" 
     23  res: "this is <r:test super='life' is = \"fine\"" 
    2424 
    2525hello_not_closed: 
    26   src: "I say <z:hello>blah blah" 
     26  src: "I say <r:hello>blah blah" 
    2727  res: "I say hello world!" 
    2828 
    2929test: 
    30   src: "this <z:test>is a test</z:test> <z:hello/>" 
     30  src: "this <r:test>is a test</r:test> <r:hello/>" 
    3131  res: "this [test]is a test[/test] hello world!" 
    3232   
    3333very_messy: 
    34   src: "this <z: blah> </z:truc> whak" 
    35   res: "this <z: blah> <span class='parser_error'>&lt;/z:truc&gt;</span> whak" 
     34  src: "this <r: blah> </r:truc> whak" 
     35  res: "this <r: blah> <span class='parser_error'>&lt;/z:truc&gt;</span> whak" 
    3636 
    3737bad_closing_tag: 
    38   src: "this <z:test>looks </z:truc> ok" 
     38  src: "this <r:test>looks </r:truc> ok" 
    3939  res: "this [test]looks <span class='parser_error'>&lt;/z:truc&gt;</span>[/test] ok" 
    4040 
     
    6060 
    6161do_tag_with_ztags: 
    62   src: "I say <div do='test'>this <z:hello/></div>" 
     62  src: "I say <div do='test'>this <r:hello/></div>" 
    6363  res: "I say [test]<div>this [hello/]</div>[/test]" 
    6464 
     
    7272 
    7373do_and_ztags: 
    74   src: "Hey <z:test>this is <p do='hello'>ok</p></z:test>" 
     74  src: "Hey <r:test>this is <p do='hello'>ok</p></r:test>" 
    7575  res: "Hey [test]this is [hello]<p>ok</p>[/hello][/test]" 
    7676 
     
    7979  res: "Hey [test]<p> is [hello]<p>hello <p>cool</p></p>[/hello]</p>[/test]"   
    8080expand_with: 
    81   src: "this <z:test>looks </z:test> ok" 
     81  src: "this <r:test>looks </r:test> ok" 
    8282  res: "this [test]looks [/test] ok" 
    8383   
    8484params: 
    85   src: "some <z:test good='choice' nice='work'>things</z:test> are fine" 
     85  src: "some <r:test good='choice' nice='work'>things</r:test> are fine" 
    8686  res: "some [test {= :good=>'choice', :nice=>'work'}]things[/test] are fine" 
    8787 
    8888default_menu: 
    89   src: "the <z:test>menu</z:test> is nice" 
     89  src: "the <r:test>menu</r:test> is nice" 
    9090  res: "the [test]menu[/test] is nice" 
    9191   
    9292include_menu: 
    93   src: "include_menu: <z:include template='/default/menu'/>" 
     93  src: "include_menu: <r:include template='/default/menu'/>" 
    9494  res: "include_menu: the [test]menu[/test] is nice" 
    9595 
    9696include_context: 
    97   src: "include_context: <z:include template='menu'/>" 
     97  src: "include_context: <r:include template='menu'/>" 
    9898  res: "include_context: include_menu: the [test]menu[/test] is nice" 
    9999 
    100100infinite_loop: 
    101   src: "<z:include template='/infinite/loop'/>" 
     101  src: "<r:include template='/infinite/loop'/>" 
    102102  res: "<span class='parser_error'>[include error: /infinite/loop --&gt; /infinite/loop ]</span>" 
    103103   
    104104infinite_foo: 
    105   src: "<z:include template='bar'/>" 
     105  src: "<r:include template='bar'/>" 
    106106  res: "<span class='parser_error'>[include error: /infinite/foo --&gt; /infinite/bar --&gt; /infinite/foo ]</span>" 
    107107   
    108108infinite_bar: 
    109   src: "<z:include template='foo'/>" 
     109  src: "<r:include template='foo'/>" 
    110110  res: "<span class='parser_error'>[include error: /infinite/bar --&gt; /infinite/foo --&gt; /infinite/bar ]</span>" 
    111111   
    112112default_context: 
    113   src: "from other: <z:include template='menu'/> and <z:include template='/include/menu'/>" 
     113  src: "from other: <r:include template='menu'/> and <r:include template='/include/menu'/>" 
    114114  res: "from other: the [test]menu[/test] is nice and include_menu: the [test]menu[/test] is nice" 
    115115 
    116116set_context: 
    117   src: "res:<z:test/> <z:set_context truc='machin'>src:<z:test/></z:set_context> res:<z:test/>" 
     117  src: "res:<r:test/> <r:set_context truc='machin'>src:<r:test/></r:set_context> res:<r:test/>" 
    118118  res: "res:[test/] src:[test {> :truc=>'machin'}/] res:[test/]" 
    119119   
    120120nested_set_context: 
    121   src: "<z:set_context var1='out' var2='foo'>1:<z:test/><z:set_context var1='in'>2:<z:test/></z:set_context>3:<z:test/></z:set_context>" 
     121  src: "<r:set_context var1='out' var2='foo'>1:<r:test/><r:set_context var1='in'>2:<r:test/></r:set_context>3:<r:test/></r:set_context>" 
    122122  res: "1:[test {> :var1=>'out', :var2=>'foo'}/]2:[test {> :var1=>'in', :var2=>'foo'}/]3:[test {> :var1=>'out', :var2=>'foo'}/]" 
    123123 
    124124complex_example: 
    125125  src: | 
    126     Some people say <z:hello/> 
    127     Some say <z:include template='/default/menu'/> 
     126    Some people say <r:hello/> 
     127    Some say <r:include template='/default/menu'/> 
    128128      <ul class='list' do='set_context' life='ok'> 
    129129        <li>truc</li> 
     
    131131        <li do='test'>sunny day</li> 
    132132      </ul> 
    133     <z:set_context var='complex'><z:include template='/default/menu'/></z:set_context> 
     133    <r:set_context var='complex'><r:include template='/default/menu'/></r:set_context> 
    134134  res: | 
    135135    Some people say hello world! 
     
    143143 
    144144unknown: 
    145   src:  "this looks bad: <z:system truc='lala'/>" 
     145  src:  "this looks bad: <r:system truc='lala'/>" 
    146146  res: "this looks bad: <span class='parser_unknown'>&lt;z:system truc='lala'/&gt;</span>" 
    147147   
    148148check_params: 
    149   src: "bad <z:missing/> params" 
     149  src: "bad <r:missing/> params" 
    150150  res: "bad [missing parameter(s) missing:good, night] params" 
    151151 
    152152check_params_partial: 
    153   src: "bad <z:missing good='ok'/> params" 
     153  src: "bad <r:missing good='ok'/> params" 
    154154  res: "bad [missing parameter(s) missing:night] params" 
    155155 
    156156check_params_ok: 
    157   src: "bad <z:missing good='ok' night='hey'/> params" 
     157  src: "bad <r:missing good='ok' night='hey'/> params" 
    158158  res: "bad nothing missing params" 
    159159 
     
    170170    [/test]end 
    171171no_tag: 
    172   src: "<z:set_context no_test='true'>this is a <z:test>test</z:test>dog</z:set_context>" 
     172  src: "<r:set_context no_test='true'>this is a <r:test>test</r:test>dog</r:set_context>" 
    173173  res: "this is a dog" 
    174174   
    175175html_comments: 
    176   src: "<z:test><z:hello/><!-- this is nothing > <z:hello/>  --></z:test>" 
    177   res: "[test][hello/]<!-- this is nothing > <z:hello/>  -->[/test]" 
     176  src: "<r:test><r:hello/><!-- this is nothing > <r:hello/>  --></r:test>" 
     177  res: "[test][hello/]<!-- this is nothing > <r:hello/>  -->[/test]" 
    178178 
    179179html_do_comment: 
    180   src: "<z:test><z:hello/><!--|this is not a comment <z:hello/>  --></z:test>" 
     180  src: "<r:test><r:hello/><!--|this is not a comment <r:hello/>  --></r:test>" 
    181181  res: "[test][hello/]this is not a comment [hello/]  [/test]" 
    182182 
    183183do_simple: 
    184   src: "<z:test do='hello'/>" 
     184  src: "<r:test do='hello'/>" 
    185185  res: "[test][hello/][/test]" 
    186186   
     
    190190   
    191191do_multiple: 
    192   src: "<z:test param='1' do='test' param='2' do='hello' param='3'/>" 
     192  src: "<r:test param='1' do='test' param='2' do='hello' param='3'/>" 
    193193  res: "[test {= :param=>'1'}][test {= :param=>'2'}][hello {= :param=>'3'}/][/test][/test]" 
    194194 
    195195do_with_inner: 
    196   src: "<z:test do='hello'>a thing <z:hello/> here</z:test>" 
     196  src: "<r:test do='hello'>a thing <r:hello/> here</r:test>" 
    19719